#
8afeab4c |
|
17-Apr-2024 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: eficonfig: check initrd path allocation After allocating memory for the initrd file path we need to check the initrd buffer pointer is not NULL. Fixes: 87d791423ac6 ("eficonfig: menu-driven addition of UEFI boot option") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
|
#
f19171c9 |
|
08-Jan-2024 |
Ilias Apalodimas <ilias.apalodimas@linaro.org> |
efi_loader: Clean up efi_dp_append and efi_dp_concat Looking back at the initrd storing functionality, we introduced three functions, efi_dp_append_or_concatenate(), efi_dp_append/concat(). In hindsight we could have simplified that by a lot. First of all none of the functions append anything. They all allocate a new device path and concatenate the contents of two device paths in one. A boolean parameter controls the final device path -- if that's true an end node is injected between the two device paths. So let's rewrite this and make it a bit easier to read. Get rid of efi_dp_append(), efi_dp_concat() and rename efi_dp_append_or_concatenate() to efi_dp_concat(). This is far more intuitive and the only adjustment that is needed is an extra boolean argument on all callsites. Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
64658007 |
|
17-Nov-2023 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: eficonfig: create shortened boot options The boot options created by eficonfig should use shortened device-paths to avoid problems if drives are enumerated in a different sequence. Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
9945bc4f |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Fix incorrect return code of boot option update Correct the return code for out-of-memory and no boot option found Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
339b527b |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Move bootorder and bootoption apis to lib Rename and move bootorder and bootoption apis from cmd to lib for re-use between eficonfig and bootmgr Fix 'unexpected indentation' when 'make htmldocs' after functions are moved Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
2c0b0c31 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_SECURE_BOOT This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_SECURE_BOOT defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
83f3d121 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_MM_COMM_TEE This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_MM_COMM_TEE defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
88df3634 |
|
02-Feb-2023 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: CTRL+S to save the boot order 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>
|
#
45f5319f |
|
02-Feb-2023 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
menu: remove CTRL+C to quit On the sandbox called without "--terminal raw" CTRL+C leaves U-Boot, "ESC/CTRL+C to quit" is misleading. Let's remove CTRL+C to quit key handling from bootmenu and eficonfig menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
|
#
8dbd0a0f |
|
23-Jan-2023 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: add vertical scroll support The current eficonfig menu does not support vertical scroll, so it can not display the menu entries greater than the console row size. This commit add the vertial scroll support. The console size is retrieved by SIMPLE_TEXT_OUTPUT_PROTOCOL.QueryMode() service, then calculates the row size for menu entry by subtracting menu header and description row size from the console row size. "start" and "end" are added in the efimenu structure. "start" keeps the menu entry index at the top, "end" keeps the bottom menu entry index. item_data_print() menu function only draws the menu entry between "start" and "end". This commit also fixes the issue that "Save" and "Quit" entries can be moved by BKEY_PLUS in change boot order menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
0d590852 |
|
23-Jan-2023 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: refactor change boot order implementation This commit removes the change boot order specific menu implementation. The change boot order implementation calls eficonfig_process_common() same as other menus. The change boot order menu requires own item_data_print and item_choice implementation, but display_statusline function can be a same function as other menus. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
cd160b27 |
|
23-Jan-2023 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: refactor eficonfig_process_common function Current change boot order implementation does not call eficonfig_process_common() and call own menu functions for display_statusline, item_data_print and item_choice. Change boot order functionality should call eficonfig_process_common() to improve maintenanceability. This commit is a preparation to remove the change boot order specific implementation. The menu functions (display_statusline, item_data_print and item_choice) are added as argument of eficonfig_process_common(). The menu description string displayed at the bottom of the menu is also added as argument. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
32bab0ea |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Make use of CLI character processing Avoid duplicating some of the escape-sequence processing here and use the CLI function instead. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
d0ca98db |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Update bootmenu_loop() to return the code Use the return value to save having to pass around a pointer. This also resolves any ambiguity about what *key contains when the function is called. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
2da4a15e |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Rename KEY_... to BKEY_... This enum values conflict with linux/input.h so rename them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
64550274 |
|
18-Dec-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: avoid SetVariable between GetNextVariableName calls The current code calls efi_set_variable_int() to delete the invalid boot option between calls to efi_get_next_variable_name_int(), it may produce unpredictable results. This commit moves removal of the invalid boot option outside of the efi_get_next_variable_name_int() calls. EFI_NOT_FOUND returned from efi_get_next_variable_name_int() indicates we retrieved all EFI variables, it should be treated as EFI_SUCEESS. To address the checkpatch warning of too many leading tabs, combine two if statement into one. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
ce327084 |
|
18-Dec-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: carve out efi_get_next_variable_name_int calls To retrieve the EFI variable name by efi_get_next_variable_name_int(), the sequence of alloc -> efi_get_next_variable_name_int -> realloc -> efi_get_next_variable_name_int is required. In current code, this sequence repeatedly appears in the several functions. It should be curved out a common function. This commit also fixes the missing free() of var_name16 in eficonfig_delete_invalid_boot_option(). Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
140a8959 |
|
01-Dec-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: use efi_get_next_variable_name_int() eficonfig command reads all possible UEFI load options from 0x0000 to 0xFFFF to construct the menu. This takes too much time in some environment. This commit uses efi_get_next_variable_name_int() to read all existing UEFI load options to significantlly reduce the count of efi_get_var() call. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
78b1ccc4 |
|
01-Dec-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: use u16_strsize() to get u16 string buffer size Use u16_strsize() to simplify the u16 string buffer size calculation. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c67d3c9e |
|
01-Dec-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: fix going one directory up issue The directory name in eficonfig menu entry contains the '\' separator. strcmp() argument ".." is wrong and one directory up handling does not work correctly. strcmp() argument must include '\' separator. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c3b5af63 |
|
19-Nov-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: add UEFI Secure Boot Key enrollment interface This commit adds the menu-driven UEFI Secure Boot Key enrollment interface. User can enroll PK, KEK, db and dbx by selecting file. Only the signed EFI Signature List(s) with an authenticated header, typically '.auth' file, is accepted. To clear the PK, KEK, db and dbx, user needs to enroll the null key signed by PK or KEK. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
21faf4ef |
|
19-Nov-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: use protocol interface for file selection EFI_SIMPLE_FILE_SYSTEM_PROTOCOL is not always provided by U-Boot. Use protocol interface functions instead of U-Boot internal functions. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d6566113 |
|
19-Nov-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: expose eficonfig_create_device_path() Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use eficonfig_create_device_path() to construct the full device path from device path of the volume and file path, so move it out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d571f9b2 |
|
19-Nov-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: refactor change boot order implementation All the eficonfig menus other than "Change Boot Order" use 'eficonfig_entry' structure for each menu entry. This commit refactors change boot order implementation to use 'eficonfig_entry' structure same as other menus to have consistent menu handling. This commit also simplifies the data->active handling when KEY_SPACE is pressed, and sizeof() parameter. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
8961e93e |
|
19-Nov-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: expose append entry function Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use append_entry() and append_quit_entry() to construct the menu, so move them out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
a84040ab |
|
19-Nov-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: refactor file selection handling eficonfig_select_file_handler() is commonly used to select the file. eficonfig_display_select_file_option() adds an additional menu to clear the selected file. eficonfig_display_select_file_option() is not always necessary for the file selection process, so it must be outside of eficonfig_select_file_handler(). This commit also renames the following functions to avoid confusion. eficonfig_select_file_handler() -> eficonfig_process_select_file() eficonfig_select_file() -> eficonfig_show_file_selection() eficonfig_display_select_file_option() -> eficonfig_process_show_file_option() Finally, test_eficonfig.py need to be updated to get aligned with the above modification. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
1167e88a |
|
14-Nov-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: fix missing variable initialization The 'ret' variable must be initialized before use in eficonfig_delete_invalid_boot_option(). Fixes: c416f1c0bc ("bootmenu: add removable media entries") Addresses-Coverity: 376207 ("Uninitialized variables") Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
3d595ac5 |
|
09-Nov-2022 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: remove superfluous if in eficonfig_edit_boot_option Goto for an immediately succeeding label is superfluous. Fixes: 87d791423ac6 ("eficonfig: menu-driven addition of UEFI boot option") Addresses-Coverity: 376202 ("Identical code for different branches") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
8afeab4c |
|
17-Apr-2024 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: eficonfig: check initrd path allocation After allocating memory for the initrd file path we need to check the initrd buffer pointer is not NULL. Fixes: 87d791423ac6 ("eficonfig: menu-driven addition of UEFI boot option") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
|
#
f19171c9 |
|
08-Jan-2024 |
Ilias Apalodimas <ilias.apalodimas@linaro.org> |
efi_loader: Clean up efi_dp_append and efi_dp_concat Looking back at the initrd storing functionality, we introduced three functions, efi_dp_append_or_concatenate(), efi_dp_append/concat(). In hindsight we could have simplified that by a lot. First of all none of the functions append anything. They all allocate a new device path and concatenate the contents of two device paths in one. A boolean parameter controls the final device path -- if that's true an end node is injected between the two device paths. So let's rewrite this and make it a bit easier to read. Get rid of efi_dp_append(), efi_dp_concat() and rename efi_dp_append_or_concatenate() to efi_dp_concat(). This is far more intuitive and the only adjustment that is needed is an extra boolean argument on all callsites. Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
64658007 |
|
17-Nov-2023 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: eficonfig: create shortened boot options The boot options created by eficonfig should use shortened device-paths to avoid problems if drives are enumerated in a different sequence. Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
9945bc4f |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Fix incorrect return code of boot option update Correct the return code for out-of-memory and no boot option found Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
339b527b |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Move bootorder and bootoption apis to lib Rename and move bootorder and bootoption apis from cmd to lib for re-use between eficonfig and bootmgr Fix 'unexpected indentation' when 'make htmldocs' after functions are moved Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
2c0b0c31 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_SECURE_BOOT This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_SECURE_BOOT defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
83f3d121 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_MM_COMM_TEE This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_MM_COMM_TEE defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
88df3634 |
|
02-Feb-2023 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: CTRL+S to save the boot order 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>
|
#
45f5319f |
|
02-Feb-2023 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
menu: remove CTRL+C to quit On the sandbox called without "--terminal raw" CTRL+C leaves U-Boot, "ESC/CTRL+C to quit" is misleading. Let's remove CTRL+C to quit key handling from bootmenu and eficonfig menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
|
#
8dbd0a0f |
|
23-Jan-2023 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: add vertical scroll support The current eficonfig menu does not support vertical scroll, so it can not display the menu entries greater than the console row size. This commit add the vertial scroll support. The console size is retrieved by SIMPLE_TEXT_OUTPUT_PROTOCOL.QueryMode() service, then calculates the row size for menu entry by subtracting menu header and description row size from the console row size. "start" and "end" are added in the efimenu structure. "start" keeps the menu entry index at the top, "end" keeps the bottom menu entry index. item_data_print() menu function only draws the menu entry between "start" and "end". This commit also fixes the issue that "Save" and "Quit" entries can be moved by BKEY_PLUS in change boot order menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
0d590852 |
|
23-Jan-2023 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: refactor change boot order implementation This commit removes the change boot order specific menu implementation. The change boot order implementation calls eficonfig_process_common() same as other menus. The change boot order menu requires own item_data_print and item_choice implementation, but display_statusline function can be a same function as other menus. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
cd160b27 |
|
23-Jan-2023 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: refactor eficonfig_process_common function Current change boot order implementation does not call eficonfig_process_common() and call own menu functions for display_statusline, item_data_print and item_choice. Change boot order functionality should call eficonfig_process_common() to improve maintenanceability. This commit is a preparation to remove the change boot order specific implementation. The menu functions (display_statusline, item_data_print and item_choice) are added as argument of eficonfig_process_common(). The menu description string displayed at the bottom of the menu is also added as argument. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
32bab0ea |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Make use of CLI character processing Avoid duplicating some of the escape-sequence processing here and use the CLI function instead. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
d0ca98db |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Update bootmenu_loop() to return the code Use the return value to save having to pass around a pointer. This also resolves any ambiguity about what *key contains when the function is called. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
2da4a15e |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Rename KEY_... to BKEY_... This enum values conflict with linux/input.h so rename them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
64550274 |
|
18-Dec-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: avoid SetVariable between GetNextVariableName calls The current code calls efi_set_variable_int() to delete the invalid boot option between calls to efi_get_next_variable_name_int(), it may produce unpredictable results. This commit moves removal of the invalid boot option outside of the efi_get_next_variable_name_int() calls. EFI_NOT_FOUND returned from efi_get_next_variable_name_int() indicates we retrieved all EFI variables, it should be treated as EFI_SUCEESS. To address the checkpatch warning of too many leading tabs, combine two if statement into one. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
ce327084 |
|
18-Dec-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: carve out efi_get_next_variable_name_int calls To retrieve the EFI variable name by efi_get_next_variable_name_int(), the sequence of alloc -> efi_get_next_variable_name_int -> realloc -> efi_get_next_variable_name_int is required. In current code, this sequence repeatedly appears in the several functions. It should be curved out a common function. This commit also fixes the missing free() of var_name16 in eficonfig_delete_invalid_boot_option(). Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
140a8959 |
|
01-Dec-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: use efi_get_next_variable_name_int() eficonfig command reads all possible UEFI load options from 0x0000 to 0xFFFF to construct the menu. This takes too much time in some environment. This commit uses efi_get_next_variable_name_int() to read all existing UEFI load options to significantlly reduce the count of efi_get_var() call. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
78b1ccc4 |
|
01-Dec-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: use u16_strsize() to get u16 string buffer size Use u16_strsize() to simplify the u16 string buffer size calculation. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c67d3c9e |
|
01-Dec-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: fix going one directory up issue The directory name in eficonfig menu entry contains the '\' separator. strcmp() argument ".." is wrong and one directory up handling does not work correctly. strcmp() argument must include '\' separator. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c3b5af63 |
|
19-Nov-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: add UEFI Secure Boot Key enrollment interface This commit adds the menu-driven UEFI Secure Boot Key enrollment interface. User can enroll PK, KEK, db and dbx by selecting file. Only the signed EFI Signature List(s) with an authenticated header, typically '.auth' file, is accepted. To clear the PK, KEK, db and dbx, user needs to enroll the null key signed by PK or KEK. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
21faf4ef |
|
19-Nov-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: use protocol interface for file selection EFI_SIMPLE_FILE_SYSTEM_PROTOCOL is not always provided by U-Boot. Use protocol interface functions instead of U-Boot internal functions. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d6566113 |
|
19-Nov-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: expose eficonfig_create_device_path() Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use eficonfig_create_device_path() to construct the full device path from device path of the volume and file path, so move it out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d571f9b2 |
|
19-Nov-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: refactor change boot order implementation All the eficonfig menus other than "Change Boot Order" use 'eficonfig_entry' structure for each menu entry. This commit refactors change boot order implementation to use 'eficonfig_entry' structure same as other menus to have consistent menu handling. This commit also simplifies the data->active handling when KEY_SPACE is pressed, and sizeof() parameter. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
8961e93e |
|
19-Nov-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: expose append entry function Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use append_entry() and append_quit_entry() to construct the menu, so move them out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
a84040ab |
|
19-Nov-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: refactor file selection handling eficonfig_select_file_handler() is commonly used to select the file. eficonfig_display_select_file_option() adds an additional menu to clear the selected file. eficonfig_display_select_file_option() is not always necessary for the file selection process, so it must be outside of eficonfig_select_file_handler(). This commit also renames the following functions to avoid confusion. eficonfig_select_file_handler() -> eficonfig_process_select_file() eficonfig_select_file() -> eficonfig_show_file_selection() eficonfig_display_select_file_option() -> eficonfig_process_show_file_option() Finally, test_eficonfig.py need to be updated to get aligned with the above modification. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
1167e88a |
|
14-Nov-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: fix missing variable initialization The 'ret' variable must be initialized before use in eficonfig_delete_invalid_boot_option(). Fixes: c416f1c0bc ("bootmenu: add removable media entries") Addresses-Coverity: 376207 ("Uninitialized variables") Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
3d595ac5 |
|
09-Nov-2022 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: remove superfluous if in eficonfig_edit_boot_option Goto for an immediately succeeding label is superfluous. Fixes: 87d791423ac6 ("eficonfig: menu-driven addition of UEFI boot option") Addresses-Coverity: 376202 ("Identical code for different branches") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
8afeab4c |
|
17-Apr-2024 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: eficonfig: check initrd path allocation After allocating memory for the initrd file path we need to check the initrd buffer pointer is not NULL. Fixes: 87d791423ac6 ("eficonfig: menu-driven addition of UEFI boot option") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
|
#
f19171c9 |
|
08-Jan-2024 |
Ilias Apalodimas <ilias.apalodimas@linaro.org> |
efi_loader: Clean up efi_dp_append and efi_dp_concat Looking back at the initrd storing functionality, we introduced three functions, efi_dp_append_or_concatenate(), efi_dp_append/concat(). In hindsight we could have simplified that by a lot. First of all none of the functions append anything. They all allocate a new device path and concatenate the contents of two device paths in one. A boolean parameter controls the final device path -- if that's true an end node is injected between the two device paths. So let's rewrite this and make it a bit easier to read. Get rid of efi_dp_append(), efi_dp_concat() and rename efi_dp_append_or_concatenate() to efi_dp_concat(). This is far more intuitive and the only adjustment that is needed is an extra boolean argument on all callsites. Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
64658007 |
|
17-Nov-2023 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: eficonfig: create shortened boot options The boot options created by eficonfig should use shortened device-paths to avoid problems if drives are enumerated in a different sequence. Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
9945bc4f |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Fix incorrect return code of boot option update Correct the return code for out-of-memory and no boot option found Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
339b527b |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Move bootorder and bootoption apis to lib Rename and move bootorder and bootoption apis from cmd to lib for re-use between eficonfig and bootmgr Fix 'unexpected indentation' when 'make htmldocs' after functions are moved Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
2c0b0c31 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_SECURE_BOOT This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_SECURE_BOOT defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
83f3d121 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_MM_COMM_TEE This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_MM_COMM_TEE defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
88df3634 |
|
02-Feb-2023 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: CTRL+S to save the boot order 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>
|
#
45f5319f |
|
02-Feb-2023 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
menu: remove CTRL+C to quit On the sandbox called without "--terminal raw" CTRL+C leaves U-Boot, "ESC/CTRL+C to quit" is misleading. Let's remove CTRL+C to quit key handling from bootmenu and eficonfig menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
|
#
8dbd0a0f |
|
23-Jan-2023 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: add vertical scroll support The current eficonfig menu does not support vertical scroll, so it can not display the menu entries greater than the console row size. This commit add the vertial scroll support. The console size is retrieved by SIMPLE_TEXT_OUTPUT_PROTOCOL.QueryMode() service, then calculates the row size for menu entry by subtracting menu header and description row size from the console row size. "start" and "end" are added in the efimenu structure. "start" keeps the menu entry index at the top, "end" keeps the bottom menu entry index. item_data_print() menu function only draws the menu entry between "start" and "end". This commit also fixes the issue that "Save" and "Quit" entries can be moved by BKEY_PLUS in change boot order menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
0d590852 |
|
23-Jan-2023 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: refactor change boot order implementation This commit removes the change boot order specific menu implementation. The change boot order implementation calls eficonfig_process_common() same as other menus. The change boot order menu requires own item_data_print and item_choice implementation, but display_statusline function can be a same function as other menus. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
cd160b27 |
|
23-Jan-2023 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: refactor eficonfig_process_common function Current change boot order implementation does not call eficonfig_process_common() and call own menu functions for display_statusline, item_data_print and item_choice. Change boot order functionality should call eficonfig_process_common() to improve maintenanceability. This commit is a preparation to remove the change boot order specific implementation. The menu functions (display_statusline, item_data_print and item_choice) are added as argument of eficonfig_process_common(). The menu description string displayed at the bottom of the menu is also added as argument. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
32bab0ea |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Make use of CLI character processing Avoid duplicating some of the escape-sequence processing here and use the CLI function instead. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
d0ca98db |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Update bootmenu_loop() to return the code Use the return value to save having to pass around a pointer. This also resolves any ambiguity about what *key contains when the function is called. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
2da4a15e |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Rename KEY_... to BKEY_... This enum values conflict with linux/input.h so rename them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
64550274 |
|
18-Dec-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: avoid SetVariable between GetNextVariableName calls The current code calls efi_set_variable_int() to delete the invalid boot option between calls to efi_get_next_variable_name_int(), it may produce unpredictable results. This commit moves removal of the invalid boot option outside of the efi_get_next_variable_name_int() calls. EFI_NOT_FOUND returned from efi_get_next_variable_name_int() indicates we retrieved all EFI variables, it should be treated as EFI_SUCEESS. To address the checkpatch warning of too many leading tabs, combine two if statement into one. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
ce327084 |
|
18-Dec-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: carve out efi_get_next_variable_name_int calls To retrieve the EFI variable name by efi_get_next_variable_name_int(), the sequence of alloc -> efi_get_next_variable_name_int -> realloc -> efi_get_next_variable_name_int is required. In current code, this sequence repeatedly appears in the several functions. It should be curved out a common function. This commit also fixes the missing free() of var_name16 in eficonfig_delete_invalid_boot_option(). Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
140a8959 |
|
01-Dec-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: use efi_get_next_variable_name_int() eficonfig command reads all possible UEFI load options from 0x0000 to 0xFFFF to construct the menu. This takes too much time in some environment. This commit uses efi_get_next_variable_name_int() to read all existing UEFI load options to significantlly reduce the count of efi_get_var() call. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
78b1ccc4 |
|
01-Dec-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: use u16_strsize() to get u16 string buffer size Use u16_strsize() to simplify the u16 string buffer size calculation. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c67d3c9e |
|
01-Dec-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: fix going one directory up issue The directory name in eficonfig menu entry contains the '\' separator. strcmp() argument ".." is wrong and one directory up handling does not work correctly. strcmp() argument must include '\' separator. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c3b5af63 |
|
19-Nov-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: add UEFI Secure Boot Key enrollment interface This commit adds the menu-driven UEFI Secure Boot Key enrollment interface. User can enroll PK, KEK, db and dbx by selecting file. Only the signed EFI Signature List(s) with an authenticated header, typically '.auth' file, is accepted. To clear the PK, KEK, db and dbx, user needs to enroll the null key signed by PK or KEK. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
21faf4ef |
|
19-Nov-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: use protocol interface for file selection EFI_SIMPLE_FILE_SYSTEM_PROTOCOL is not always provided by U-Boot. Use protocol interface functions instead of U-Boot internal functions. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d6566113 |
|
19-Nov-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: expose eficonfig_create_device_path() Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use eficonfig_create_device_path() to construct the full device path from device path of the volume and file path, so move it out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d571f9b2 |
|
19-Nov-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: refactor change boot order implementation All the eficonfig menus other than "Change Boot Order" use 'eficonfig_entry' structure for each menu entry. This commit refactors change boot order implementation to use 'eficonfig_entry' structure same as other menus to have consistent menu handling. This commit also simplifies the data->active handling when KEY_SPACE is pressed, and sizeof() parameter. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
8961e93e |
|
19-Nov-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: expose append entry function Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use append_entry() and append_quit_entry() to construct the menu, so move them out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
a84040ab |
|
19-Nov-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: refactor file selection handling eficonfig_select_file_handler() is commonly used to select the file. eficonfig_display_select_file_option() adds an additional menu to clear the selected file. eficonfig_display_select_file_option() is not always necessary for the file selection process, so it must be outside of eficonfig_select_file_handler(). This commit also renames the following functions to avoid confusion. eficonfig_select_file_handler() -> eficonfig_process_select_file() eficonfig_select_file() -> eficonfig_show_file_selection() eficonfig_display_select_file_option() -> eficonfig_process_show_file_option() Finally, test_eficonfig.py need to be updated to get aligned with the above modification. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
1167e88a |
|
14-Nov-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: fix missing variable initialization The 'ret' variable must be initialized before use in eficonfig_delete_invalid_boot_option(). Fixes: c416f1c0bc ("bootmenu: add removable media entries") Addresses-Coverity: 376207 ("Uninitialized variables") Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
3d595ac5 |
|
09-Nov-2022 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: remove superfluous if in eficonfig_edit_boot_option Goto for an immediately succeeding label is superfluous. Fixes: 87d791423ac6 ("eficonfig: menu-driven addition of UEFI boot option") Addresses-Coverity: 376202 ("Identical code for different branches") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
8afeab4c |
|
17-Apr-2024 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: eficonfig: check initrd path allocation After allocating memory for the initrd file path we need to check the initrd buffer pointer is not NULL. Fixes: 87d791423ac6 ("eficonfig: menu-driven addition of UEFI boot option") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
|
#
f19171c9 |
|
08-Jan-2024 |
Ilias Apalodimas <ilias.apalodimas@linaro.org> |
efi_loader: Clean up efi_dp_append and efi_dp_concat Looking back at the initrd storing functionality, we introduced three functions, efi_dp_append_or_concatenate(), efi_dp_append/concat(). In hindsight we could have simplified that by a lot. First of all none of the functions append anything. They all allocate a new device path and concatenate the contents of two device paths in one. A boolean parameter controls the final device path -- if that's true an end node is injected between the two device paths. So let's rewrite this and make it a bit easier to read. Get rid of efi_dp_append(), efi_dp_concat() and rename efi_dp_append_or_concatenate() to efi_dp_concat(). This is far more intuitive and the only adjustment that is needed is an extra boolean argument on all callsites. Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
64658007 |
|
17-Nov-2023 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: eficonfig: create shortened boot options The boot options created by eficonfig should use shortened device-paths to avoid problems if drives are enumerated in a different sequence. Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
9945bc4f |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Fix incorrect return code of boot option update Correct the return code for out-of-memory and no boot option found Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
339b527b |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Move bootorder and bootoption apis to lib Rename and move bootorder and bootoption apis from cmd to lib for re-use between eficonfig and bootmgr Fix 'unexpected indentation' when 'make htmldocs' after functions are moved Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
2c0b0c31 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_SECURE_BOOT This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_SECURE_BOOT defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
83f3d121 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_MM_COMM_TEE This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_MM_COMM_TEE defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
88df3634 |
|
02-Feb-2023 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: CTRL+S to save the boot order 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>
|
#
45f5319f |
|
02-Feb-2023 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
menu: remove CTRL+C to quit On the sandbox called without "--terminal raw" CTRL+C leaves U-Boot, "ESC/CTRL+C to quit" is misleading. Let's remove CTRL+C to quit key handling from bootmenu and eficonfig menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
|
#
8dbd0a0f |
|
23-Jan-2023 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: add vertical scroll support The current eficonfig menu does not support vertical scroll, so it can not display the menu entries greater than the console row size. This commit add the vertial scroll support. The console size is retrieved by SIMPLE_TEXT_OUTPUT_PROTOCOL.QueryMode() service, then calculates the row size for menu entry by subtracting menu header and description row size from the console row size. "start" and "end" are added in the efimenu structure. "start" keeps the menu entry index at the top, "end" keeps the bottom menu entry index. item_data_print() menu function only draws the menu entry between "start" and "end". This commit also fixes the issue that "Save" and "Quit" entries can be moved by BKEY_PLUS in change boot order menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
0d590852 |
|
23-Jan-2023 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: refactor change boot order implementation This commit removes the change boot order specific menu implementation. The change boot order implementation calls eficonfig_process_common() same as other menus. The change boot order menu requires own item_data_print and item_choice implementation, but display_statusline function can be a same function as other menus. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
cd160b27 |
|
23-Jan-2023 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: refactor eficonfig_process_common function Current change boot order implementation does not call eficonfig_process_common() and call own menu functions for display_statusline, item_data_print and item_choice. Change boot order functionality should call eficonfig_process_common() to improve maintenanceability. This commit is a preparation to remove the change boot order specific implementation. The menu functions (display_statusline, item_data_print and item_choice) are added as argument of eficonfig_process_common(). The menu description string displayed at the bottom of the menu is also added as argument. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
32bab0ea |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Make use of CLI character processing Avoid duplicating some of the escape-sequence processing here and use the CLI function instead. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
d0ca98db |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Update bootmenu_loop() to return the code Use the return value to save having to pass around a pointer. This also resolves any ambiguity about what *key contains when the function is called. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
2da4a15e |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Rename KEY_... to BKEY_... This enum values conflict with linux/input.h so rename them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
64550274 |
|
18-Dec-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: avoid SetVariable between GetNextVariableName calls The current code calls efi_set_variable_int() to delete the invalid boot option between calls to efi_get_next_variable_name_int(), it may produce unpredictable results. This commit moves removal of the invalid boot option outside of the efi_get_next_variable_name_int() calls. EFI_NOT_FOUND returned from efi_get_next_variable_name_int() indicates we retrieved all EFI variables, it should be treated as EFI_SUCEESS. To address the checkpatch warning of too many leading tabs, combine two if statement into one. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
ce327084 |
|
18-Dec-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: carve out efi_get_next_variable_name_int calls To retrieve the EFI variable name by efi_get_next_variable_name_int(), the sequence of alloc -> efi_get_next_variable_name_int -> realloc -> efi_get_next_variable_name_int is required. In current code, this sequence repeatedly appears in the several functions. It should be curved out a common function. This commit also fixes the missing free() of var_name16 in eficonfig_delete_invalid_boot_option(). Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
140a8959 |
|
01-Dec-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: use efi_get_next_variable_name_int() eficonfig command reads all possible UEFI load options from 0x0000 to 0xFFFF to construct the menu. This takes too much time in some environment. This commit uses efi_get_next_variable_name_int() to read all existing UEFI load options to significantlly reduce the count of efi_get_var() call. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
78b1ccc4 |
|
01-Dec-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: use u16_strsize() to get u16 string buffer size Use u16_strsize() to simplify the u16 string buffer size calculation. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c67d3c9e |
|
01-Dec-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: fix going one directory up issue The directory name in eficonfig menu entry contains the '\' separator. strcmp() argument ".." is wrong and one directory up handling does not work correctly. strcmp() argument must include '\' separator. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c3b5af63 |
|
19-Nov-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: add UEFI Secure Boot Key enrollment interface This commit adds the menu-driven UEFI Secure Boot Key enrollment interface. User can enroll PK, KEK, db and dbx by selecting file. Only the signed EFI Signature List(s) with an authenticated header, typically '.auth' file, is accepted. To clear the PK, KEK, db and dbx, user needs to enroll the null key signed by PK or KEK. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
21faf4ef |
|
19-Nov-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: use protocol interface for file selection EFI_SIMPLE_FILE_SYSTEM_PROTOCOL is not always provided by U-Boot. Use protocol interface functions instead of U-Boot internal functions. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d6566113 |
|
19-Nov-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: expose eficonfig_create_device_path() Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use eficonfig_create_device_path() to construct the full device path from device path of the volume and file path, so move it out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d571f9b2 |
|
19-Nov-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: refactor change boot order implementation All the eficonfig menus other than "Change Boot Order" use 'eficonfig_entry' structure for each menu entry. This commit refactors change boot order implementation to use 'eficonfig_entry' structure same as other menus to have consistent menu handling. This commit also simplifies the data->active handling when KEY_SPACE is pressed, and sizeof() parameter. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
8961e93e |
|
19-Nov-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: expose append entry function Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use append_entry() and append_quit_entry() to construct the menu, so move them out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
a84040ab |
|
19-Nov-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: refactor file selection handling eficonfig_select_file_handler() is commonly used to select the file. eficonfig_display_select_file_option() adds an additional menu to clear the selected file. eficonfig_display_select_file_option() is not always necessary for the file selection process, so it must be outside of eficonfig_select_file_handler(). This commit also renames the following functions to avoid confusion. eficonfig_select_file_handler() -> eficonfig_process_select_file() eficonfig_select_file() -> eficonfig_show_file_selection() eficonfig_display_select_file_option() -> eficonfig_process_show_file_option() Finally, test_eficonfig.py need to be updated to get aligned with the above modification. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
1167e88a |
|
14-Nov-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: fix missing variable initialization The 'ret' variable must be initialized before use in eficonfig_delete_invalid_boot_option(). Fixes: c416f1c0bc ("bootmenu: add removable media entries") Addresses-Coverity: 376207 ("Uninitialized variables") Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
3d595ac5 |
|
09-Nov-2022 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: remove superfluous if in eficonfig_edit_boot_option Goto for an immediately succeeding label is superfluous. Fixes: 87d791423ac6 ("eficonfig: menu-driven addition of UEFI boot option") Addresses-Coverity: 376202 ("Identical code for different branches") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
8afeab4c |
|
17-Apr-2024 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: eficonfig: check initrd path allocation After allocating memory for the initrd file path we need to check the initrd buffer pointer is not NULL. Fixes: 87d791423ac6 ("eficonfig: menu-driven addition of UEFI boot option") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
|
#
f19171c9 |
|
08-Jan-2024 |
Ilias Apalodimas <ilias.apalodimas@linaro.org> |
efi_loader: Clean up efi_dp_append and efi_dp_concat Looking back at the initrd storing functionality, we introduced three functions, efi_dp_append_or_concatenate(), efi_dp_append/concat(). In hindsight we could have simplified that by a lot. First of all none of the functions append anything. They all allocate a new device path and concatenate the contents of two device paths in one. A boolean parameter controls the final device path -- if that's true an end node is injected between the two device paths. So let's rewrite this and make it a bit easier to read. Get rid of efi_dp_append(), efi_dp_concat() and rename efi_dp_append_or_concatenate() to efi_dp_concat(). This is far more intuitive and the only adjustment that is needed is an extra boolean argument on all callsites. Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
64658007 |
|
17-Nov-2023 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: eficonfig: create shortened boot options The boot options created by eficonfig should use shortened device-paths to avoid problems if drives are enumerated in a different sequence. Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
9945bc4f |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Fix incorrect return code of boot option update Correct the return code for out-of-memory and no boot option found Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
339b527b |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Move bootorder and bootoption apis to lib Rename and move bootorder and bootoption apis from cmd to lib for re-use between eficonfig and bootmgr Fix 'unexpected indentation' when 'make htmldocs' after functions are moved Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
2c0b0c31 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_SECURE_BOOT This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_SECURE_BOOT defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
83f3d121 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_MM_COMM_TEE This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_MM_COMM_TEE defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
88df3634 |
|
02-Feb-2023 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: CTRL+S to save the boot order 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>
|
#
45f5319f |
|
02-Feb-2023 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
menu: remove CTRL+C to quit On the sandbox called without "--terminal raw" CTRL+C leaves U-Boot, "ESC/CTRL+C to quit" is misleading. Let's remove CTRL+C to quit key handling from bootmenu and eficonfig menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
|
#
8dbd0a0f |
|
23-Jan-2023 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: add vertical scroll support The current eficonfig menu does not support vertical scroll, so it can not display the menu entries greater than the console row size. This commit add the vertial scroll support. The console size is retrieved by SIMPLE_TEXT_OUTPUT_PROTOCOL.QueryMode() service, then calculates the row size for menu entry by subtracting menu header and description row size from the console row size. "start" and "end" are added in the efimenu structure. "start" keeps the menu entry index at the top, "end" keeps the bottom menu entry index. item_data_print() menu function only draws the menu entry between "start" and "end". This commit also fixes the issue that "Save" and "Quit" entries can be moved by BKEY_PLUS in change boot order menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
0d590852 |
|
23-Jan-2023 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: refactor change boot order implementation This commit removes the change boot order specific menu implementation. The change boot order implementation calls eficonfig_process_common() same as other menus. The change boot order menu requires own item_data_print and item_choice implementation, but display_statusline function can be a same function as other menus. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
cd160b27 |
|
23-Jan-2023 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: refactor eficonfig_process_common function Current change boot order implementation does not call eficonfig_process_common() and call own menu functions for display_statusline, item_data_print and item_choice. Change boot order functionality should call eficonfig_process_common() to improve maintenanceability. This commit is a preparation to remove the change boot order specific implementation. The menu functions (display_statusline, item_data_print and item_choice) are added as argument of eficonfig_process_common(). The menu description string displayed at the bottom of the menu is also added as argument. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
32bab0ea |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Make use of CLI character processing Avoid duplicating some of the escape-sequence processing here and use the CLI function instead. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
d0ca98db |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Update bootmenu_loop() to return the code Use the return value to save having to pass around a pointer. This also resolves any ambiguity about what *key contains when the function is called. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
2da4a15e |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Rename KEY_... to BKEY_... This enum values conflict with linux/input.h so rename them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
64550274 |
|
18-Dec-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: avoid SetVariable between GetNextVariableName calls The current code calls efi_set_variable_int() to delete the invalid boot option between calls to efi_get_next_variable_name_int(), it may produce unpredictable results. This commit moves removal of the invalid boot option outside of the efi_get_next_variable_name_int() calls. EFI_NOT_FOUND returned from efi_get_next_variable_name_int() indicates we retrieved all EFI variables, it should be treated as EFI_SUCEESS. To address the checkpatch warning of too many leading tabs, combine two if statement into one. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
ce327084 |
|
18-Dec-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: carve out efi_get_next_variable_name_int calls To retrieve the EFI variable name by efi_get_next_variable_name_int(), the sequence of alloc -> efi_get_next_variable_name_int -> realloc -> efi_get_next_variable_name_int is required. In current code, this sequence repeatedly appears in the several functions. It should be curved out a common function. This commit also fixes the missing free() of var_name16 in eficonfig_delete_invalid_boot_option(). Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
140a8959 |
|
01-Dec-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: use efi_get_next_variable_name_int() eficonfig command reads all possible UEFI load options from 0x0000 to 0xFFFF to construct the menu. This takes too much time in some environment. This commit uses efi_get_next_variable_name_int() to read all existing UEFI load options to significantlly reduce the count of efi_get_var() call. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
78b1ccc4 |
|
01-Dec-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: use u16_strsize() to get u16 string buffer size Use u16_strsize() to simplify the u16 string buffer size calculation. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c67d3c9e |
|
01-Dec-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: fix going one directory up issue The directory name in eficonfig menu entry contains the '\' separator. strcmp() argument ".." is wrong and one directory up handling does not work correctly. strcmp() argument must include '\' separator. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c3b5af63 |
|
19-Nov-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: add UEFI Secure Boot Key enrollment interface This commit adds the menu-driven UEFI Secure Boot Key enrollment interface. User can enroll PK, KEK, db and dbx by selecting file. Only the signed EFI Signature List(s) with an authenticated header, typically '.auth' file, is accepted. To clear the PK, KEK, db and dbx, user needs to enroll the null key signed by PK or KEK. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
21faf4ef |
|
19-Nov-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: use protocol interface for file selection EFI_SIMPLE_FILE_SYSTEM_PROTOCOL is not always provided by U-Boot. Use protocol interface functions instead of U-Boot internal functions. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d6566113 |
|
19-Nov-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: expose eficonfig_create_device_path() Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use eficonfig_create_device_path() to construct the full device path from device path of the volume and file path, so move it out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d571f9b2 |
|
19-Nov-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: refactor change boot order implementation All the eficonfig menus other than "Change Boot Order" use 'eficonfig_entry' structure for each menu entry. This commit refactors change boot order implementation to use 'eficonfig_entry' structure same as other menus to have consistent menu handling. This commit also simplifies the data->active handling when KEY_SPACE is pressed, and sizeof() parameter. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
8961e93e |
|
19-Nov-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: expose append entry function Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use append_entry() and append_quit_entry() to construct the menu, so move them out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
a84040ab |
|
19-Nov-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: refactor file selection handling eficonfig_select_file_handler() is commonly used to select the file. eficonfig_display_select_file_option() adds an additional menu to clear the selected file. eficonfig_display_select_file_option() is not always necessary for the file selection process, so it must be outside of eficonfig_select_file_handler(). This commit also renames the following functions to avoid confusion. eficonfig_select_file_handler() -> eficonfig_process_select_file() eficonfig_select_file() -> eficonfig_show_file_selection() eficonfig_display_select_file_option() -> eficonfig_process_show_file_option() Finally, test_eficonfig.py need to be updated to get aligned with the above modification. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
1167e88a |
|
14-Nov-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: fix missing variable initialization The 'ret' variable must be initialized before use in eficonfig_delete_invalid_boot_option(). Fixes: c416f1c0bc ("bootmenu: add removable media entries") Addresses-Coverity: 376207 ("Uninitialized variables") Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
3d595ac5 |
|
09-Nov-2022 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: remove superfluous if in eficonfig_edit_boot_option Goto for an immediately succeeding label is superfluous. Fixes: 87d791423ac6 ("eficonfig: menu-driven addition of UEFI boot option") Addresses-Coverity: 376202 ("Identical code for different branches") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
8afeab4c |
|
17-Apr-2024 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: eficonfig: check initrd path allocation After allocating memory for the initrd file path we need to check the initrd buffer pointer is not NULL. Fixes: 87d791423ac6 ("eficonfig: menu-driven addition of UEFI boot option") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
|
#
f19171c9 |
|
08-Jan-2024 |
Ilias Apalodimas <ilias.apalodimas@linaro.org> |
efi_loader: Clean up efi_dp_append and efi_dp_concat Looking back at the initrd storing functionality, we introduced three functions, efi_dp_append_or_concatenate(), efi_dp_append/concat(). In hindsight we could have simplified that by a lot. First of all none of the functions append anything. They all allocate a new device path and concatenate the contents of two device paths in one. A boolean parameter controls the final device path -- if that's true an end node is injected between the two device paths. So let's rewrite this and make it a bit easier to read. Get rid of efi_dp_append(), efi_dp_concat() and rename efi_dp_append_or_concatenate() to efi_dp_concat(). This is far more intuitive and the only adjustment that is needed is an extra boolean argument on all callsites. Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
64658007 |
|
17-Nov-2023 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: eficonfig: create shortened boot options The boot options created by eficonfig should use shortened device-paths to avoid problems if drives are enumerated in a different sequence. Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
9945bc4f |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Fix incorrect return code of boot option update Correct the return code for out-of-memory and no boot option found Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
339b527b |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Move bootorder and bootoption apis to lib Rename and move bootorder and bootoption apis from cmd to lib for re-use between eficonfig and bootmgr Fix 'unexpected indentation' when 'make htmldocs' after functions are moved Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
2c0b0c31 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_SECURE_BOOT This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_SECURE_BOOT defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
83f3d121 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_MM_COMM_TEE This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_MM_COMM_TEE defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
88df3634 |
|
02-Feb-2023 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: CTRL+S to save the boot order 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>
|
#
45f5319f |
|
02-Feb-2023 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
menu: remove CTRL+C to quit On the sandbox called without "--terminal raw" CTRL+C leaves U-Boot, "ESC/CTRL+C to quit" is misleading. Let's remove CTRL+C to quit key handling from bootmenu and eficonfig menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
|
#
8dbd0a0f |
|
23-Jan-2023 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: add vertical scroll support The current eficonfig menu does not support vertical scroll, so it can not display the menu entries greater than the console row size. This commit add the vertial scroll support. The console size is retrieved by SIMPLE_TEXT_OUTPUT_PROTOCOL.QueryMode() service, then calculates the row size for menu entry by subtracting menu header and description row size from the console row size. "start" and "end" are added in the efimenu structure. "start" keeps the menu entry index at the top, "end" keeps the bottom menu entry index. item_data_print() menu function only draws the menu entry between "start" and "end". This commit also fixes the issue that "Save" and "Quit" entries can be moved by BKEY_PLUS in change boot order menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
0d590852 |
|
23-Jan-2023 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: refactor change boot order implementation This commit removes the change boot order specific menu implementation. The change boot order implementation calls eficonfig_process_common() same as other menus. The change boot order menu requires own item_data_print and item_choice implementation, but display_statusline function can be a same function as other menus. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
cd160b27 |
|
23-Jan-2023 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: refactor eficonfig_process_common function Current change boot order implementation does not call eficonfig_process_common() and call own menu functions for display_statusline, item_data_print and item_choice. Change boot order functionality should call eficonfig_process_common() to improve maintenanceability. This commit is a preparation to remove the change boot order specific implementation. The menu functions (display_statusline, item_data_print and item_choice) are added as argument of eficonfig_process_common(). The menu description string displayed at the bottom of the menu is also added as argument. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
32bab0ea |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Make use of CLI character processing Avoid duplicating some of the escape-sequence processing here and use the CLI function instead. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
d0ca98db |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Update bootmenu_loop() to return the code Use the return value to save having to pass around a pointer. This also resolves any ambiguity about what *key contains when the function is called. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
2da4a15e |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Rename KEY_... to BKEY_... This enum values conflict with linux/input.h so rename them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
64550274 |
|
18-Dec-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: avoid SetVariable between GetNextVariableName calls The current code calls efi_set_variable_int() to delete the invalid boot option between calls to efi_get_next_variable_name_int(), it may produce unpredictable results. This commit moves removal of the invalid boot option outside of the efi_get_next_variable_name_int() calls. EFI_NOT_FOUND returned from efi_get_next_variable_name_int() indicates we retrieved all EFI variables, it should be treated as EFI_SUCEESS. To address the checkpatch warning of too many leading tabs, combine two if statement into one. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
ce327084 |
|
18-Dec-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: carve out efi_get_next_variable_name_int calls To retrieve the EFI variable name by efi_get_next_variable_name_int(), the sequence of alloc -> efi_get_next_variable_name_int -> realloc -> efi_get_next_variable_name_int is required. In current code, this sequence repeatedly appears in the several functions. It should be curved out a common function. This commit also fixes the missing free() of var_name16 in eficonfig_delete_invalid_boot_option(). Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
140a8959 |
|
01-Dec-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: use efi_get_next_variable_name_int() eficonfig command reads all possible UEFI load options from 0x0000 to 0xFFFF to construct the menu. This takes too much time in some environment. This commit uses efi_get_next_variable_name_int() to read all existing UEFI load options to significantlly reduce the count of efi_get_var() call. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
78b1ccc4 |
|
01-Dec-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: use u16_strsize() to get u16 string buffer size Use u16_strsize() to simplify the u16 string buffer size calculation. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c67d3c9e |
|
01-Dec-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: fix going one directory up issue The directory name in eficonfig menu entry contains the '\' separator. strcmp() argument ".." is wrong and one directory up handling does not work correctly. strcmp() argument must include '\' separator. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c3b5af63 |
|
19-Nov-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: add UEFI Secure Boot Key enrollment interface This commit adds the menu-driven UEFI Secure Boot Key enrollment interface. User can enroll PK, KEK, db and dbx by selecting file. Only the signed EFI Signature List(s) with an authenticated header, typically '.auth' file, is accepted. To clear the PK, KEK, db and dbx, user needs to enroll the null key signed by PK or KEK. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
21faf4ef |
|
19-Nov-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: use protocol interface for file selection EFI_SIMPLE_FILE_SYSTEM_PROTOCOL is not always provided by U-Boot. Use protocol interface functions instead of U-Boot internal functions. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d6566113 |
|
19-Nov-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: expose eficonfig_create_device_path() Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use eficonfig_create_device_path() to construct the full device path from device path of the volume and file path, so move it out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d571f9b2 |
|
19-Nov-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: refactor change boot order implementation All the eficonfig menus other than "Change Boot Order" use 'eficonfig_entry' structure for each menu entry. This commit refactors change boot order implementation to use 'eficonfig_entry' structure same as other menus to have consistent menu handling. This commit also simplifies the data->active handling when KEY_SPACE is pressed, and sizeof() parameter. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
8961e93e |
|
19-Nov-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: expose append entry function Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use append_entry() and append_quit_entry() to construct the menu, so move them out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
a84040ab |
|
19-Nov-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: refactor file selection handling eficonfig_select_file_handler() is commonly used to select the file. eficonfig_display_select_file_option() adds an additional menu to clear the selected file. eficonfig_display_select_file_option() is not always necessary for the file selection process, so it must be outside of eficonfig_select_file_handler(). This commit also renames the following functions to avoid confusion. eficonfig_select_file_handler() -> eficonfig_process_select_file() eficonfig_select_file() -> eficonfig_show_file_selection() eficonfig_display_select_file_option() -> eficonfig_process_show_file_option() Finally, test_eficonfig.py need to be updated to get aligned with the above modification. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
1167e88a |
|
14-Nov-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: fix missing variable initialization The 'ret' variable must be initialized before use in eficonfig_delete_invalid_boot_option(). Fixes: c416f1c0bc ("bootmenu: add removable media entries") Addresses-Coverity: 376207 ("Uninitialized variables") Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
3d595ac5 |
|
09-Nov-2022 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: remove superfluous if in eficonfig_edit_boot_option Goto for an immediately succeeding label is superfluous. Fixes: 87d791423ac6 ("eficonfig: menu-driven addition of UEFI boot option") Addresses-Coverity: 376202 ("Identical code for different branches") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
f19171c9 |
|
08-Jan-2024 |
Ilias Apalodimas <ilias.apalodimas@linaro.org> |
efi_loader: Clean up efi_dp_append and efi_dp_concat Looking back at the initrd storing functionality, we introduced three functions, efi_dp_append_or_concatenate(), efi_dp_append/concat(). In hindsight we could have simplified that by a lot. First of all none of the functions append anything. They all allocate a new device path and concatenate the contents of two device paths in one. A boolean parameter controls the final device path -- if that's true an end node is injected between the two device paths. So let's rewrite this and make it a bit easier to read. Get rid of efi_dp_append(), efi_dp_concat() and rename efi_dp_append_or_concatenate() to efi_dp_concat(). This is far more intuitive and the only adjustment that is needed is an extra boolean argument on all callsites. Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
64658007 |
|
17-Nov-2023 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: eficonfig: create shortened boot options The boot options created by eficonfig should use shortened device-paths to avoid problems if drives are enumerated in a different sequence. Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
9945bc4f |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Fix incorrect return code of boot option update Correct the return code for out-of-memory and no boot option found Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
339b527b |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Move bootorder and bootoption apis to lib Rename and move bootorder and bootoption apis from cmd to lib for re-use between eficonfig and bootmgr Fix 'unexpected indentation' when 'make htmldocs' after functions are moved Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
2c0b0c31 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_SECURE_BOOT This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_SECURE_BOOT defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
83f3d121 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_MM_COMM_TEE This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_MM_COMM_TEE defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
88df3634 |
|
02-Feb-2023 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: CTRL+S to save the boot order 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>
|
#
45f5319f |
|
02-Feb-2023 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
menu: remove CTRL+C to quit On the sandbox called without "--terminal raw" CTRL+C leaves U-Boot, "ESC/CTRL+C to quit" is misleading. Let's remove CTRL+C to quit key handling from bootmenu and eficonfig menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
|
#
8dbd0a0f |
|
23-Jan-2023 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: add vertical scroll support The current eficonfig menu does not support vertical scroll, so it can not display the menu entries greater than the console row size. This commit add the vertial scroll support. The console size is retrieved by SIMPLE_TEXT_OUTPUT_PROTOCOL.QueryMode() service, then calculates the row size for menu entry by subtracting menu header and description row size from the console row size. "start" and "end" are added in the efimenu structure. "start" keeps the menu entry index at the top, "end" keeps the bottom menu entry index. item_data_print() menu function only draws the menu entry between "start" and "end". This commit also fixes the issue that "Save" and "Quit" entries can be moved by BKEY_PLUS in change boot order menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
0d590852 |
|
23-Jan-2023 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: refactor change boot order implementation This commit removes the change boot order specific menu implementation. The change boot order implementation calls eficonfig_process_common() same as other menus. The change boot order menu requires own item_data_print and item_choice implementation, but display_statusline function can be a same function as other menus. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
cd160b27 |
|
23-Jan-2023 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: refactor eficonfig_process_common function Current change boot order implementation does not call eficonfig_process_common() and call own menu functions for display_statusline, item_data_print and item_choice. Change boot order functionality should call eficonfig_process_common() to improve maintenanceability. This commit is a preparation to remove the change boot order specific implementation. The menu functions (display_statusline, item_data_print and item_choice) are added as argument of eficonfig_process_common(). The menu description string displayed at the bottom of the menu is also added as argument. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
32bab0ea |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Make use of CLI character processing Avoid duplicating some of the escape-sequence processing here and use the CLI function instead. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
d0ca98db |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Update bootmenu_loop() to return the code Use the return value to save having to pass around a pointer. This also resolves any ambiguity about what *key contains when the function is called. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
2da4a15e |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Rename KEY_... to BKEY_... This enum values conflict with linux/input.h so rename them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
64550274 |
|
18-Dec-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: avoid SetVariable between GetNextVariableName calls The current code calls efi_set_variable_int() to delete the invalid boot option between calls to efi_get_next_variable_name_int(), it may produce unpredictable results. This commit moves removal of the invalid boot option outside of the efi_get_next_variable_name_int() calls. EFI_NOT_FOUND returned from efi_get_next_variable_name_int() indicates we retrieved all EFI variables, it should be treated as EFI_SUCEESS. To address the checkpatch warning of too many leading tabs, combine two if statement into one. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
ce327084 |
|
18-Dec-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: carve out efi_get_next_variable_name_int calls To retrieve the EFI variable name by efi_get_next_variable_name_int(), the sequence of alloc -> efi_get_next_variable_name_int -> realloc -> efi_get_next_variable_name_int is required. In current code, this sequence repeatedly appears in the several functions. It should be curved out a common function. This commit also fixes the missing free() of var_name16 in eficonfig_delete_invalid_boot_option(). Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
140a8959 |
|
01-Dec-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: use efi_get_next_variable_name_int() eficonfig command reads all possible UEFI load options from 0x0000 to 0xFFFF to construct the menu. This takes too much time in some environment. This commit uses efi_get_next_variable_name_int() to read all existing UEFI load options to significantlly reduce the count of efi_get_var() call. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
78b1ccc4 |
|
01-Dec-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: use u16_strsize() to get u16 string buffer size Use u16_strsize() to simplify the u16 string buffer size calculation. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c67d3c9e |
|
01-Dec-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: fix going one directory up issue The directory name in eficonfig menu entry contains the '\' separator. strcmp() argument ".." is wrong and one directory up handling does not work correctly. strcmp() argument must include '\' separator. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c3b5af63 |
|
19-Nov-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: add UEFI Secure Boot Key enrollment interface This commit adds the menu-driven UEFI Secure Boot Key enrollment interface. User can enroll PK, KEK, db and dbx by selecting file. Only the signed EFI Signature List(s) with an authenticated header, typically '.auth' file, is accepted. To clear the PK, KEK, db and dbx, user needs to enroll the null key signed by PK or KEK. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
21faf4ef |
|
19-Nov-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: use protocol interface for file selection EFI_SIMPLE_FILE_SYSTEM_PROTOCOL is not always provided by U-Boot. Use protocol interface functions instead of U-Boot internal functions. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d6566113 |
|
19-Nov-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: expose eficonfig_create_device_path() Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use eficonfig_create_device_path() to construct the full device path from device path of the volume and file path, so move it out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d571f9b2 |
|
19-Nov-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: refactor change boot order implementation All the eficonfig menus other than "Change Boot Order" use 'eficonfig_entry' structure for each menu entry. This commit refactors change boot order implementation to use 'eficonfig_entry' structure same as other menus to have consistent menu handling. This commit also simplifies the data->active handling when KEY_SPACE is pressed, and sizeof() parameter. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
8961e93e |
|
19-Nov-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: expose append entry function Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use append_entry() and append_quit_entry() to construct the menu, so move them out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
a84040ab |
|
19-Nov-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: refactor file selection handling eficonfig_select_file_handler() is commonly used to select the file. eficonfig_display_select_file_option() adds an additional menu to clear the selected file. eficonfig_display_select_file_option() is not always necessary for the file selection process, so it must be outside of eficonfig_select_file_handler(). This commit also renames the following functions to avoid confusion. eficonfig_select_file_handler() -> eficonfig_process_select_file() eficonfig_select_file() -> eficonfig_show_file_selection() eficonfig_display_select_file_option() -> eficonfig_process_show_file_option() Finally, test_eficonfig.py need to be updated to get aligned with the above modification. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
1167e88a |
|
14-Nov-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: fix missing variable initialization The 'ret' variable must be initialized before use in eficonfig_delete_invalid_boot_option(). Fixes: c416f1c0bc ("bootmenu: add removable media entries") Addresses-Coverity: 376207 ("Uninitialized variables") Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
3d595ac5 |
|
09-Nov-2022 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: remove superfluous if in eficonfig_edit_boot_option Goto for an immediately succeeding label is superfluous. Fixes: 87d791423ac6 ("eficonfig: menu-driven addition of UEFI boot option") Addresses-Coverity: 376202 ("Identical code for different branches") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
f19171c9 |
|
08-Jan-2024 |
Ilias Apalodimas <ilias.apalodimas@linaro.org> |
efi_loader: Clean up efi_dp_append and efi_dp_concat Looking back at the initrd storing functionality, we introduced three functions, efi_dp_append_or_concatenate(), efi_dp_append/concat(). In hindsight we could have simplified that by a lot. First of all none of the functions append anything. They all allocate a new device path and concatenate the contents of two device paths in one. A boolean parameter controls the final device path -- if that's true an end node is injected between the two device paths. So let's rewrite this and make it a bit easier to read. Get rid of efi_dp_append(), efi_dp_concat() and rename efi_dp_append_or_concatenate() to efi_dp_concat(). This is far more intuitive and the only adjustment that is needed is an extra boolean argument on all callsites. Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
64658007 |
|
17-Nov-2023 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: eficonfig: create shortened boot options The boot options created by eficonfig should use shortened device-paths to avoid problems if drives are enumerated in a different sequence. Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
9945bc4f |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Fix incorrect return code of boot option update Correct the return code for out-of-memory and no boot option found Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
339b527b |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Move bootorder and bootoption apis to lib Rename and move bootorder and bootoption apis from cmd to lib for re-use between eficonfig and bootmgr Fix 'unexpected indentation' when 'make htmldocs' after functions are moved Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
2c0b0c31 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_SECURE_BOOT This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_SECURE_BOOT defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
83f3d121 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_MM_COMM_TEE This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_MM_COMM_TEE defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
88df3634 |
|
02-Feb-2023 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: CTRL+S to save the boot order 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>
|
#
45f5319f |
|
02-Feb-2023 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
menu: remove CTRL+C to quit On the sandbox called without "--terminal raw" CTRL+C leaves U-Boot, "ESC/CTRL+C to quit" is misleading. Let's remove CTRL+C to quit key handling from bootmenu and eficonfig menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
|
#
8dbd0a0f |
|
23-Jan-2023 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: add vertical scroll support The current eficonfig menu does not support vertical scroll, so it can not display the menu entries greater than the console row size. This commit add the vertial scroll support. The console size is retrieved by SIMPLE_TEXT_OUTPUT_PROTOCOL.QueryMode() service, then calculates the row size for menu entry by subtracting menu header and description row size from the console row size. "start" and "end" are added in the efimenu structure. "start" keeps the menu entry index at the top, "end" keeps the bottom menu entry index. item_data_print() menu function only draws the menu entry between "start" and "end". This commit also fixes the issue that "Save" and "Quit" entries can be moved by BKEY_PLUS in change boot order menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
0d590852 |
|
23-Jan-2023 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: refactor change boot order implementation This commit removes the change boot order specific menu implementation. The change boot order implementation calls eficonfig_process_common() same as other menus. The change boot order menu requires own item_data_print and item_choice implementation, but display_statusline function can be a same function as other menus. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
cd160b27 |
|
23-Jan-2023 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: refactor eficonfig_process_common function Current change boot order implementation does not call eficonfig_process_common() and call own menu functions for display_statusline, item_data_print and item_choice. Change boot order functionality should call eficonfig_process_common() to improve maintenanceability. This commit is a preparation to remove the change boot order specific implementation. The menu functions (display_statusline, item_data_print and item_choice) are added as argument of eficonfig_process_common(). The menu description string displayed at the bottom of the menu is also added as argument. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
32bab0ea |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Make use of CLI character processing Avoid duplicating some of the escape-sequence processing here and use the CLI function instead. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
d0ca98db |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Update bootmenu_loop() to return the code Use the return value to save having to pass around a pointer. This also resolves any ambiguity about what *key contains when the function is called. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
2da4a15e |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Rename KEY_... to BKEY_... This enum values conflict with linux/input.h so rename them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
64550274 |
|
18-Dec-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: avoid SetVariable between GetNextVariableName calls The current code calls efi_set_variable_int() to delete the invalid boot option between calls to efi_get_next_variable_name_int(), it may produce unpredictable results. This commit moves removal of the invalid boot option outside of the efi_get_next_variable_name_int() calls. EFI_NOT_FOUND returned from efi_get_next_variable_name_int() indicates we retrieved all EFI variables, it should be treated as EFI_SUCEESS. To address the checkpatch warning of too many leading tabs, combine two if statement into one. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
ce327084 |
|
18-Dec-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: carve out efi_get_next_variable_name_int calls To retrieve the EFI variable name by efi_get_next_variable_name_int(), the sequence of alloc -> efi_get_next_variable_name_int -> realloc -> efi_get_next_variable_name_int is required. In current code, this sequence repeatedly appears in the several functions. It should be curved out a common function. This commit also fixes the missing free() of var_name16 in eficonfig_delete_invalid_boot_option(). Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
140a8959 |
|
01-Dec-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: use efi_get_next_variable_name_int() eficonfig command reads all possible UEFI load options from 0x0000 to 0xFFFF to construct the menu. This takes too much time in some environment. This commit uses efi_get_next_variable_name_int() to read all existing UEFI load options to significantlly reduce the count of efi_get_var() call. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
78b1ccc4 |
|
01-Dec-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: use u16_strsize() to get u16 string buffer size Use u16_strsize() to simplify the u16 string buffer size calculation. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c67d3c9e |
|
01-Dec-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: fix going one directory up issue The directory name in eficonfig menu entry contains the '\' separator. strcmp() argument ".." is wrong and one directory up handling does not work correctly. strcmp() argument must include '\' separator. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c3b5af63 |
|
19-Nov-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: add UEFI Secure Boot Key enrollment interface This commit adds the menu-driven UEFI Secure Boot Key enrollment interface. User can enroll PK, KEK, db and dbx by selecting file. Only the signed EFI Signature List(s) with an authenticated header, typically '.auth' file, is accepted. To clear the PK, KEK, db and dbx, user needs to enroll the null key signed by PK or KEK. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
21faf4ef |
|
19-Nov-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: use protocol interface for file selection EFI_SIMPLE_FILE_SYSTEM_PROTOCOL is not always provided by U-Boot. Use protocol interface functions instead of U-Boot internal functions. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d6566113 |
|
19-Nov-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: expose eficonfig_create_device_path() Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use eficonfig_create_device_path() to construct the full device path from device path of the volume and file path, so move it out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d571f9b2 |
|
19-Nov-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: refactor change boot order implementation All the eficonfig menus other than "Change Boot Order" use 'eficonfig_entry' structure for each menu entry. This commit refactors change boot order implementation to use 'eficonfig_entry' structure same as other menus to have consistent menu handling. This commit also simplifies the data->active handling when KEY_SPACE is pressed, and sizeof() parameter. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
8961e93e |
|
19-Nov-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: expose append entry function Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use append_entry() and append_quit_entry() to construct the menu, so move them out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
a84040ab |
|
19-Nov-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: refactor file selection handling eficonfig_select_file_handler() is commonly used to select the file. eficonfig_display_select_file_option() adds an additional menu to clear the selected file. eficonfig_display_select_file_option() is not always necessary for the file selection process, so it must be outside of eficonfig_select_file_handler(). This commit also renames the following functions to avoid confusion. eficonfig_select_file_handler() -> eficonfig_process_select_file() eficonfig_select_file() -> eficonfig_show_file_selection() eficonfig_display_select_file_option() -> eficonfig_process_show_file_option() Finally, test_eficonfig.py need to be updated to get aligned with the above modification. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
1167e88a |
|
14-Nov-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: fix missing variable initialization The 'ret' variable must be initialized before use in eficonfig_delete_invalid_boot_option(). Fixes: c416f1c0bc ("bootmenu: add removable media entries") Addresses-Coverity: 376207 ("Uninitialized variables") Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
3d595ac5 |
|
09-Nov-2022 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: remove superfluous if in eficonfig_edit_boot_option Goto for an immediately succeeding label is superfluous. Fixes: 87d791423ac6 ("eficonfig: menu-driven addition of UEFI boot option") Addresses-Coverity: 376202 ("Identical code for different branches") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
f19171c9 |
|
08-Jan-2024 |
Ilias Apalodimas <ilias.apalodimas@linaro.org> |
efi_loader: Clean up efi_dp_append and efi_dp_concat Looking back at the initrd storing functionality, we introduced three functions, efi_dp_append_or_concatenate(), efi_dp_append/concat(). In hindsight we could have simplified that by a lot. First of all none of the functions append anything. They all allocate a new device path and concatenate the contents of two device paths in one. A boolean parameter controls the final device path -- if that's true an end node is injected between the two device paths. So let's rewrite this and make it a bit easier to read. Get rid of efi_dp_append(), efi_dp_concat() and rename efi_dp_append_or_concatenate() to efi_dp_concat(). This is far more intuitive and the only adjustment that is needed is an extra boolean argument on all callsites. Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
64658007 |
|
17-Nov-2023 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: eficonfig: create shortened boot options The boot options created by eficonfig should use shortened device-paths to avoid problems if drives are enumerated in a different sequence. Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
9945bc4f |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Fix incorrect return code of boot option update Correct the return code for out-of-memory and no boot option found Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
339b527b |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Move bootorder and bootoption apis to lib Rename and move bootorder and bootoption apis from cmd to lib for re-use between eficonfig and bootmgr Fix 'unexpected indentation' when 'make htmldocs' after functions are moved Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
2c0b0c31 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_SECURE_BOOT This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_SECURE_BOOT defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
83f3d121 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_MM_COMM_TEE This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_MM_COMM_TEE defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
88df3634 |
|
02-Feb-2023 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: CTRL+S to save the boot order 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>
|
#
45f5319f |
|
02-Feb-2023 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
menu: remove CTRL+C to quit On the sandbox called without "--terminal raw" CTRL+C leaves U-Boot, "ESC/CTRL+C to quit" is misleading. Let's remove CTRL+C to quit key handling from bootmenu and eficonfig menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
|
#
8dbd0a0f |
|
23-Jan-2023 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: add vertical scroll support The current eficonfig menu does not support vertical scroll, so it can not display the menu entries greater than the console row size. This commit add the vertial scroll support. The console size is retrieved by SIMPLE_TEXT_OUTPUT_PROTOCOL.QueryMode() service, then calculates the row size for menu entry by subtracting menu header and description row size from the console row size. "start" and "end" are added in the efimenu structure. "start" keeps the menu entry index at the top, "end" keeps the bottom menu entry index. item_data_print() menu function only draws the menu entry between "start" and "end". This commit also fixes the issue that "Save" and "Quit" entries can be moved by BKEY_PLUS in change boot order menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
0d590852 |
|
23-Jan-2023 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: refactor change boot order implementation This commit removes the change boot order specific menu implementation. The change boot order implementation calls eficonfig_process_common() same as other menus. The change boot order menu requires own item_data_print and item_choice implementation, but display_statusline function can be a same function as other menus. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
cd160b27 |
|
23-Jan-2023 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: refactor eficonfig_process_common function Current change boot order implementation does not call eficonfig_process_common() and call own menu functions for display_statusline, item_data_print and item_choice. Change boot order functionality should call eficonfig_process_common() to improve maintenanceability. This commit is a preparation to remove the change boot order specific implementation. The menu functions (display_statusline, item_data_print and item_choice) are added as argument of eficonfig_process_common(). The menu description string displayed at the bottom of the menu is also added as argument. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
32bab0ea |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Make use of CLI character processing Avoid duplicating some of the escape-sequence processing here and use the CLI function instead. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
d0ca98db |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Update bootmenu_loop() to return the code Use the return value to save having to pass around a pointer. This also resolves any ambiguity about what *key contains when the function is called. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
2da4a15e |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Rename KEY_... to BKEY_... This enum values conflict with linux/input.h so rename them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
64550274 |
|
18-Dec-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: avoid SetVariable between GetNextVariableName calls The current code calls efi_set_variable_int() to delete the invalid boot option between calls to efi_get_next_variable_name_int(), it may produce unpredictable results. This commit moves removal of the invalid boot option outside of the efi_get_next_variable_name_int() calls. EFI_NOT_FOUND returned from efi_get_next_variable_name_int() indicates we retrieved all EFI variables, it should be treated as EFI_SUCEESS. To address the checkpatch warning of too many leading tabs, combine two if statement into one. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
ce327084 |
|
18-Dec-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: carve out efi_get_next_variable_name_int calls To retrieve the EFI variable name by efi_get_next_variable_name_int(), the sequence of alloc -> efi_get_next_variable_name_int -> realloc -> efi_get_next_variable_name_int is required. In current code, this sequence repeatedly appears in the several functions. It should be curved out a common function. This commit also fixes the missing free() of var_name16 in eficonfig_delete_invalid_boot_option(). Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
140a8959 |
|
01-Dec-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: use efi_get_next_variable_name_int() eficonfig command reads all possible UEFI load options from 0x0000 to 0xFFFF to construct the menu. This takes too much time in some environment. This commit uses efi_get_next_variable_name_int() to read all existing UEFI load options to significantlly reduce the count of efi_get_var() call. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
78b1ccc4 |
|
01-Dec-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: use u16_strsize() to get u16 string buffer size Use u16_strsize() to simplify the u16 string buffer size calculation. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c67d3c9e |
|
01-Dec-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: fix going one directory up issue The directory name in eficonfig menu entry contains the '\' separator. strcmp() argument ".." is wrong and one directory up handling does not work correctly. strcmp() argument must include '\' separator. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c3b5af63 |
|
19-Nov-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: add UEFI Secure Boot Key enrollment interface This commit adds the menu-driven UEFI Secure Boot Key enrollment interface. User can enroll PK, KEK, db and dbx by selecting file. Only the signed EFI Signature List(s) with an authenticated header, typically '.auth' file, is accepted. To clear the PK, KEK, db and dbx, user needs to enroll the null key signed by PK or KEK. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
21faf4ef |
|
19-Nov-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: use protocol interface for file selection EFI_SIMPLE_FILE_SYSTEM_PROTOCOL is not always provided by U-Boot. Use protocol interface functions instead of U-Boot internal functions. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d6566113 |
|
19-Nov-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: expose eficonfig_create_device_path() Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use eficonfig_create_device_path() to construct the full device path from device path of the volume and file path, so move it out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d571f9b2 |
|
19-Nov-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: refactor change boot order implementation All the eficonfig menus other than "Change Boot Order" use 'eficonfig_entry' structure for each menu entry. This commit refactors change boot order implementation to use 'eficonfig_entry' structure same as other menus to have consistent menu handling. This commit also simplifies the data->active handling when KEY_SPACE is pressed, and sizeof() parameter. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
8961e93e |
|
19-Nov-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: expose append entry function Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use append_entry() and append_quit_entry() to construct the menu, so move them out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
a84040ab |
|
19-Nov-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: refactor file selection handling eficonfig_select_file_handler() is commonly used to select the file. eficonfig_display_select_file_option() adds an additional menu to clear the selected file. eficonfig_display_select_file_option() is not always necessary for the file selection process, so it must be outside of eficonfig_select_file_handler(). This commit also renames the following functions to avoid confusion. eficonfig_select_file_handler() -> eficonfig_process_select_file() eficonfig_select_file() -> eficonfig_show_file_selection() eficonfig_display_select_file_option() -> eficonfig_process_show_file_option() Finally, test_eficonfig.py need to be updated to get aligned with the above modification. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
1167e88a |
|
14-Nov-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: fix missing variable initialization The 'ret' variable must be initialized before use in eficonfig_delete_invalid_boot_option(). Fixes: c416f1c0bc ("bootmenu: add removable media entries") Addresses-Coverity: 376207 ("Uninitialized variables") Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
3d595ac5 |
|
09-Nov-2022 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: remove superfluous if in eficonfig_edit_boot_option Goto for an immediately succeeding label is superfluous. Fixes: 87d791423ac6 ("eficonfig: menu-driven addition of UEFI boot option") Addresses-Coverity: 376202 ("Identical code for different branches") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
f19171c9 |
|
08-Jan-2024 |
Ilias Apalodimas <ilias.apalodimas@linaro.org> |
efi_loader: Clean up efi_dp_append and efi_dp_concat Looking back at the initrd storing functionality, we introduced three functions, efi_dp_append_or_concatenate(), efi_dp_append/concat(). In hindsight we could have simplified that by a lot. First of all none of the functions append anything. They all allocate a new device path and concatenate the contents of two device paths in one. A boolean parameter controls the final device path -- if that's true an end node is injected between the two device paths. So let's rewrite this and make it a bit easier to read. Get rid of efi_dp_append(), efi_dp_concat() and rename efi_dp_append_or_concatenate() to efi_dp_concat(). This is far more intuitive and the only adjustment that is needed is an extra boolean argument on all callsites. Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
64658007 |
|
17-Nov-2023 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: eficonfig: create shortened boot options The boot options created by eficonfig should use shortened device-paths to avoid problems if drives are enumerated in a different sequence. Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
9945bc4f |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Fix incorrect return code of boot option update Correct the return code for out-of-memory and no boot option found Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
339b527b |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Move bootorder and bootoption apis to lib Rename and move bootorder and bootoption apis from cmd to lib for re-use between eficonfig and bootmgr Fix 'unexpected indentation' when 'make htmldocs' after functions are moved Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
2c0b0c31 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_SECURE_BOOT This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_SECURE_BOOT defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
83f3d121 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_MM_COMM_TEE This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_MM_COMM_TEE defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
88df3634 |
|
02-Feb-2023 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: CTRL+S to save the boot order 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>
|
#
45f5319f |
|
02-Feb-2023 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
menu: remove CTRL+C to quit On the sandbox called without "--terminal raw" CTRL+C leaves U-Boot, "ESC/CTRL+C to quit" is misleading. Let's remove CTRL+C to quit key handling from bootmenu and eficonfig menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
|
#
8dbd0a0f |
|
23-Jan-2023 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: add vertical scroll support The current eficonfig menu does not support vertical scroll, so it can not display the menu entries greater than the console row size. This commit add the vertial scroll support. The console size is retrieved by SIMPLE_TEXT_OUTPUT_PROTOCOL.QueryMode() service, then calculates the row size for menu entry by subtracting menu header and description row size from the console row size. "start" and "end" are added in the efimenu structure. "start" keeps the menu entry index at the top, "end" keeps the bottom menu entry index. item_data_print() menu function only draws the menu entry between "start" and "end". This commit also fixes the issue that "Save" and "Quit" entries can be moved by BKEY_PLUS in change boot order menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
0d590852 |
|
23-Jan-2023 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: refactor change boot order implementation This commit removes the change boot order specific menu implementation. The change boot order implementation calls eficonfig_process_common() same as other menus. The change boot order menu requires own item_data_print and item_choice implementation, but display_statusline function can be a same function as other menus. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
cd160b27 |
|
23-Jan-2023 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: refactor eficonfig_process_common function Current change boot order implementation does not call eficonfig_process_common() and call own menu functions for display_statusline, item_data_print and item_choice. Change boot order functionality should call eficonfig_process_common() to improve maintenanceability. This commit is a preparation to remove the change boot order specific implementation. The menu functions (display_statusline, item_data_print and item_choice) are added as argument of eficonfig_process_common(). The menu description string displayed at the bottom of the menu is also added as argument. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
32bab0ea |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Make use of CLI character processing Avoid duplicating some of the escape-sequence processing here and use the CLI function instead. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
d0ca98db |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Update bootmenu_loop() to return the code Use the return value to save having to pass around a pointer. This also resolves any ambiguity about what *key contains when the function is called. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
2da4a15e |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Rename KEY_... to BKEY_... This enum values conflict with linux/input.h so rename them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
64550274 |
|
18-Dec-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: avoid SetVariable between GetNextVariableName calls The current code calls efi_set_variable_int() to delete the invalid boot option between calls to efi_get_next_variable_name_int(), it may produce unpredictable results. This commit moves removal of the invalid boot option outside of the efi_get_next_variable_name_int() calls. EFI_NOT_FOUND returned from efi_get_next_variable_name_int() indicates we retrieved all EFI variables, it should be treated as EFI_SUCEESS. To address the checkpatch warning of too many leading tabs, combine two if statement into one. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
ce327084 |
|
18-Dec-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: carve out efi_get_next_variable_name_int calls To retrieve the EFI variable name by efi_get_next_variable_name_int(), the sequence of alloc -> efi_get_next_variable_name_int -> realloc -> efi_get_next_variable_name_int is required. In current code, this sequence repeatedly appears in the several functions. It should be curved out a common function. This commit also fixes the missing free() of var_name16 in eficonfig_delete_invalid_boot_option(). Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
140a8959 |
|
01-Dec-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: use efi_get_next_variable_name_int() eficonfig command reads all possible UEFI load options from 0x0000 to 0xFFFF to construct the menu. This takes too much time in some environment. This commit uses efi_get_next_variable_name_int() to read all existing UEFI load options to significantlly reduce the count of efi_get_var() call. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
78b1ccc4 |
|
01-Dec-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: use u16_strsize() to get u16 string buffer size Use u16_strsize() to simplify the u16 string buffer size calculation. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c67d3c9e |
|
01-Dec-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: fix going one directory up issue The directory name in eficonfig menu entry contains the '\' separator. strcmp() argument ".." is wrong and one directory up handling does not work correctly. strcmp() argument must include '\' separator. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c3b5af63 |
|
19-Nov-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: add UEFI Secure Boot Key enrollment interface This commit adds the menu-driven UEFI Secure Boot Key enrollment interface. User can enroll PK, KEK, db and dbx by selecting file. Only the signed EFI Signature List(s) with an authenticated header, typically '.auth' file, is accepted. To clear the PK, KEK, db and dbx, user needs to enroll the null key signed by PK or KEK. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
21faf4ef |
|
19-Nov-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: use protocol interface for file selection EFI_SIMPLE_FILE_SYSTEM_PROTOCOL is not always provided by U-Boot. Use protocol interface functions instead of U-Boot internal functions. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d6566113 |
|
19-Nov-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: expose eficonfig_create_device_path() Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use eficonfig_create_device_path() to construct the full device path from device path of the volume and file path, so move it out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d571f9b2 |
|
19-Nov-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: refactor change boot order implementation All the eficonfig menus other than "Change Boot Order" use 'eficonfig_entry' structure for each menu entry. This commit refactors change boot order implementation to use 'eficonfig_entry' structure same as other menus to have consistent menu handling. This commit also simplifies the data->active handling when KEY_SPACE is pressed, and sizeof() parameter. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
8961e93e |
|
19-Nov-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: expose append entry function Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use append_entry() and append_quit_entry() to construct the menu, so move them out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
a84040ab |
|
19-Nov-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: refactor file selection handling eficonfig_select_file_handler() is commonly used to select the file. eficonfig_display_select_file_option() adds an additional menu to clear the selected file. eficonfig_display_select_file_option() is not always necessary for the file selection process, so it must be outside of eficonfig_select_file_handler(). This commit also renames the following functions to avoid confusion. eficonfig_select_file_handler() -> eficonfig_process_select_file() eficonfig_select_file() -> eficonfig_show_file_selection() eficonfig_display_select_file_option() -> eficonfig_process_show_file_option() Finally, test_eficonfig.py need to be updated to get aligned with the above modification. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
1167e88a |
|
14-Nov-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: fix missing variable initialization The 'ret' variable must be initialized before use in eficonfig_delete_invalid_boot_option(). Fixes: c416f1c0bc ("bootmenu: add removable media entries") Addresses-Coverity: 376207 ("Uninitialized variables") Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
3d595ac5 |
|
09-Nov-2022 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: remove superfluous if in eficonfig_edit_boot_option Goto for an immediately succeeding label is superfluous. Fixes: 87d791423ac6 ("eficonfig: menu-driven addition of UEFI boot option") Addresses-Coverity: 376202 ("Identical code for different branches") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
f19171c9 |
|
08-Jan-2024 |
Ilias Apalodimas <ilias.apalodimas@linaro.org> |
efi_loader: Clean up efi_dp_append and efi_dp_concat Looking back at the initrd storing functionality, we introduced three functions, efi_dp_append_or_concatenate(), efi_dp_append/concat(). In hindsight we could have simplified that by a lot. First of all none of the functions append anything. They all allocate a new device path and concatenate the contents of two device paths in one. A boolean parameter controls the final device path -- if that's true an end node is injected between the two device paths. So let's rewrite this and make it a bit easier to read. Get rid of efi_dp_append(), efi_dp_concat() and rename efi_dp_append_or_concatenate() to efi_dp_concat(). This is far more intuitive and the only adjustment that is needed is an extra boolean argument on all callsites. Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
64658007 |
|
17-Nov-2023 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: eficonfig: create shortened boot options The boot options created by eficonfig should use shortened device-paths to avoid problems if drives are enumerated in a different sequence. Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
9945bc4f |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Fix incorrect return code of boot option update Correct the return code for out-of-memory and no boot option found Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
339b527b |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Move bootorder and bootoption apis to lib Rename and move bootorder and bootoption apis from cmd to lib for re-use between eficonfig and bootmgr Fix 'unexpected indentation' when 'make htmldocs' after functions are moved Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
2c0b0c31 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_SECURE_BOOT This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_SECURE_BOOT defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
83f3d121 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_MM_COMM_TEE This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_MM_COMM_TEE defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
88df3634 |
|
02-Feb-2023 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: CTRL+S to save the boot order 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>
|
#
45f5319f |
|
02-Feb-2023 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
menu: remove CTRL+C to quit On the sandbox called without "--terminal raw" CTRL+C leaves U-Boot, "ESC/CTRL+C to quit" is misleading. Let's remove CTRL+C to quit key handling from bootmenu and eficonfig menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
|
#
8dbd0a0f |
|
23-Jan-2023 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: add vertical scroll support The current eficonfig menu does not support vertical scroll, so it can not display the menu entries greater than the console row size. This commit add the vertial scroll support. The console size is retrieved by SIMPLE_TEXT_OUTPUT_PROTOCOL.QueryMode() service, then calculates the row size for menu entry by subtracting menu header and description row size from the console row size. "start" and "end" are added in the efimenu structure. "start" keeps the menu entry index at the top, "end" keeps the bottom menu entry index. item_data_print() menu function only draws the menu entry between "start" and "end". This commit also fixes the issue that "Save" and "Quit" entries can be moved by BKEY_PLUS in change boot order menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
0d590852 |
|
23-Jan-2023 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: refactor change boot order implementation This commit removes the change boot order specific menu implementation. The change boot order implementation calls eficonfig_process_common() same as other menus. The change boot order menu requires own item_data_print and item_choice implementation, but display_statusline function can be a same function as other menus. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
cd160b27 |
|
23-Jan-2023 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: refactor eficonfig_process_common function Current change boot order implementation does not call eficonfig_process_common() and call own menu functions for display_statusline, item_data_print and item_choice. Change boot order functionality should call eficonfig_process_common() to improve maintenanceability. This commit is a preparation to remove the change boot order specific implementation. The menu functions (display_statusline, item_data_print and item_choice) are added as argument of eficonfig_process_common(). The menu description string displayed at the bottom of the menu is also added as argument. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
32bab0ea |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Make use of CLI character processing Avoid duplicating some of the escape-sequence processing here and use the CLI function instead. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
d0ca98db |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Update bootmenu_loop() to return the code Use the return value to save having to pass around a pointer. This also resolves any ambiguity about what *key contains when the function is called. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
2da4a15e |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Rename KEY_... to BKEY_... This enum values conflict with linux/input.h so rename them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
64550274 |
|
18-Dec-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: avoid SetVariable between GetNextVariableName calls The current code calls efi_set_variable_int() to delete the invalid boot option between calls to efi_get_next_variable_name_int(), it may produce unpredictable results. This commit moves removal of the invalid boot option outside of the efi_get_next_variable_name_int() calls. EFI_NOT_FOUND returned from efi_get_next_variable_name_int() indicates we retrieved all EFI variables, it should be treated as EFI_SUCEESS. To address the checkpatch warning of too many leading tabs, combine two if statement into one. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
ce327084 |
|
18-Dec-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: carve out efi_get_next_variable_name_int calls To retrieve the EFI variable name by efi_get_next_variable_name_int(), the sequence of alloc -> efi_get_next_variable_name_int -> realloc -> efi_get_next_variable_name_int is required. In current code, this sequence repeatedly appears in the several functions. It should be curved out a common function. This commit also fixes the missing free() of var_name16 in eficonfig_delete_invalid_boot_option(). Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
140a8959 |
|
01-Dec-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: use efi_get_next_variable_name_int() eficonfig command reads all possible UEFI load options from 0x0000 to 0xFFFF to construct the menu. This takes too much time in some environment. This commit uses efi_get_next_variable_name_int() to read all existing UEFI load options to significantlly reduce the count of efi_get_var() call. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
78b1ccc4 |
|
01-Dec-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: use u16_strsize() to get u16 string buffer size Use u16_strsize() to simplify the u16 string buffer size calculation. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c67d3c9e |
|
01-Dec-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: fix going one directory up issue The directory name in eficonfig menu entry contains the '\' separator. strcmp() argument ".." is wrong and one directory up handling does not work correctly. strcmp() argument must include '\' separator. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c3b5af63 |
|
19-Nov-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: add UEFI Secure Boot Key enrollment interface This commit adds the menu-driven UEFI Secure Boot Key enrollment interface. User can enroll PK, KEK, db and dbx by selecting file. Only the signed EFI Signature List(s) with an authenticated header, typically '.auth' file, is accepted. To clear the PK, KEK, db and dbx, user needs to enroll the null key signed by PK or KEK. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
21faf4ef |
|
19-Nov-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: use protocol interface for file selection EFI_SIMPLE_FILE_SYSTEM_PROTOCOL is not always provided by U-Boot. Use protocol interface functions instead of U-Boot internal functions. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d6566113 |
|
19-Nov-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: expose eficonfig_create_device_path() Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use eficonfig_create_device_path() to construct the full device path from device path of the volume and file path, so move it out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d571f9b2 |
|
19-Nov-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: refactor change boot order implementation All the eficonfig menus other than "Change Boot Order" use 'eficonfig_entry' structure for each menu entry. This commit refactors change boot order implementation to use 'eficonfig_entry' structure same as other menus to have consistent menu handling. This commit also simplifies the data->active handling when KEY_SPACE is pressed, and sizeof() parameter. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
8961e93e |
|
19-Nov-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: expose append entry function Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use append_entry() and append_quit_entry() to construct the menu, so move them out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
a84040ab |
|
19-Nov-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: refactor file selection handling eficonfig_select_file_handler() is commonly used to select the file. eficonfig_display_select_file_option() adds an additional menu to clear the selected file. eficonfig_display_select_file_option() is not always necessary for the file selection process, so it must be outside of eficonfig_select_file_handler(). This commit also renames the following functions to avoid confusion. eficonfig_select_file_handler() -> eficonfig_process_select_file() eficonfig_select_file() -> eficonfig_show_file_selection() eficonfig_display_select_file_option() -> eficonfig_process_show_file_option() Finally, test_eficonfig.py need to be updated to get aligned with the above modification. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
1167e88a |
|
14-Nov-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: fix missing variable initialization The 'ret' variable must be initialized before use in eficonfig_delete_invalid_boot_option(). Fixes: c416f1c0bc ("bootmenu: add removable media entries") Addresses-Coverity: 376207 ("Uninitialized variables") Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
3d595ac5 |
|
09-Nov-2022 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: remove superfluous if in eficonfig_edit_boot_option Goto for an immediately succeeding label is superfluous. Fixes: 87d791423ac6 ("eficonfig: menu-driven addition of UEFI boot option") Addresses-Coverity: 376202 ("Identical code for different branches") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
f19171c9 |
|
08-Jan-2024 |
Ilias Apalodimas <ilias.apalodimas@linaro.org> |
efi_loader: Clean up efi_dp_append and efi_dp_concat Looking back at the initrd storing functionality, we introduced three functions, efi_dp_append_or_concatenate(), efi_dp_append/concat(). In hindsight we could have simplified that by a lot. First of all none of the functions append anything. They all allocate a new device path and concatenate the contents of two device paths in one. A boolean parameter controls the final device path -- if that's true an end node is injected between the two device paths. So let's rewrite this and make it a bit easier to read. Get rid of efi_dp_append(), efi_dp_concat() and rename efi_dp_append_or_concatenate() to efi_dp_concat(). This is far more intuitive and the only adjustment that is needed is an extra boolean argument on all callsites. Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
64658007 |
|
17-Nov-2023 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: eficonfig: create shortened boot options The boot options created by eficonfig should use shortened device-paths to avoid problems if drives are enumerated in a different sequence. Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
9945bc4f |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Fix incorrect return code of boot option update Correct the return code for out-of-memory and no boot option found Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
339b527b |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Move bootorder and bootoption apis to lib Rename and move bootorder and bootoption apis from cmd to lib for re-use between eficonfig and bootmgr Fix 'unexpected indentation' when 'make htmldocs' after functions are moved Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
2c0b0c31 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_SECURE_BOOT This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_SECURE_BOOT defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
83f3d121 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_MM_COMM_TEE This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_MM_COMM_TEE defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
88df3634 |
|
02-Feb-2023 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: CTRL+S to save the boot order 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>
|
#
45f5319f |
|
02-Feb-2023 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
menu: remove CTRL+C to quit On the sandbox called without "--terminal raw" CTRL+C leaves U-Boot, "ESC/CTRL+C to quit" is misleading. Let's remove CTRL+C to quit key handling from bootmenu and eficonfig menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
|
#
8dbd0a0f |
|
23-Jan-2023 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: add vertical scroll support The current eficonfig menu does not support vertical scroll, so it can not display the menu entries greater than the console row size. This commit add the vertial scroll support. The console size is retrieved by SIMPLE_TEXT_OUTPUT_PROTOCOL.QueryMode() service, then calculates the row size for menu entry by subtracting menu header and description row size from the console row size. "start" and "end" are added in the efimenu structure. "start" keeps the menu entry index at the top, "end" keeps the bottom menu entry index. item_data_print() menu function only draws the menu entry between "start" and "end". This commit also fixes the issue that "Save" and "Quit" entries can be moved by BKEY_PLUS in change boot order menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
0d590852 |
|
23-Jan-2023 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: refactor change boot order implementation This commit removes the change boot order specific menu implementation. The change boot order implementation calls eficonfig_process_common() same as other menus. The change boot order menu requires own item_data_print and item_choice implementation, but display_statusline function can be a same function as other menus. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
cd160b27 |
|
23-Jan-2023 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: refactor eficonfig_process_common function Current change boot order implementation does not call eficonfig_process_common() and call own menu functions for display_statusline, item_data_print and item_choice. Change boot order functionality should call eficonfig_process_common() to improve maintenanceability. This commit is a preparation to remove the change boot order specific implementation. The menu functions (display_statusline, item_data_print and item_choice) are added as argument of eficonfig_process_common(). The menu description string displayed at the bottom of the menu is also added as argument. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
32bab0ea |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Make use of CLI character processing Avoid duplicating some of the escape-sequence processing here and use the CLI function instead. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
d0ca98db |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Update bootmenu_loop() to return the code Use the return value to save having to pass around a pointer. This also resolves any ambiguity about what *key contains when the function is called. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
2da4a15e |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Rename KEY_... to BKEY_... This enum values conflict with linux/input.h so rename them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
64550274 |
|
18-Dec-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: avoid SetVariable between GetNextVariableName calls The current code calls efi_set_variable_int() to delete the invalid boot option between calls to efi_get_next_variable_name_int(), it may produce unpredictable results. This commit moves removal of the invalid boot option outside of the efi_get_next_variable_name_int() calls. EFI_NOT_FOUND returned from efi_get_next_variable_name_int() indicates we retrieved all EFI variables, it should be treated as EFI_SUCEESS. To address the checkpatch warning of too many leading tabs, combine two if statement into one. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
ce327084 |
|
18-Dec-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: carve out efi_get_next_variable_name_int calls To retrieve the EFI variable name by efi_get_next_variable_name_int(), the sequence of alloc -> efi_get_next_variable_name_int -> realloc -> efi_get_next_variable_name_int is required. In current code, this sequence repeatedly appears in the several functions. It should be curved out a common function. This commit also fixes the missing free() of var_name16 in eficonfig_delete_invalid_boot_option(). Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
140a8959 |
|
01-Dec-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: use efi_get_next_variable_name_int() eficonfig command reads all possible UEFI load options from 0x0000 to 0xFFFF to construct the menu. This takes too much time in some environment. This commit uses efi_get_next_variable_name_int() to read all existing UEFI load options to significantlly reduce the count of efi_get_var() call. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
78b1ccc4 |
|
01-Dec-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: use u16_strsize() to get u16 string buffer size Use u16_strsize() to simplify the u16 string buffer size calculation. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c67d3c9e |
|
01-Dec-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: fix going one directory up issue The directory name in eficonfig menu entry contains the '\' separator. strcmp() argument ".." is wrong and one directory up handling does not work correctly. strcmp() argument must include '\' separator. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c3b5af63 |
|
19-Nov-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: add UEFI Secure Boot Key enrollment interface This commit adds the menu-driven UEFI Secure Boot Key enrollment interface. User can enroll PK, KEK, db and dbx by selecting file. Only the signed EFI Signature List(s) with an authenticated header, typically '.auth' file, is accepted. To clear the PK, KEK, db and dbx, user needs to enroll the null key signed by PK or KEK. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
21faf4ef |
|
19-Nov-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: use protocol interface for file selection EFI_SIMPLE_FILE_SYSTEM_PROTOCOL is not always provided by U-Boot. Use protocol interface functions instead of U-Boot internal functions. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d6566113 |
|
19-Nov-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: expose eficonfig_create_device_path() Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use eficonfig_create_device_path() to construct the full device path from device path of the volume and file path, so move it out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d571f9b2 |
|
19-Nov-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: refactor change boot order implementation All the eficonfig menus other than "Change Boot Order" use 'eficonfig_entry' structure for each menu entry. This commit refactors change boot order implementation to use 'eficonfig_entry' structure same as other menus to have consistent menu handling. This commit also simplifies the data->active handling when KEY_SPACE is pressed, and sizeof() parameter. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
8961e93e |
|
19-Nov-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: expose append entry function Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use append_entry() and append_quit_entry() to construct the menu, so move them out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
a84040ab |
|
19-Nov-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: refactor file selection handling eficonfig_select_file_handler() is commonly used to select the file. eficonfig_display_select_file_option() adds an additional menu to clear the selected file. eficonfig_display_select_file_option() is not always necessary for the file selection process, so it must be outside of eficonfig_select_file_handler(). This commit also renames the following functions to avoid confusion. eficonfig_select_file_handler() -> eficonfig_process_select_file() eficonfig_select_file() -> eficonfig_show_file_selection() eficonfig_display_select_file_option() -> eficonfig_process_show_file_option() Finally, test_eficonfig.py need to be updated to get aligned with the above modification. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
1167e88a |
|
14-Nov-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: fix missing variable initialization The 'ret' variable must be initialized before use in eficonfig_delete_invalid_boot_option(). Fixes: c416f1c0bc ("bootmenu: add removable media entries") Addresses-Coverity: 376207 ("Uninitialized variables") Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
3d595ac5 |
|
09-Nov-2022 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: remove superfluous if in eficonfig_edit_boot_option Goto for an immediately succeeding label is superfluous. Fixes: 87d791423ac6 ("eficonfig: menu-driven addition of UEFI boot option") Addresses-Coverity: 376202 ("Identical code for different branches") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
f19171c9 |
|
08-Jan-2024 |
Ilias Apalodimas <ilias.apalodimas@linaro.org> |
efi_loader: Clean up efi_dp_append and efi_dp_concat Looking back at the initrd storing functionality, we introduced three functions, efi_dp_append_or_concatenate(), efi_dp_append/concat(). In hindsight we could have simplified that by a lot. First of all none of the functions append anything. They all allocate a new device path and concatenate the contents of two device paths in one. A boolean parameter controls the final device path -- if that's true an end node is injected between the two device paths. So let's rewrite this and make it a bit easier to read. Get rid of efi_dp_append(), efi_dp_concat() and rename efi_dp_append_or_concatenate() to efi_dp_concat(). This is far more intuitive and the only adjustment that is needed is an extra boolean argument on all callsites. Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
64658007 |
|
17-Nov-2023 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: eficonfig: create shortened boot options The boot options created by eficonfig should use shortened device-paths to avoid problems if drives are enumerated in a different sequence. Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
9945bc4f |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Fix incorrect return code of boot option update Correct the return code for out-of-memory and no boot option found Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
339b527b |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Move bootorder and bootoption apis to lib Rename and move bootorder and bootoption apis from cmd to lib for re-use between eficonfig and bootmgr Fix 'unexpected indentation' when 'make htmldocs' after functions are moved Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
2c0b0c31 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_SECURE_BOOT This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_SECURE_BOOT defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
83f3d121 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_MM_COMM_TEE This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_MM_COMM_TEE defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
88df3634 |
|
02-Feb-2023 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: CTRL+S to save the boot order 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>
|
#
45f5319f |
|
02-Feb-2023 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
menu: remove CTRL+C to quit On the sandbox called without "--terminal raw" CTRL+C leaves U-Boot, "ESC/CTRL+C to quit" is misleading. Let's remove CTRL+C to quit key handling from bootmenu and eficonfig menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
|
#
8dbd0a0f |
|
23-Jan-2023 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: add vertical scroll support The current eficonfig menu does not support vertical scroll, so it can not display the menu entries greater than the console row size. This commit add the vertial scroll support. The console size is retrieved by SIMPLE_TEXT_OUTPUT_PROTOCOL.QueryMode() service, then calculates the row size for menu entry by subtracting menu header and description row size from the console row size. "start" and "end" are added in the efimenu structure. "start" keeps the menu entry index at the top, "end" keeps the bottom menu entry index. item_data_print() menu function only draws the menu entry between "start" and "end". This commit also fixes the issue that "Save" and "Quit" entries can be moved by BKEY_PLUS in change boot order menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
0d590852 |
|
23-Jan-2023 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: refactor change boot order implementation This commit removes the change boot order specific menu implementation. The change boot order implementation calls eficonfig_process_common() same as other menus. The change boot order menu requires own item_data_print and item_choice implementation, but display_statusline function can be a same function as other menus. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
cd160b27 |
|
23-Jan-2023 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: refactor eficonfig_process_common function Current change boot order implementation does not call eficonfig_process_common() and call own menu functions for display_statusline, item_data_print and item_choice. Change boot order functionality should call eficonfig_process_common() to improve maintenanceability. This commit is a preparation to remove the change boot order specific implementation. The menu functions (display_statusline, item_data_print and item_choice) are added as argument of eficonfig_process_common(). The menu description string displayed at the bottom of the menu is also added as argument. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
32bab0ea |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Make use of CLI character processing Avoid duplicating some of the escape-sequence processing here and use the CLI function instead. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
d0ca98db |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Update bootmenu_loop() to return the code Use the return value to save having to pass around a pointer. This also resolves any ambiguity about what *key contains when the function is called. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
2da4a15e |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Rename KEY_... to BKEY_... This enum values conflict with linux/input.h so rename them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
64550274 |
|
18-Dec-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: avoid SetVariable between GetNextVariableName calls The current code calls efi_set_variable_int() to delete the invalid boot option between calls to efi_get_next_variable_name_int(), it may produce unpredictable results. This commit moves removal of the invalid boot option outside of the efi_get_next_variable_name_int() calls. EFI_NOT_FOUND returned from efi_get_next_variable_name_int() indicates we retrieved all EFI variables, it should be treated as EFI_SUCEESS. To address the checkpatch warning of too many leading tabs, combine two if statement into one. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
ce327084 |
|
18-Dec-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: carve out efi_get_next_variable_name_int calls To retrieve the EFI variable name by efi_get_next_variable_name_int(), the sequence of alloc -> efi_get_next_variable_name_int -> realloc -> efi_get_next_variable_name_int is required. In current code, this sequence repeatedly appears in the several functions. It should be curved out a common function. This commit also fixes the missing free() of var_name16 in eficonfig_delete_invalid_boot_option(). Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
140a8959 |
|
01-Dec-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: use efi_get_next_variable_name_int() eficonfig command reads all possible UEFI load options from 0x0000 to 0xFFFF to construct the menu. This takes too much time in some environment. This commit uses efi_get_next_variable_name_int() to read all existing UEFI load options to significantlly reduce the count of efi_get_var() call. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
78b1ccc4 |
|
01-Dec-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: use u16_strsize() to get u16 string buffer size Use u16_strsize() to simplify the u16 string buffer size calculation. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c67d3c9e |
|
01-Dec-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: fix going one directory up issue The directory name in eficonfig menu entry contains the '\' separator. strcmp() argument ".." is wrong and one directory up handling does not work correctly. strcmp() argument must include '\' separator. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c3b5af63 |
|
19-Nov-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: add UEFI Secure Boot Key enrollment interface This commit adds the menu-driven UEFI Secure Boot Key enrollment interface. User can enroll PK, KEK, db and dbx by selecting file. Only the signed EFI Signature List(s) with an authenticated header, typically '.auth' file, is accepted. To clear the PK, KEK, db and dbx, user needs to enroll the null key signed by PK or KEK. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
21faf4ef |
|
19-Nov-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: use protocol interface for file selection EFI_SIMPLE_FILE_SYSTEM_PROTOCOL is not always provided by U-Boot. Use protocol interface functions instead of U-Boot internal functions. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d6566113 |
|
19-Nov-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: expose eficonfig_create_device_path() Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use eficonfig_create_device_path() to construct the full device path from device path of the volume and file path, so move it out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d571f9b2 |
|
19-Nov-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: refactor change boot order implementation All the eficonfig menus other than "Change Boot Order" use 'eficonfig_entry' structure for each menu entry. This commit refactors change boot order implementation to use 'eficonfig_entry' structure same as other menus to have consistent menu handling. This commit also simplifies the data->active handling when KEY_SPACE is pressed, and sizeof() parameter. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
8961e93e |
|
19-Nov-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: expose append entry function Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use append_entry() and append_quit_entry() to construct the menu, so move them out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
a84040ab |
|
19-Nov-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: refactor file selection handling eficonfig_select_file_handler() is commonly used to select the file. eficonfig_display_select_file_option() adds an additional menu to clear the selected file. eficonfig_display_select_file_option() is not always necessary for the file selection process, so it must be outside of eficonfig_select_file_handler(). This commit also renames the following functions to avoid confusion. eficonfig_select_file_handler() -> eficonfig_process_select_file() eficonfig_select_file() -> eficonfig_show_file_selection() eficonfig_display_select_file_option() -> eficonfig_process_show_file_option() Finally, test_eficonfig.py need to be updated to get aligned with the above modification. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
1167e88a |
|
14-Nov-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: fix missing variable initialization The 'ret' variable must be initialized before use in eficonfig_delete_invalid_boot_option(). Fixes: c416f1c0bc ("bootmenu: add removable media entries") Addresses-Coverity: 376207 ("Uninitialized variables") Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
3d595ac5 |
|
09-Nov-2022 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: remove superfluous if in eficonfig_edit_boot_option Goto for an immediately succeeding label is superfluous. Fixes: 87d791423ac6 ("eficonfig: menu-driven addition of UEFI boot option") Addresses-Coverity: 376202 ("Identical code for different branches") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
f19171c9 |
|
08-Jan-2024 |
Ilias Apalodimas <ilias.apalodimas@linaro.org> |
efi_loader: Clean up efi_dp_append and efi_dp_concat Looking back at the initrd storing functionality, we introduced three functions, efi_dp_append_or_concatenate(), efi_dp_append/concat(). In hindsight we could have simplified that by a lot. First of all none of the functions append anything. They all allocate a new device path and concatenate the contents of two device paths in one. A boolean parameter controls the final device path -- if that's true an end node is injected between the two device paths. So let's rewrite this and make it a bit easier to read. Get rid of efi_dp_append(), efi_dp_concat() and rename efi_dp_append_or_concatenate() to efi_dp_concat(). This is far more intuitive and the only adjustment that is needed is an extra boolean argument on all callsites. Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
64658007 |
|
17-Nov-2023 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: eficonfig: create shortened boot options The boot options created by eficonfig should use shortened device-paths to avoid problems if drives are enumerated in a different sequence. Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
9945bc4f |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Fix incorrect return code of boot option update Correct the return code for out-of-memory and no boot option found Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
339b527b |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Move bootorder and bootoption apis to lib Rename and move bootorder and bootoption apis from cmd to lib for re-use between eficonfig and bootmgr Fix 'unexpected indentation' when 'make htmldocs' after functions are moved Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
2c0b0c31 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_SECURE_BOOT This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_SECURE_BOOT defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
83f3d121 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_MM_COMM_TEE This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_MM_COMM_TEE defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
88df3634 |
|
02-Feb-2023 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: CTRL+S to save the boot order 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>
|
#
45f5319f |
|
02-Feb-2023 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
menu: remove CTRL+C to quit On the sandbox called without "--terminal raw" CTRL+C leaves U-Boot, "ESC/CTRL+C to quit" is misleading. Let's remove CTRL+C to quit key handling from bootmenu and eficonfig menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
|
#
8dbd0a0f |
|
23-Jan-2023 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: add vertical scroll support The current eficonfig menu does not support vertical scroll, so it can not display the menu entries greater than the console row size. This commit add the vertial scroll support. The console size is retrieved by SIMPLE_TEXT_OUTPUT_PROTOCOL.QueryMode() service, then calculates the row size for menu entry by subtracting menu header and description row size from the console row size. "start" and "end" are added in the efimenu structure. "start" keeps the menu entry index at the top, "end" keeps the bottom menu entry index. item_data_print() menu function only draws the menu entry between "start" and "end". This commit also fixes the issue that "Save" and "Quit" entries can be moved by BKEY_PLUS in change boot order menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
0d590852 |
|
23-Jan-2023 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: refactor change boot order implementation This commit removes the change boot order specific menu implementation. The change boot order implementation calls eficonfig_process_common() same as other menus. The change boot order menu requires own item_data_print and item_choice implementation, but display_statusline function can be a same function as other menus. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
cd160b27 |
|
23-Jan-2023 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: refactor eficonfig_process_common function Current change boot order implementation does not call eficonfig_process_common() and call own menu functions for display_statusline, item_data_print and item_choice. Change boot order functionality should call eficonfig_process_common() to improve maintenanceability. This commit is a preparation to remove the change boot order specific implementation. The menu functions (display_statusline, item_data_print and item_choice) are added as argument of eficonfig_process_common(). The menu description string displayed at the bottom of the menu is also added as argument. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
32bab0ea |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Make use of CLI character processing Avoid duplicating some of the escape-sequence processing here and use the CLI function instead. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
d0ca98db |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Update bootmenu_loop() to return the code Use the return value to save having to pass around a pointer. This also resolves any ambiguity about what *key contains when the function is called. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
2da4a15e |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Rename KEY_... to BKEY_... This enum values conflict with linux/input.h so rename them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
64550274 |
|
18-Dec-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: avoid SetVariable between GetNextVariableName calls The current code calls efi_set_variable_int() to delete the invalid boot option between calls to efi_get_next_variable_name_int(), it may produce unpredictable results. This commit moves removal of the invalid boot option outside of the efi_get_next_variable_name_int() calls. EFI_NOT_FOUND returned from efi_get_next_variable_name_int() indicates we retrieved all EFI variables, it should be treated as EFI_SUCEESS. To address the checkpatch warning of too many leading tabs, combine two if statement into one. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
ce327084 |
|
18-Dec-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: carve out efi_get_next_variable_name_int calls To retrieve the EFI variable name by efi_get_next_variable_name_int(), the sequence of alloc -> efi_get_next_variable_name_int -> realloc -> efi_get_next_variable_name_int is required. In current code, this sequence repeatedly appears in the several functions. It should be curved out a common function. This commit also fixes the missing free() of var_name16 in eficonfig_delete_invalid_boot_option(). Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
140a8959 |
|
01-Dec-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: use efi_get_next_variable_name_int() eficonfig command reads all possible UEFI load options from 0x0000 to 0xFFFF to construct the menu. This takes too much time in some environment. This commit uses efi_get_next_variable_name_int() to read all existing UEFI load options to significantlly reduce the count of efi_get_var() call. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
78b1ccc4 |
|
01-Dec-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: use u16_strsize() to get u16 string buffer size Use u16_strsize() to simplify the u16 string buffer size calculation. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c67d3c9e |
|
01-Dec-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: fix going one directory up issue The directory name in eficonfig menu entry contains the '\' separator. strcmp() argument ".." is wrong and one directory up handling does not work correctly. strcmp() argument must include '\' separator. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c3b5af63 |
|
19-Nov-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: add UEFI Secure Boot Key enrollment interface This commit adds the menu-driven UEFI Secure Boot Key enrollment interface. User can enroll PK, KEK, db and dbx by selecting file. Only the signed EFI Signature List(s) with an authenticated header, typically '.auth' file, is accepted. To clear the PK, KEK, db and dbx, user needs to enroll the null key signed by PK or KEK. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
21faf4ef |
|
19-Nov-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: use protocol interface for file selection EFI_SIMPLE_FILE_SYSTEM_PROTOCOL is not always provided by U-Boot. Use protocol interface functions instead of U-Boot internal functions. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d6566113 |
|
19-Nov-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: expose eficonfig_create_device_path() Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use eficonfig_create_device_path() to construct the full device path from device path of the volume and file path, so move it out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d571f9b2 |
|
19-Nov-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: refactor change boot order implementation All the eficonfig menus other than "Change Boot Order" use 'eficonfig_entry' structure for each menu entry. This commit refactors change boot order implementation to use 'eficonfig_entry' structure same as other menus to have consistent menu handling. This commit also simplifies the data->active handling when KEY_SPACE is pressed, and sizeof() parameter. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
8961e93e |
|
19-Nov-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: expose append entry function Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use append_entry() and append_quit_entry() to construct the menu, so move them out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
a84040ab |
|
19-Nov-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: refactor file selection handling eficonfig_select_file_handler() is commonly used to select the file. eficonfig_display_select_file_option() adds an additional menu to clear the selected file. eficonfig_display_select_file_option() is not always necessary for the file selection process, so it must be outside of eficonfig_select_file_handler(). This commit also renames the following functions to avoid confusion. eficonfig_select_file_handler() -> eficonfig_process_select_file() eficonfig_select_file() -> eficonfig_show_file_selection() eficonfig_display_select_file_option() -> eficonfig_process_show_file_option() Finally, test_eficonfig.py need to be updated to get aligned with the above modification. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
1167e88a |
|
14-Nov-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: fix missing variable initialization The 'ret' variable must be initialized before use in eficonfig_delete_invalid_boot_option(). Fixes: c416f1c0bc ("bootmenu: add removable media entries") Addresses-Coverity: 376207 ("Uninitialized variables") Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
3d595ac5 |
|
09-Nov-2022 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: remove superfluous if in eficonfig_edit_boot_option Goto for an immediately succeeding label is superfluous. Fixes: 87d791423ac6 ("eficonfig: menu-driven addition of UEFI boot option") Addresses-Coverity: 376202 ("Identical code for different branches") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
f19171c9 |
|
08-Jan-2024 |
Ilias Apalodimas <ilias.apalodimas@linaro.org> |
efi_loader: Clean up efi_dp_append and efi_dp_concat Looking back at the initrd storing functionality, we introduced three functions, efi_dp_append_or_concatenate(), efi_dp_append/concat(). In hindsight we could have simplified that by a lot. First of all none of the functions append anything. They all allocate a new device path and concatenate the contents of two device paths in one. A boolean parameter controls the final device path -- if that's true an end node is injected between the two device paths. So let's rewrite this and make it a bit easier to read. Get rid of efi_dp_append(), efi_dp_concat() and rename efi_dp_append_or_concatenate() to efi_dp_concat(). This is far more intuitive and the only adjustment that is needed is an extra boolean argument on all callsites. Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
64658007 |
|
17-Nov-2023 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: eficonfig: create shortened boot options The boot options created by eficonfig should use shortened device-paths to avoid problems if drives are enumerated in a different sequence. Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
9945bc4f |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Fix incorrect return code of boot option update Correct the return code for out-of-memory and no boot option found Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
339b527b |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Move bootorder and bootoption apis to lib Rename and move bootorder and bootoption apis from cmd to lib for re-use between eficonfig and bootmgr Fix 'unexpected indentation' when 'make htmldocs' after functions are moved Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
2c0b0c31 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_SECURE_BOOT This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_SECURE_BOOT defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
83f3d121 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_MM_COMM_TEE This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_MM_COMM_TEE defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
88df3634 |
|
02-Feb-2023 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: CTRL+S to save the boot order 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>
|
#
45f5319f |
|
02-Feb-2023 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
menu: remove CTRL+C to quit On the sandbox called without "--terminal raw" CTRL+C leaves U-Boot, "ESC/CTRL+C to quit" is misleading. Let's remove CTRL+C to quit key handling from bootmenu and eficonfig menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
|
#
8dbd0a0f |
|
23-Jan-2023 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: add vertical scroll support The current eficonfig menu does not support vertical scroll, so it can not display the menu entries greater than the console row size. This commit add the vertial scroll support. The console size is retrieved by SIMPLE_TEXT_OUTPUT_PROTOCOL.QueryMode() service, then calculates the row size for menu entry by subtracting menu header and description row size from the console row size. "start" and "end" are added in the efimenu structure. "start" keeps the menu entry index at the top, "end" keeps the bottom menu entry index. item_data_print() menu function only draws the menu entry between "start" and "end". This commit also fixes the issue that "Save" and "Quit" entries can be moved by BKEY_PLUS in change boot order menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
0d590852 |
|
23-Jan-2023 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: refactor change boot order implementation This commit removes the change boot order specific menu implementation. The change boot order implementation calls eficonfig_process_common() same as other menus. The change boot order menu requires own item_data_print and item_choice implementation, but display_statusline function can be a same function as other menus. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
cd160b27 |
|
23-Jan-2023 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: refactor eficonfig_process_common function Current change boot order implementation does not call eficonfig_process_common() and call own menu functions for display_statusline, item_data_print and item_choice. Change boot order functionality should call eficonfig_process_common() to improve maintenanceability. This commit is a preparation to remove the change boot order specific implementation. The menu functions (display_statusline, item_data_print and item_choice) are added as argument of eficonfig_process_common(). The menu description string displayed at the bottom of the menu is also added as argument. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
32bab0ea |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Make use of CLI character processing Avoid duplicating some of the escape-sequence processing here and use the CLI function instead. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
d0ca98db |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Update bootmenu_loop() to return the code Use the return value to save having to pass around a pointer. This also resolves any ambiguity about what *key contains when the function is called. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
2da4a15e |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Rename KEY_... to BKEY_... This enum values conflict with linux/input.h so rename them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
64550274 |
|
18-Dec-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: avoid SetVariable between GetNextVariableName calls The current code calls efi_set_variable_int() to delete the invalid boot option between calls to efi_get_next_variable_name_int(), it may produce unpredictable results. This commit moves removal of the invalid boot option outside of the efi_get_next_variable_name_int() calls. EFI_NOT_FOUND returned from efi_get_next_variable_name_int() indicates we retrieved all EFI variables, it should be treated as EFI_SUCEESS. To address the checkpatch warning of too many leading tabs, combine two if statement into one. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
ce327084 |
|
18-Dec-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: carve out efi_get_next_variable_name_int calls To retrieve the EFI variable name by efi_get_next_variable_name_int(), the sequence of alloc -> efi_get_next_variable_name_int -> realloc -> efi_get_next_variable_name_int is required. In current code, this sequence repeatedly appears in the several functions. It should be curved out a common function. This commit also fixes the missing free() of var_name16 in eficonfig_delete_invalid_boot_option(). Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
140a8959 |
|
01-Dec-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: use efi_get_next_variable_name_int() eficonfig command reads all possible UEFI load options from 0x0000 to 0xFFFF to construct the menu. This takes too much time in some environment. This commit uses efi_get_next_variable_name_int() to read all existing UEFI load options to significantlly reduce the count of efi_get_var() call. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
78b1ccc4 |
|
01-Dec-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: use u16_strsize() to get u16 string buffer size Use u16_strsize() to simplify the u16 string buffer size calculation. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c67d3c9e |
|
01-Dec-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: fix going one directory up issue The directory name in eficonfig menu entry contains the '\' separator. strcmp() argument ".." is wrong and one directory up handling does not work correctly. strcmp() argument must include '\' separator. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c3b5af63 |
|
19-Nov-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: add UEFI Secure Boot Key enrollment interface This commit adds the menu-driven UEFI Secure Boot Key enrollment interface. User can enroll PK, KEK, db and dbx by selecting file. Only the signed EFI Signature List(s) with an authenticated header, typically '.auth' file, is accepted. To clear the PK, KEK, db and dbx, user needs to enroll the null key signed by PK or KEK. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
21faf4ef |
|
19-Nov-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: use protocol interface for file selection EFI_SIMPLE_FILE_SYSTEM_PROTOCOL is not always provided by U-Boot. Use protocol interface functions instead of U-Boot internal functions. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d6566113 |
|
19-Nov-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: expose eficonfig_create_device_path() Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use eficonfig_create_device_path() to construct the full device path from device path of the volume and file path, so move it out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d571f9b2 |
|
19-Nov-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: refactor change boot order implementation All the eficonfig menus other than "Change Boot Order" use 'eficonfig_entry' structure for each menu entry. This commit refactors change boot order implementation to use 'eficonfig_entry' structure same as other menus to have consistent menu handling. This commit also simplifies the data->active handling when KEY_SPACE is pressed, and sizeof() parameter. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
8961e93e |
|
19-Nov-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: expose append entry function Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use append_entry() and append_quit_entry() to construct the menu, so move them out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
a84040ab |
|
19-Nov-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: refactor file selection handling eficonfig_select_file_handler() is commonly used to select the file. eficonfig_display_select_file_option() adds an additional menu to clear the selected file. eficonfig_display_select_file_option() is not always necessary for the file selection process, so it must be outside of eficonfig_select_file_handler(). This commit also renames the following functions to avoid confusion. eficonfig_select_file_handler() -> eficonfig_process_select_file() eficonfig_select_file() -> eficonfig_show_file_selection() eficonfig_display_select_file_option() -> eficonfig_process_show_file_option() Finally, test_eficonfig.py need to be updated to get aligned with the above modification. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
1167e88a |
|
14-Nov-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: fix missing variable initialization The 'ret' variable must be initialized before use in eficonfig_delete_invalid_boot_option(). Fixes: c416f1c0bc ("bootmenu: add removable media entries") Addresses-Coverity: 376207 ("Uninitialized variables") Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
3d595ac5 |
|
09-Nov-2022 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: remove superfluous if in eficonfig_edit_boot_option Goto for an immediately succeeding label is superfluous. Fixes: 87d791423ac6 ("eficonfig: menu-driven addition of UEFI boot option") Addresses-Coverity: 376202 ("Identical code for different branches") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
f19171c9 |
|
08-Jan-2024 |
Ilias Apalodimas <ilias.apalodimas@linaro.org> |
efi_loader: Clean up efi_dp_append and efi_dp_concat Looking back at the initrd storing functionality, we introduced three functions, efi_dp_append_or_concatenate(), efi_dp_append/concat(). In hindsight we could have simplified that by a lot. First of all none of the functions append anything. They all allocate a new device path and concatenate the contents of two device paths in one. A boolean parameter controls the final device path -- if that's true an end node is injected between the two device paths. So let's rewrite this and make it a bit easier to read. Get rid of efi_dp_append(), efi_dp_concat() and rename efi_dp_append_or_concatenate() to efi_dp_concat(). This is far more intuitive and the only adjustment that is needed is an extra boolean argument on all callsites. Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
64658007 |
|
17-Nov-2023 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: eficonfig: create shortened boot options The boot options created by eficonfig should use shortened device-paths to avoid problems if drives are enumerated in a different sequence. Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
9945bc4f |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Fix incorrect return code of boot option update Correct the return code for out-of-memory and no boot option found Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
339b527b |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Move bootorder and bootoption apis to lib Rename and move bootorder and bootoption apis from cmd to lib for re-use between eficonfig and bootmgr Fix 'unexpected indentation' when 'make htmldocs' after functions are moved Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
2c0b0c31 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_SECURE_BOOT This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_SECURE_BOOT defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
83f3d121 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_MM_COMM_TEE This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_MM_COMM_TEE defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
88df3634 |
|
02-Feb-2023 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: CTRL+S to save the boot order 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>
|
#
45f5319f |
|
02-Feb-2023 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
menu: remove CTRL+C to quit On the sandbox called without "--terminal raw" CTRL+C leaves U-Boot, "ESC/CTRL+C to quit" is misleading. Let's remove CTRL+C to quit key handling from bootmenu and eficonfig menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
|
#
8dbd0a0f |
|
23-Jan-2023 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: add vertical scroll support The current eficonfig menu does not support vertical scroll, so it can not display the menu entries greater than the console row size. This commit add the vertial scroll support. The console size is retrieved by SIMPLE_TEXT_OUTPUT_PROTOCOL.QueryMode() service, then calculates the row size for menu entry by subtracting menu header and description row size from the console row size. "start" and "end" are added in the efimenu structure. "start" keeps the menu entry index at the top, "end" keeps the bottom menu entry index. item_data_print() menu function only draws the menu entry between "start" and "end". This commit also fixes the issue that "Save" and "Quit" entries can be moved by BKEY_PLUS in change boot order menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
0d590852 |
|
23-Jan-2023 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: refactor change boot order implementation This commit removes the change boot order specific menu implementation. The change boot order implementation calls eficonfig_process_common() same as other menus. The change boot order menu requires own item_data_print and item_choice implementation, but display_statusline function can be a same function as other menus. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
cd160b27 |
|
23-Jan-2023 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: refactor eficonfig_process_common function Current change boot order implementation does not call eficonfig_process_common() and call own menu functions for display_statusline, item_data_print and item_choice. Change boot order functionality should call eficonfig_process_common() to improve maintenanceability. This commit is a preparation to remove the change boot order specific implementation. The menu functions (display_statusline, item_data_print and item_choice) are added as argument of eficonfig_process_common(). The menu description string displayed at the bottom of the menu is also added as argument. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
32bab0ea |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Make use of CLI character processing Avoid duplicating some of the escape-sequence processing here and use the CLI function instead. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
d0ca98db |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Update bootmenu_loop() to return the code Use the return value to save having to pass around a pointer. This also resolves any ambiguity about what *key contains when the function is called. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
2da4a15e |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Rename KEY_... to BKEY_... This enum values conflict with linux/input.h so rename them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
64550274 |
|
18-Dec-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: avoid SetVariable between GetNextVariableName calls The current code calls efi_set_variable_int() to delete the invalid boot option between calls to efi_get_next_variable_name_int(), it may produce unpredictable results. This commit moves removal of the invalid boot option outside of the efi_get_next_variable_name_int() calls. EFI_NOT_FOUND returned from efi_get_next_variable_name_int() indicates we retrieved all EFI variables, it should be treated as EFI_SUCEESS. To address the checkpatch warning of too many leading tabs, combine two if statement into one. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
ce327084 |
|
18-Dec-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: carve out efi_get_next_variable_name_int calls To retrieve the EFI variable name by efi_get_next_variable_name_int(), the sequence of alloc -> efi_get_next_variable_name_int -> realloc -> efi_get_next_variable_name_int is required. In current code, this sequence repeatedly appears in the several functions. It should be curved out a common function. This commit also fixes the missing free() of var_name16 in eficonfig_delete_invalid_boot_option(). Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
140a8959 |
|
01-Dec-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: use efi_get_next_variable_name_int() eficonfig command reads all possible UEFI load options from 0x0000 to 0xFFFF to construct the menu. This takes too much time in some environment. This commit uses efi_get_next_variable_name_int() to read all existing UEFI load options to significantlly reduce the count of efi_get_var() call. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
78b1ccc4 |
|
01-Dec-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: use u16_strsize() to get u16 string buffer size Use u16_strsize() to simplify the u16 string buffer size calculation. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c67d3c9e |
|
01-Dec-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: fix going one directory up issue The directory name in eficonfig menu entry contains the '\' separator. strcmp() argument ".." is wrong and one directory up handling does not work correctly. strcmp() argument must include '\' separator. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c3b5af63 |
|
19-Nov-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: add UEFI Secure Boot Key enrollment interface This commit adds the menu-driven UEFI Secure Boot Key enrollment interface. User can enroll PK, KEK, db and dbx by selecting file. Only the signed EFI Signature List(s) with an authenticated header, typically '.auth' file, is accepted. To clear the PK, KEK, db and dbx, user needs to enroll the null key signed by PK or KEK. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
21faf4ef |
|
19-Nov-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: use protocol interface for file selection EFI_SIMPLE_FILE_SYSTEM_PROTOCOL is not always provided by U-Boot. Use protocol interface functions instead of U-Boot internal functions. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d6566113 |
|
19-Nov-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: expose eficonfig_create_device_path() Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use eficonfig_create_device_path() to construct the full device path from device path of the volume and file path, so move it out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d571f9b2 |
|
19-Nov-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: refactor change boot order implementation All the eficonfig menus other than "Change Boot Order" use 'eficonfig_entry' structure for each menu entry. This commit refactors change boot order implementation to use 'eficonfig_entry' structure same as other menus to have consistent menu handling. This commit also simplifies the data->active handling when KEY_SPACE is pressed, and sizeof() parameter. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
8961e93e |
|
19-Nov-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: expose append entry function Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use append_entry() and append_quit_entry() to construct the menu, so move them out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
a84040ab |
|
19-Nov-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: refactor file selection handling eficonfig_select_file_handler() is commonly used to select the file. eficonfig_display_select_file_option() adds an additional menu to clear the selected file. eficonfig_display_select_file_option() is not always necessary for the file selection process, so it must be outside of eficonfig_select_file_handler(). This commit also renames the following functions to avoid confusion. eficonfig_select_file_handler() -> eficonfig_process_select_file() eficonfig_select_file() -> eficonfig_show_file_selection() eficonfig_display_select_file_option() -> eficonfig_process_show_file_option() Finally, test_eficonfig.py need to be updated to get aligned with the above modification. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
1167e88a |
|
14-Nov-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: fix missing variable initialization The 'ret' variable must be initialized before use in eficonfig_delete_invalid_boot_option(). Fixes: c416f1c0bc ("bootmenu: add removable media entries") Addresses-Coverity: 376207 ("Uninitialized variables") Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
3d595ac5 |
|
09-Nov-2022 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: remove superfluous if in eficonfig_edit_boot_option Goto for an immediately succeeding label is superfluous. Fixes: 87d791423ac6 ("eficonfig: menu-driven addition of UEFI boot option") Addresses-Coverity: 376202 ("Identical code for different branches") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
f19171c9 |
|
08-Jan-2024 |
Ilias Apalodimas <ilias.apalodimas@linaro.org> |
efi_loader: Clean up efi_dp_append and efi_dp_concat Looking back at the initrd storing functionality, we introduced three functions, efi_dp_append_or_concatenate(), efi_dp_append/concat(). In hindsight we could have simplified that by a lot. First of all none of the functions append anything. They all allocate a new device path and concatenate the contents of two device paths in one. A boolean parameter controls the final device path -- if that's true an end node is injected between the two device paths. So let's rewrite this and make it a bit easier to read. Get rid of efi_dp_append(), efi_dp_concat() and rename efi_dp_append_or_concatenate() to efi_dp_concat(). This is far more intuitive and the only adjustment that is needed is an extra boolean argument on all callsites. Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
64658007 |
|
17-Nov-2023 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: eficonfig: create shortened boot options The boot options created by eficonfig should use shortened device-paths to avoid problems if drives are enumerated in a different sequence. Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
9945bc4f |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Fix incorrect return code of boot option update Correct the return code for out-of-memory and no boot option found Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
339b527b |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Move bootorder and bootoption apis to lib Rename and move bootorder and bootoption apis from cmd to lib for re-use between eficonfig and bootmgr Fix 'unexpected indentation' when 'make htmldocs' after functions are moved Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
2c0b0c31 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_SECURE_BOOT This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_SECURE_BOOT defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
83f3d121 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_MM_COMM_TEE This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_MM_COMM_TEE defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
88df3634 |
|
02-Feb-2023 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: CTRL+S to save the boot order 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>
|
#
45f5319f |
|
02-Feb-2023 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
menu: remove CTRL+C to quit On the sandbox called without "--terminal raw" CTRL+C leaves U-Boot, "ESC/CTRL+C to quit" is misleading. Let's remove CTRL+C to quit key handling from bootmenu and eficonfig menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
|
#
8dbd0a0f |
|
23-Jan-2023 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: add vertical scroll support The current eficonfig menu does not support vertical scroll, so it can not display the menu entries greater than the console row size. This commit add the vertial scroll support. The console size is retrieved by SIMPLE_TEXT_OUTPUT_PROTOCOL.QueryMode() service, then calculates the row size for menu entry by subtracting menu header and description row size from the console row size. "start" and "end" are added in the efimenu structure. "start" keeps the menu entry index at the top, "end" keeps the bottom menu entry index. item_data_print() menu function only draws the menu entry between "start" and "end". This commit also fixes the issue that "Save" and "Quit" entries can be moved by BKEY_PLUS in change boot order menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
0d590852 |
|
23-Jan-2023 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: refactor change boot order implementation This commit removes the change boot order specific menu implementation. The change boot order implementation calls eficonfig_process_common() same as other menus. The change boot order menu requires own item_data_print and item_choice implementation, but display_statusline function can be a same function as other menus. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
cd160b27 |
|
23-Jan-2023 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: refactor eficonfig_process_common function Current change boot order implementation does not call eficonfig_process_common() and call own menu functions for display_statusline, item_data_print and item_choice. Change boot order functionality should call eficonfig_process_common() to improve maintenanceability. This commit is a preparation to remove the change boot order specific implementation. The menu functions (display_statusline, item_data_print and item_choice) are added as argument of eficonfig_process_common(). The menu description string displayed at the bottom of the menu is also added as argument. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
32bab0ea |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Make use of CLI character processing Avoid duplicating some of the escape-sequence processing here and use the CLI function instead. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
d0ca98db |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Update bootmenu_loop() to return the code Use the return value to save having to pass around a pointer. This also resolves any ambiguity about what *key contains when the function is called. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
2da4a15e |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Rename KEY_... to BKEY_... This enum values conflict with linux/input.h so rename them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
64550274 |
|
18-Dec-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: avoid SetVariable between GetNextVariableName calls The current code calls efi_set_variable_int() to delete the invalid boot option between calls to efi_get_next_variable_name_int(), it may produce unpredictable results. This commit moves removal of the invalid boot option outside of the efi_get_next_variable_name_int() calls. EFI_NOT_FOUND returned from efi_get_next_variable_name_int() indicates we retrieved all EFI variables, it should be treated as EFI_SUCEESS. To address the checkpatch warning of too many leading tabs, combine two if statement into one. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
ce327084 |
|
18-Dec-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: carve out efi_get_next_variable_name_int calls To retrieve the EFI variable name by efi_get_next_variable_name_int(), the sequence of alloc -> efi_get_next_variable_name_int -> realloc -> efi_get_next_variable_name_int is required. In current code, this sequence repeatedly appears in the several functions. It should be curved out a common function. This commit also fixes the missing free() of var_name16 in eficonfig_delete_invalid_boot_option(). Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
140a8959 |
|
01-Dec-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: use efi_get_next_variable_name_int() eficonfig command reads all possible UEFI load options from 0x0000 to 0xFFFF to construct the menu. This takes too much time in some environment. This commit uses efi_get_next_variable_name_int() to read all existing UEFI load options to significantlly reduce the count of efi_get_var() call. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
78b1ccc4 |
|
01-Dec-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: use u16_strsize() to get u16 string buffer size Use u16_strsize() to simplify the u16 string buffer size calculation. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c67d3c9e |
|
01-Dec-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: fix going one directory up issue The directory name in eficonfig menu entry contains the '\' separator. strcmp() argument ".." is wrong and one directory up handling does not work correctly. strcmp() argument must include '\' separator. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c3b5af63 |
|
19-Nov-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: add UEFI Secure Boot Key enrollment interface This commit adds the menu-driven UEFI Secure Boot Key enrollment interface. User can enroll PK, KEK, db and dbx by selecting file. Only the signed EFI Signature List(s) with an authenticated header, typically '.auth' file, is accepted. To clear the PK, KEK, db and dbx, user needs to enroll the null key signed by PK or KEK. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
21faf4ef |
|
19-Nov-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: use protocol interface for file selection EFI_SIMPLE_FILE_SYSTEM_PROTOCOL is not always provided by U-Boot. Use protocol interface functions instead of U-Boot internal functions. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d6566113 |
|
19-Nov-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: expose eficonfig_create_device_path() Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use eficonfig_create_device_path() to construct the full device path from device path of the volume and file path, so move it out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d571f9b2 |
|
19-Nov-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: refactor change boot order implementation All the eficonfig menus other than "Change Boot Order" use 'eficonfig_entry' structure for each menu entry. This commit refactors change boot order implementation to use 'eficonfig_entry' structure same as other menus to have consistent menu handling. This commit also simplifies the data->active handling when KEY_SPACE is pressed, and sizeof() parameter. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
8961e93e |
|
19-Nov-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: expose append entry function Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use append_entry() and append_quit_entry() to construct the menu, so move them out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
a84040ab |
|
19-Nov-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: refactor file selection handling eficonfig_select_file_handler() is commonly used to select the file. eficonfig_display_select_file_option() adds an additional menu to clear the selected file. eficonfig_display_select_file_option() is not always necessary for the file selection process, so it must be outside of eficonfig_select_file_handler(). This commit also renames the following functions to avoid confusion. eficonfig_select_file_handler() -> eficonfig_process_select_file() eficonfig_select_file() -> eficonfig_show_file_selection() eficonfig_display_select_file_option() -> eficonfig_process_show_file_option() Finally, test_eficonfig.py need to be updated to get aligned with the above modification. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
1167e88a |
|
14-Nov-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: fix missing variable initialization The 'ret' variable must be initialized before use in eficonfig_delete_invalid_boot_option(). Fixes: c416f1c0bc ("bootmenu: add removable media entries") Addresses-Coverity: 376207 ("Uninitialized variables") Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
3d595ac5 |
|
09-Nov-2022 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: remove superfluous if in eficonfig_edit_boot_option Goto for an immediately succeeding label is superfluous. Fixes: 87d791423ac6 ("eficonfig: menu-driven addition of UEFI boot option") Addresses-Coverity: 376202 ("Identical code for different branches") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
f19171c9 |
|
08-Jan-2024 |
Ilias Apalodimas <ilias.apalodimas@linaro.org> |
efi_loader: Clean up efi_dp_append and efi_dp_concat Looking back at the initrd storing functionality, we introduced three functions, efi_dp_append_or_concatenate(), efi_dp_append/concat(). In hindsight we could have simplified that by a lot. First of all none of the functions append anything. They all allocate a new device path and concatenate the contents of two device paths in one. A boolean parameter controls the final device path -- if that's true an end node is injected between the two device paths. So let's rewrite this and make it a bit easier to read. Get rid of efi_dp_append(), efi_dp_concat() and rename efi_dp_append_or_concatenate() to efi_dp_concat(). This is far more intuitive and the only adjustment that is needed is an extra boolean argument on all callsites. Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
64658007 |
|
17-Nov-2023 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: eficonfig: create shortened boot options The boot options created by eficonfig should use shortened device-paths to avoid problems if drives are enumerated in a different sequence. Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
9945bc4f |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Fix incorrect return code of boot option update Correct the return code for out-of-memory and no boot option found Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
339b527b |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Move bootorder and bootoption apis to lib Rename and move bootorder and bootoption apis from cmd to lib for re-use between eficonfig and bootmgr Fix 'unexpected indentation' when 'make htmldocs' after functions are moved Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
2c0b0c31 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_SECURE_BOOT This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_SECURE_BOOT defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
83f3d121 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_MM_COMM_TEE This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_MM_COMM_TEE defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
88df3634 |
|
02-Feb-2023 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: CTRL+S to save the boot order 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>
|
#
45f5319f |
|
02-Feb-2023 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
menu: remove CTRL+C to quit On the sandbox called without "--terminal raw" CTRL+C leaves U-Boot, "ESC/CTRL+C to quit" is misleading. Let's remove CTRL+C to quit key handling from bootmenu and eficonfig menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
|
#
8dbd0a0f |
|
23-Jan-2023 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: add vertical scroll support The current eficonfig menu does not support vertical scroll, so it can not display the menu entries greater than the console row size. This commit add the vertial scroll support. The console size is retrieved by SIMPLE_TEXT_OUTPUT_PROTOCOL.QueryMode() service, then calculates the row size for menu entry by subtracting menu header and description row size from the console row size. "start" and "end" are added in the efimenu structure. "start" keeps the menu entry index at the top, "end" keeps the bottom menu entry index. item_data_print() menu function only draws the menu entry between "start" and "end". This commit also fixes the issue that "Save" and "Quit" entries can be moved by BKEY_PLUS in change boot order menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
0d590852 |
|
23-Jan-2023 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: refactor change boot order implementation This commit removes the change boot order specific menu implementation. The change boot order implementation calls eficonfig_process_common() same as other menus. The change boot order menu requires own item_data_print and item_choice implementation, but display_statusline function can be a same function as other menus. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
cd160b27 |
|
23-Jan-2023 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: refactor eficonfig_process_common function Current change boot order implementation does not call eficonfig_process_common() and call own menu functions for display_statusline, item_data_print and item_choice. Change boot order functionality should call eficonfig_process_common() to improve maintenanceability. This commit is a preparation to remove the change boot order specific implementation. The menu functions (display_statusline, item_data_print and item_choice) are added as argument of eficonfig_process_common(). The menu description string displayed at the bottom of the menu is also added as argument. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
32bab0ea |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Make use of CLI character processing Avoid duplicating some of the escape-sequence processing here and use the CLI function instead. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
d0ca98db |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Update bootmenu_loop() to return the code Use the return value to save having to pass around a pointer. This also resolves any ambiguity about what *key contains when the function is called. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
2da4a15e |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Rename KEY_... to BKEY_... This enum values conflict with linux/input.h so rename them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
64550274 |
|
18-Dec-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: avoid SetVariable between GetNextVariableName calls The current code calls efi_set_variable_int() to delete the invalid boot option between calls to efi_get_next_variable_name_int(), it may produce unpredictable results. This commit moves removal of the invalid boot option outside of the efi_get_next_variable_name_int() calls. EFI_NOT_FOUND returned from efi_get_next_variable_name_int() indicates we retrieved all EFI variables, it should be treated as EFI_SUCEESS. To address the checkpatch warning of too many leading tabs, combine two if statement into one. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
ce327084 |
|
18-Dec-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: carve out efi_get_next_variable_name_int calls To retrieve the EFI variable name by efi_get_next_variable_name_int(), the sequence of alloc -> efi_get_next_variable_name_int -> realloc -> efi_get_next_variable_name_int is required. In current code, this sequence repeatedly appears in the several functions. It should be curved out a common function. This commit also fixes the missing free() of var_name16 in eficonfig_delete_invalid_boot_option(). Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
140a8959 |
|
01-Dec-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: use efi_get_next_variable_name_int() eficonfig command reads all possible UEFI load options from 0x0000 to 0xFFFF to construct the menu. This takes too much time in some environment. This commit uses efi_get_next_variable_name_int() to read all existing UEFI load options to significantlly reduce the count of efi_get_var() call. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
78b1ccc4 |
|
01-Dec-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: use u16_strsize() to get u16 string buffer size Use u16_strsize() to simplify the u16 string buffer size calculation. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c67d3c9e |
|
01-Dec-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: fix going one directory up issue The directory name in eficonfig menu entry contains the '\' separator. strcmp() argument ".." is wrong and one directory up handling does not work correctly. strcmp() argument must include '\' separator. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c3b5af63 |
|
19-Nov-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: add UEFI Secure Boot Key enrollment interface This commit adds the menu-driven UEFI Secure Boot Key enrollment interface. User can enroll PK, KEK, db and dbx by selecting file. Only the signed EFI Signature List(s) with an authenticated header, typically '.auth' file, is accepted. To clear the PK, KEK, db and dbx, user needs to enroll the null key signed by PK or KEK. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
21faf4ef |
|
19-Nov-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: use protocol interface for file selection EFI_SIMPLE_FILE_SYSTEM_PROTOCOL is not always provided by U-Boot. Use protocol interface functions instead of U-Boot internal functions. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d6566113 |
|
19-Nov-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: expose eficonfig_create_device_path() Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use eficonfig_create_device_path() to construct the full device path from device path of the volume and file path, so move it out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d571f9b2 |
|
19-Nov-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: refactor change boot order implementation All the eficonfig menus other than "Change Boot Order" use 'eficonfig_entry' structure for each menu entry. This commit refactors change boot order implementation to use 'eficonfig_entry' structure same as other menus to have consistent menu handling. This commit also simplifies the data->active handling when KEY_SPACE is pressed, and sizeof() parameter. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
8961e93e |
|
19-Nov-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: expose append entry function Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use append_entry() and append_quit_entry() to construct the menu, so move them out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
a84040ab |
|
19-Nov-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: refactor file selection handling eficonfig_select_file_handler() is commonly used to select the file. eficonfig_display_select_file_option() adds an additional menu to clear the selected file. eficonfig_display_select_file_option() is not always necessary for the file selection process, so it must be outside of eficonfig_select_file_handler(). This commit also renames the following functions to avoid confusion. eficonfig_select_file_handler() -> eficonfig_process_select_file() eficonfig_select_file() -> eficonfig_show_file_selection() eficonfig_display_select_file_option() -> eficonfig_process_show_file_option() Finally, test_eficonfig.py need to be updated to get aligned with the above modification. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
1167e88a |
|
14-Nov-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: fix missing variable initialization The 'ret' variable must be initialized before use in eficonfig_delete_invalid_boot_option(). Fixes: c416f1c0bc ("bootmenu: add removable media entries") Addresses-Coverity: 376207 ("Uninitialized variables") Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
3d595ac5 |
|
09-Nov-2022 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: remove superfluous if in eficonfig_edit_boot_option Goto for an immediately succeeding label is superfluous. Fixes: 87d791423ac6 ("eficonfig: menu-driven addition of UEFI boot option") Addresses-Coverity: 376202 ("Identical code for different branches") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
f19171c9 |
|
08-Jan-2024 |
Ilias Apalodimas <ilias.apalodimas@linaro.org> |
efi_loader: Clean up efi_dp_append and efi_dp_concat Looking back at the initrd storing functionality, we introduced three functions, efi_dp_append_or_concatenate(), efi_dp_append/concat(). In hindsight we could have simplified that by a lot. First of all none of the functions append anything. They all allocate a new device path and concatenate the contents of two device paths in one. A boolean parameter controls the final device path -- if that's true an end node is injected between the two device paths. So let's rewrite this and make it a bit easier to read. Get rid of efi_dp_append(), efi_dp_concat() and rename efi_dp_append_or_concatenate() to efi_dp_concat(). This is far more intuitive and the only adjustment that is needed is an extra boolean argument on all callsites. Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
64658007 |
|
17-Nov-2023 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: eficonfig: create shortened boot options The boot options created by eficonfig should use shortened device-paths to avoid problems if drives are enumerated in a different sequence. Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
9945bc4f |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Fix incorrect return code of boot option update Correct the return code for out-of-memory and no boot option found Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
339b527b |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Move bootorder and bootoption apis to lib Rename and move bootorder and bootoption apis from cmd to lib for re-use between eficonfig and bootmgr Fix 'unexpected indentation' when 'make htmldocs' after functions are moved Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
2c0b0c31 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_SECURE_BOOT This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_SECURE_BOOT defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
83f3d121 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_MM_COMM_TEE This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_MM_COMM_TEE defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
88df3634 |
|
02-Feb-2023 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: CTRL+S to save the boot order 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>
|
#
45f5319f |
|
02-Feb-2023 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
menu: remove CTRL+C to quit On the sandbox called without "--terminal raw" CTRL+C leaves U-Boot, "ESC/CTRL+C to quit" is misleading. Let's remove CTRL+C to quit key handling from bootmenu and eficonfig menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
|
#
8dbd0a0f |
|
23-Jan-2023 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: add vertical scroll support The current eficonfig menu does not support vertical scroll, so it can not display the menu entries greater than the console row size. This commit add the vertial scroll support. The console size is retrieved by SIMPLE_TEXT_OUTPUT_PROTOCOL.QueryMode() service, then calculates the row size for menu entry by subtracting menu header and description row size from the console row size. "start" and "end" are added in the efimenu structure. "start" keeps the menu entry index at the top, "end" keeps the bottom menu entry index. item_data_print() menu function only draws the menu entry between "start" and "end". This commit also fixes the issue that "Save" and "Quit" entries can be moved by BKEY_PLUS in change boot order menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
0d590852 |
|
23-Jan-2023 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: refactor change boot order implementation This commit removes the change boot order specific menu implementation. The change boot order implementation calls eficonfig_process_common() same as other menus. The change boot order menu requires own item_data_print and item_choice implementation, but display_statusline function can be a same function as other menus. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
cd160b27 |
|
23-Jan-2023 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: refactor eficonfig_process_common function Current change boot order implementation does not call eficonfig_process_common() and call own menu functions for display_statusline, item_data_print and item_choice. Change boot order functionality should call eficonfig_process_common() to improve maintenanceability. This commit is a preparation to remove the change boot order specific implementation. The menu functions (display_statusline, item_data_print and item_choice) are added as argument of eficonfig_process_common(). The menu description string displayed at the bottom of the menu is also added as argument. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
32bab0ea |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Make use of CLI character processing Avoid duplicating some of the escape-sequence processing here and use the CLI function instead. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
d0ca98db |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Update bootmenu_loop() to return the code Use the return value to save having to pass around a pointer. This also resolves any ambiguity about what *key contains when the function is called. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
2da4a15e |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Rename KEY_... to BKEY_... This enum values conflict with linux/input.h so rename them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
64550274 |
|
18-Dec-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: avoid SetVariable between GetNextVariableName calls The current code calls efi_set_variable_int() to delete the invalid boot option between calls to efi_get_next_variable_name_int(), it may produce unpredictable results. This commit moves removal of the invalid boot option outside of the efi_get_next_variable_name_int() calls. EFI_NOT_FOUND returned from efi_get_next_variable_name_int() indicates we retrieved all EFI variables, it should be treated as EFI_SUCEESS. To address the checkpatch warning of too many leading tabs, combine two if statement into one. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
ce327084 |
|
18-Dec-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: carve out efi_get_next_variable_name_int calls To retrieve the EFI variable name by efi_get_next_variable_name_int(), the sequence of alloc -> efi_get_next_variable_name_int -> realloc -> efi_get_next_variable_name_int is required. In current code, this sequence repeatedly appears in the several functions. It should be curved out a common function. This commit also fixes the missing free() of var_name16 in eficonfig_delete_invalid_boot_option(). Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
140a8959 |
|
01-Dec-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: use efi_get_next_variable_name_int() eficonfig command reads all possible UEFI load options from 0x0000 to 0xFFFF to construct the menu. This takes too much time in some environment. This commit uses efi_get_next_variable_name_int() to read all existing UEFI load options to significantlly reduce the count of efi_get_var() call. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
78b1ccc4 |
|
01-Dec-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: use u16_strsize() to get u16 string buffer size Use u16_strsize() to simplify the u16 string buffer size calculation. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c67d3c9e |
|
01-Dec-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: fix going one directory up issue The directory name in eficonfig menu entry contains the '\' separator. strcmp() argument ".." is wrong and one directory up handling does not work correctly. strcmp() argument must include '\' separator. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c3b5af63 |
|
19-Nov-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: add UEFI Secure Boot Key enrollment interface This commit adds the menu-driven UEFI Secure Boot Key enrollment interface. User can enroll PK, KEK, db and dbx by selecting file. Only the signed EFI Signature List(s) with an authenticated header, typically '.auth' file, is accepted. To clear the PK, KEK, db and dbx, user needs to enroll the null key signed by PK or KEK. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
21faf4ef |
|
19-Nov-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: use protocol interface for file selection EFI_SIMPLE_FILE_SYSTEM_PROTOCOL is not always provided by U-Boot. Use protocol interface functions instead of U-Boot internal functions. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d6566113 |
|
19-Nov-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: expose eficonfig_create_device_path() Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use eficonfig_create_device_path() to construct the full device path from device path of the volume and file path, so move it out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d571f9b2 |
|
19-Nov-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: refactor change boot order implementation All the eficonfig menus other than "Change Boot Order" use 'eficonfig_entry' structure for each menu entry. This commit refactors change boot order implementation to use 'eficonfig_entry' structure same as other menus to have consistent menu handling. This commit also simplifies the data->active handling when KEY_SPACE is pressed, and sizeof() parameter. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
8961e93e |
|
19-Nov-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: expose append entry function Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use append_entry() and append_quit_entry() to construct the menu, so move them out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
a84040ab |
|
19-Nov-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: refactor file selection handling eficonfig_select_file_handler() is commonly used to select the file. eficonfig_display_select_file_option() adds an additional menu to clear the selected file. eficonfig_display_select_file_option() is not always necessary for the file selection process, so it must be outside of eficonfig_select_file_handler(). This commit also renames the following functions to avoid confusion. eficonfig_select_file_handler() -> eficonfig_process_select_file() eficonfig_select_file() -> eficonfig_show_file_selection() eficonfig_display_select_file_option() -> eficonfig_process_show_file_option() Finally, test_eficonfig.py need to be updated to get aligned with the above modification. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
1167e88a |
|
14-Nov-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: fix missing variable initialization The 'ret' variable must be initialized before use in eficonfig_delete_invalid_boot_option(). Fixes: c416f1c0bc ("bootmenu: add removable media entries") Addresses-Coverity: 376207 ("Uninitialized variables") Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
3d595ac5 |
|
09-Nov-2022 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: remove superfluous if in eficonfig_edit_boot_option Goto for an immediately succeeding label is superfluous. Fixes: 87d791423ac6 ("eficonfig: menu-driven addition of UEFI boot option") Addresses-Coverity: 376202 ("Identical code for different branches") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
f19171c9 |
|
08-Jan-2024 |
Ilias Apalodimas <ilias.apalodimas@linaro.org> |
efi_loader: Clean up efi_dp_append and efi_dp_concat Looking back at the initrd storing functionality, we introduced three functions, efi_dp_append_or_concatenate(), efi_dp_append/concat(). In hindsight we could have simplified that by a lot. First of all none of the functions append anything. They all allocate a new device path and concatenate the contents of two device paths in one. A boolean parameter controls the final device path -- if that's true an end node is injected between the two device paths. So let's rewrite this and make it a bit easier to read. Get rid of efi_dp_append(), efi_dp_concat() and rename efi_dp_append_or_concatenate() to efi_dp_concat(). This is far more intuitive and the only adjustment that is needed is an extra boolean argument on all callsites. Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
64658007 |
|
17-Nov-2023 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: eficonfig: create shortened boot options The boot options created by eficonfig should use shortened device-paths to avoid problems if drives are enumerated in a different sequence. Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
9945bc4f |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Fix incorrect return code of boot option update Correct the return code for out-of-memory and no boot option found Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
339b527b |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Move bootorder and bootoption apis to lib Rename and move bootorder and bootoption apis from cmd to lib for re-use between eficonfig and bootmgr Fix 'unexpected indentation' when 'make htmldocs' after functions are moved Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
2c0b0c31 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_SECURE_BOOT This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_SECURE_BOOT defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
83f3d121 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_MM_COMM_TEE This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_MM_COMM_TEE defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
88df3634 |
|
02-Feb-2023 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: CTRL+S to save the boot order 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>
|
#
45f5319f |
|
02-Feb-2023 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
menu: remove CTRL+C to quit On the sandbox called without "--terminal raw" CTRL+C leaves U-Boot, "ESC/CTRL+C to quit" is misleading. Let's remove CTRL+C to quit key handling from bootmenu and eficonfig menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
|
#
8dbd0a0f |
|
23-Jan-2023 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: add vertical scroll support The current eficonfig menu does not support vertical scroll, so it can not display the menu entries greater than the console row size. This commit add the vertial scroll support. The console size is retrieved by SIMPLE_TEXT_OUTPUT_PROTOCOL.QueryMode() service, then calculates the row size for menu entry by subtracting menu header and description row size from the console row size. "start" and "end" are added in the efimenu structure. "start" keeps the menu entry index at the top, "end" keeps the bottom menu entry index. item_data_print() menu function only draws the menu entry between "start" and "end". This commit also fixes the issue that "Save" and "Quit" entries can be moved by BKEY_PLUS in change boot order menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
0d590852 |
|
23-Jan-2023 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: refactor change boot order implementation This commit removes the change boot order specific menu implementation. The change boot order implementation calls eficonfig_process_common() same as other menus. The change boot order menu requires own item_data_print and item_choice implementation, but display_statusline function can be a same function as other menus. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
cd160b27 |
|
23-Jan-2023 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: refactor eficonfig_process_common function Current change boot order implementation does not call eficonfig_process_common() and call own menu functions for display_statusline, item_data_print and item_choice. Change boot order functionality should call eficonfig_process_common() to improve maintenanceability. This commit is a preparation to remove the change boot order specific implementation. The menu functions (display_statusline, item_data_print and item_choice) are added as argument of eficonfig_process_common(). The menu description string displayed at the bottom of the menu is also added as argument. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
32bab0ea |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Make use of CLI character processing Avoid duplicating some of the escape-sequence processing here and use the CLI function instead. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
d0ca98db |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Update bootmenu_loop() to return the code Use the return value to save having to pass around a pointer. This also resolves any ambiguity about what *key contains when the function is called. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
2da4a15e |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Rename KEY_... to BKEY_... This enum values conflict with linux/input.h so rename them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
64550274 |
|
18-Dec-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: avoid SetVariable between GetNextVariableName calls The current code calls efi_set_variable_int() to delete the invalid boot option between calls to efi_get_next_variable_name_int(), it may produce unpredictable results. This commit moves removal of the invalid boot option outside of the efi_get_next_variable_name_int() calls. EFI_NOT_FOUND returned from efi_get_next_variable_name_int() indicates we retrieved all EFI variables, it should be treated as EFI_SUCEESS. To address the checkpatch warning of too many leading tabs, combine two if statement into one. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
ce327084 |
|
18-Dec-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: carve out efi_get_next_variable_name_int calls To retrieve the EFI variable name by efi_get_next_variable_name_int(), the sequence of alloc -> efi_get_next_variable_name_int -> realloc -> efi_get_next_variable_name_int is required. In current code, this sequence repeatedly appears in the several functions. It should be curved out a common function. This commit also fixes the missing free() of var_name16 in eficonfig_delete_invalid_boot_option(). Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
140a8959 |
|
01-Dec-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: use efi_get_next_variable_name_int() eficonfig command reads all possible UEFI load options from 0x0000 to 0xFFFF to construct the menu. This takes too much time in some environment. This commit uses efi_get_next_variable_name_int() to read all existing UEFI load options to significantlly reduce the count of efi_get_var() call. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
78b1ccc4 |
|
01-Dec-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: use u16_strsize() to get u16 string buffer size Use u16_strsize() to simplify the u16 string buffer size calculation. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c67d3c9e |
|
01-Dec-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: fix going one directory up issue The directory name in eficonfig menu entry contains the '\' separator. strcmp() argument ".." is wrong and one directory up handling does not work correctly. strcmp() argument must include '\' separator. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c3b5af63 |
|
19-Nov-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: add UEFI Secure Boot Key enrollment interface This commit adds the menu-driven UEFI Secure Boot Key enrollment interface. User can enroll PK, KEK, db and dbx by selecting file. Only the signed EFI Signature List(s) with an authenticated header, typically '.auth' file, is accepted. To clear the PK, KEK, db and dbx, user needs to enroll the null key signed by PK or KEK. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
21faf4ef |
|
19-Nov-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: use protocol interface for file selection EFI_SIMPLE_FILE_SYSTEM_PROTOCOL is not always provided by U-Boot. Use protocol interface functions instead of U-Boot internal functions. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d6566113 |
|
19-Nov-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: expose eficonfig_create_device_path() Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use eficonfig_create_device_path() to construct the full device path from device path of the volume and file path, so move it out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d571f9b2 |
|
19-Nov-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: refactor change boot order implementation All the eficonfig menus other than "Change Boot Order" use 'eficonfig_entry' structure for each menu entry. This commit refactors change boot order implementation to use 'eficonfig_entry' structure same as other menus to have consistent menu handling. This commit also simplifies the data->active handling when KEY_SPACE is pressed, and sizeof() parameter. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
8961e93e |
|
19-Nov-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: expose append entry function Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use append_entry() and append_quit_entry() to construct the menu, so move them out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
a84040ab |
|
19-Nov-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: refactor file selection handling eficonfig_select_file_handler() is commonly used to select the file. eficonfig_display_select_file_option() adds an additional menu to clear the selected file. eficonfig_display_select_file_option() is not always necessary for the file selection process, so it must be outside of eficonfig_select_file_handler(). This commit also renames the following functions to avoid confusion. eficonfig_select_file_handler() -> eficonfig_process_select_file() eficonfig_select_file() -> eficonfig_show_file_selection() eficonfig_display_select_file_option() -> eficonfig_process_show_file_option() Finally, test_eficonfig.py need to be updated to get aligned with the above modification. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
1167e88a |
|
14-Nov-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: fix missing variable initialization The 'ret' variable must be initialized before use in eficonfig_delete_invalid_boot_option(). Fixes: c416f1c0bc ("bootmenu: add removable media entries") Addresses-Coverity: 376207 ("Uninitialized variables") Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
3d595ac5 |
|
09-Nov-2022 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: remove superfluous if in eficonfig_edit_boot_option Goto for an immediately succeeding label is superfluous. Fixes: 87d791423ac6 ("eficonfig: menu-driven addition of UEFI boot option") Addresses-Coverity: 376202 ("Identical code for different branches") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
f19171c9 |
|
08-Jan-2024 |
Ilias Apalodimas <ilias.apalodimas@linaro.org> |
efi_loader: Clean up efi_dp_append and efi_dp_concat Looking back at the initrd storing functionality, we introduced three functions, efi_dp_append_or_concatenate(), efi_dp_append/concat(). In hindsight we could have simplified that by a lot. First of all none of the functions append anything. They all allocate a new device path and concatenate the contents of two device paths in one. A boolean parameter controls the final device path -- if that's true an end node is injected between the two device paths. So let's rewrite this and make it a bit easier to read. Get rid of efi_dp_append(), efi_dp_concat() and rename efi_dp_append_or_concatenate() to efi_dp_concat(). This is far more intuitive and the only adjustment that is needed is an extra boolean argument on all callsites. Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
64658007 |
|
17-Nov-2023 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: eficonfig: create shortened boot options The boot options created by eficonfig should use shortened device-paths to avoid problems if drives are enumerated in a different sequence. Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
9945bc4f |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Fix incorrect return code of boot option update Correct the return code for out-of-memory and no boot option found Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
339b527b |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Move bootorder and bootoption apis to lib Rename and move bootorder and bootoption apis from cmd to lib for re-use between eficonfig and bootmgr Fix 'unexpected indentation' when 'make htmldocs' after functions are moved Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
2c0b0c31 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_SECURE_BOOT This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_SECURE_BOOT defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
83f3d121 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_MM_COMM_TEE This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_MM_COMM_TEE defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
88df3634 |
|
02-Feb-2023 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: CTRL+S to save the boot order 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>
|
#
45f5319f |
|
02-Feb-2023 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
menu: remove CTRL+C to quit On the sandbox called without "--terminal raw" CTRL+C leaves U-Boot, "ESC/CTRL+C to quit" is misleading. Let's remove CTRL+C to quit key handling from bootmenu and eficonfig menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
|
#
8dbd0a0f |
|
23-Jan-2023 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: add vertical scroll support The current eficonfig menu does not support vertical scroll, so it can not display the menu entries greater than the console row size. This commit add the vertial scroll support. The console size is retrieved by SIMPLE_TEXT_OUTPUT_PROTOCOL.QueryMode() service, then calculates the row size for menu entry by subtracting menu header and description row size from the console row size. "start" and "end" are added in the efimenu structure. "start" keeps the menu entry index at the top, "end" keeps the bottom menu entry index. item_data_print() menu function only draws the menu entry between "start" and "end". This commit also fixes the issue that "Save" and "Quit" entries can be moved by BKEY_PLUS in change boot order menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
0d590852 |
|
23-Jan-2023 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: refactor change boot order implementation This commit removes the change boot order specific menu implementation. The change boot order implementation calls eficonfig_process_common() same as other menus. The change boot order menu requires own item_data_print and item_choice implementation, but display_statusline function can be a same function as other menus. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
cd160b27 |
|
23-Jan-2023 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: refactor eficonfig_process_common function Current change boot order implementation does not call eficonfig_process_common() and call own menu functions for display_statusline, item_data_print and item_choice. Change boot order functionality should call eficonfig_process_common() to improve maintenanceability. This commit is a preparation to remove the change boot order specific implementation. The menu functions (display_statusline, item_data_print and item_choice) are added as argument of eficonfig_process_common(). The menu description string displayed at the bottom of the menu is also added as argument. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
32bab0ea |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Make use of CLI character processing Avoid duplicating some of the escape-sequence processing here and use the CLI function instead. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
d0ca98db |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Update bootmenu_loop() to return the code Use the return value to save having to pass around a pointer. This also resolves any ambiguity about what *key contains when the function is called. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
2da4a15e |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Rename KEY_... to BKEY_... This enum values conflict with linux/input.h so rename them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
64550274 |
|
18-Dec-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: avoid SetVariable between GetNextVariableName calls The current code calls efi_set_variable_int() to delete the invalid boot option between calls to efi_get_next_variable_name_int(), it may produce unpredictable results. This commit moves removal of the invalid boot option outside of the efi_get_next_variable_name_int() calls. EFI_NOT_FOUND returned from efi_get_next_variable_name_int() indicates we retrieved all EFI variables, it should be treated as EFI_SUCEESS. To address the checkpatch warning of too many leading tabs, combine two if statement into one. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
ce327084 |
|
18-Dec-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: carve out efi_get_next_variable_name_int calls To retrieve the EFI variable name by efi_get_next_variable_name_int(), the sequence of alloc -> efi_get_next_variable_name_int -> realloc -> efi_get_next_variable_name_int is required. In current code, this sequence repeatedly appears in the several functions. It should be curved out a common function. This commit also fixes the missing free() of var_name16 in eficonfig_delete_invalid_boot_option(). Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
140a8959 |
|
01-Dec-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: use efi_get_next_variable_name_int() eficonfig command reads all possible UEFI load options from 0x0000 to 0xFFFF to construct the menu. This takes too much time in some environment. This commit uses efi_get_next_variable_name_int() to read all existing UEFI load options to significantlly reduce the count of efi_get_var() call. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
78b1ccc4 |
|
01-Dec-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: use u16_strsize() to get u16 string buffer size Use u16_strsize() to simplify the u16 string buffer size calculation. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c67d3c9e |
|
01-Dec-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: fix going one directory up issue The directory name in eficonfig menu entry contains the '\' separator. strcmp() argument ".." is wrong and one directory up handling does not work correctly. strcmp() argument must include '\' separator. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c3b5af63 |
|
19-Nov-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: add UEFI Secure Boot Key enrollment interface This commit adds the menu-driven UEFI Secure Boot Key enrollment interface. User can enroll PK, KEK, db and dbx by selecting file. Only the signed EFI Signature List(s) with an authenticated header, typically '.auth' file, is accepted. To clear the PK, KEK, db and dbx, user needs to enroll the null key signed by PK or KEK. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
21faf4ef |
|
19-Nov-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: use protocol interface for file selection EFI_SIMPLE_FILE_SYSTEM_PROTOCOL is not always provided by U-Boot. Use protocol interface functions instead of U-Boot internal functions. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d6566113 |
|
19-Nov-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: expose eficonfig_create_device_path() Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use eficonfig_create_device_path() to construct the full device path from device path of the volume and file path, so move it out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d571f9b2 |
|
19-Nov-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: refactor change boot order implementation All the eficonfig menus other than "Change Boot Order" use 'eficonfig_entry' structure for each menu entry. This commit refactors change boot order implementation to use 'eficonfig_entry' structure same as other menus to have consistent menu handling. This commit also simplifies the data->active handling when KEY_SPACE is pressed, and sizeof() parameter. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
8961e93e |
|
19-Nov-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: expose append entry function Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use append_entry() and append_quit_entry() to construct the menu, so move them out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
a84040ab |
|
19-Nov-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: refactor file selection handling eficonfig_select_file_handler() is commonly used to select the file. eficonfig_display_select_file_option() adds an additional menu to clear the selected file. eficonfig_display_select_file_option() is not always necessary for the file selection process, so it must be outside of eficonfig_select_file_handler(). This commit also renames the following functions to avoid confusion. eficonfig_select_file_handler() -> eficonfig_process_select_file() eficonfig_select_file() -> eficonfig_show_file_selection() eficonfig_display_select_file_option() -> eficonfig_process_show_file_option() Finally, test_eficonfig.py need to be updated to get aligned with the above modification. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
1167e88a |
|
14-Nov-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: fix missing variable initialization The 'ret' variable must be initialized before use in eficonfig_delete_invalid_boot_option(). Fixes: c416f1c0bc ("bootmenu: add removable media entries") Addresses-Coverity: 376207 ("Uninitialized variables") Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
3d595ac5 |
|
09-Nov-2022 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: remove superfluous if in eficonfig_edit_boot_option Goto for an immediately succeeding label is superfluous. Fixes: 87d791423ac6 ("eficonfig: menu-driven addition of UEFI boot option") Addresses-Coverity: 376202 ("Identical code for different branches") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
f19171c9 |
|
08-Jan-2024 |
Ilias Apalodimas <ilias.apalodimas@linaro.org> |
efi_loader: Clean up efi_dp_append and efi_dp_concat Looking back at the initrd storing functionality, we introduced three functions, efi_dp_append_or_concatenate(), efi_dp_append/concat(). In hindsight we could have simplified that by a lot. First of all none of the functions append anything. They all allocate a new device path and concatenate the contents of two device paths in one. A boolean parameter controls the final device path -- if that's true an end node is injected between the two device paths. So let's rewrite this and make it a bit easier to read. Get rid of efi_dp_append(), efi_dp_concat() and rename efi_dp_append_or_concatenate() to efi_dp_concat(). This is far more intuitive and the only adjustment that is needed is an extra boolean argument on all callsites. Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
64658007 |
|
17-Nov-2023 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: eficonfig: create shortened boot options The boot options created by eficonfig should use shortened device-paths to avoid problems if drives are enumerated in a different sequence. Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
9945bc4f |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Fix incorrect return code of boot option update Correct the return code for out-of-memory and no boot option found Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
339b527b |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Move bootorder and bootoption apis to lib Rename and move bootorder and bootoption apis from cmd to lib for re-use between eficonfig and bootmgr Fix 'unexpected indentation' when 'make htmldocs' after functions are moved Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
2c0b0c31 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_SECURE_BOOT This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_SECURE_BOOT defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
83f3d121 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_MM_COMM_TEE This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_MM_COMM_TEE defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
88df3634 |
|
02-Feb-2023 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: CTRL+S to save the boot order 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>
|
#
45f5319f |
|
02-Feb-2023 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
menu: remove CTRL+C to quit On the sandbox called without "--terminal raw" CTRL+C leaves U-Boot, "ESC/CTRL+C to quit" is misleading. Let's remove CTRL+C to quit key handling from bootmenu and eficonfig menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
|
#
8dbd0a0f |
|
23-Jan-2023 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: add vertical scroll support The current eficonfig menu does not support vertical scroll, so it can not display the menu entries greater than the console row size. This commit add the vertial scroll support. The console size is retrieved by SIMPLE_TEXT_OUTPUT_PROTOCOL.QueryMode() service, then calculates the row size for menu entry by subtracting menu header and description row size from the console row size. "start" and "end" are added in the efimenu structure. "start" keeps the menu entry index at the top, "end" keeps the bottom menu entry index. item_data_print() menu function only draws the menu entry between "start" and "end". This commit also fixes the issue that "Save" and "Quit" entries can be moved by BKEY_PLUS in change boot order menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
0d590852 |
|
23-Jan-2023 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: refactor change boot order implementation This commit removes the change boot order specific menu implementation. The change boot order implementation calls eficonfig_process_common() same as other menus. The change boot order menu requires own item_data_print and item_choice implementation, but display_statusline function can be a same function as other menus. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
cd160b27 |
|
23-Jan-2023 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: refactor eficonfig_process_common function Current change boot order implementation does not call eficonfig_process_common() and call own menu functions for display_statusline, item_data_print and item_choice. Change boot order functionality should call eficonfig_process_common() to improve maintenanceability. This commit is a preparation to remove the change boot order specific implementation. The menu functions (display_statusline, item_data_print and item_choice) are added as argument of eficonfig_process_common(). The menu description string displayed at the bottom of the menu is also added as argument. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
32bab0ea |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Make use of CLI character processing Avoid duplicating some of the escape-sequence processing here and use the CLI function instead. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
d0ca98db |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Update bootmenu_loop() to return the code Use the return value to save having to pass around a pointer. This also resolves any ambiguity about what *key contains when the function is called. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
2da4a15e |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Rename KEY_... to BKEY_... This enum values conflict with linux/input.h so rename them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
64550274 |
|
18-Dec-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: avoid SetVariable between GetNextVariableName calls The current code calls efi_set_variable_int() to delete the invalid boot option between calls to efi_get_next_variable_name_int(), it may produce unpredictable results. This commit moves removal of the invalid boot option outside of the efi_get_next_variable_name_int() calls. EFI_NOT_FOUND returned from efi_get_next_variable_name_int() indicates we retrieved all EFI variables, it should be treated as EFI_SUCEESS. To address the checkpatch warning of too many leading tabs, combine two if statement into one. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
ce327084 |
|
18-Dec-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: carve out efi_get_next_variable_name_int calls To retrieve the EFI variable name by efi_get_next_variable_name_int(), the sequence of alloc -> efi_get_next_variable_name_int -> realloc -> efi_get_next_variable_name_int is required. In current code, this sequence repeatedly appears in the several functions. It should be curved out a common function. This commit also fixes the missing free() of var_name16 in eficonfig_delete_invalid_boot_option(). Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
140a8959 |
|
01-Dec-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: use efi_get_next_variable_name_int() eficonfig command reads all possible UEFI load options from 0x0000 to 0xFFFF to construct the menu. This takes too much time in some environment. This commit uses efi_get_next_variable_name_int() to read all existing UEFI load options to significantlly reduce the count of efi_get_var() call. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
78b1ccc4 |
|
01-Dec-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: use u16_strsize() to get u16 string buffer size Use u16_strsize() to simplify the u16 string buffer size calculation. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c67d3c9e |
|
01-Dec-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: fix going one directory up issue The directory name in eficonfig menu entry contains the '\' separator. strcmp() argument ".." is wrong and one directory up handling does not work correctly. strcmp() argument must include '\' separator. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c3b5af63 |
|
19-Nov-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: add UEFI Secure Boot Key enrollment interface This commit adds the menu-driven UEFI Secure Boot Key enrollment interface. User can enroll PK, KEK, db and dbx by selecting file. Only the signed EFI Signature List(s) with an authenticated header, typically '.auth' file, is accepted. To clear the PK, KEK, db and dbx, user needs to enroll the null key signed by PK or KEK. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
21faf4ef |
|
19-Nov-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: use protocol interface for file selection EFI_SIMPLE_FILE_SYSTEM_PROTOCOL is not always provided by U-Boot. Use protocol interface functions instead of U-Boot internal functions. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d6566113 |
|
19-Nov-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: expose eficonfig_create_device_path() Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use eficonfig_create_device_path() to construct the full device path from device path of the volume and file path, so move it out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d571f9b2 |
|
19-Nov-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: refactor change boot order implementation All the eficonfig menus other than "Change Boot Order" use 'eficonfig_entry' structure for each menu entry. This commit refactors change boot order implementation to use 'eficonfig_entry' structure same as other menus to have consistent menu handling. This commit also simplifies the data->active handling when KEY_SPACE is pressed, and sizeof() parameter. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
8961e93e |
|
19-Nov-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: expose append entry function Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use append_entry() and append_quit_entry() to construct the menu, so move them out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
a84040ab |
|
19-Nov-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: refactor file selection handling eficonfig_select_file_handler() is commonly used to select the file. eficonfig_display_select_file_option() adds an additional menu to clear the selected file. eficonfig_display_select_file_option() is not always necessary for the file selection process, so it must be outside of eficonfig_select_file_handler(). This commit also renames the following functions to avoid confusion. eficonfig_select_file_handler() -> eficonfig_process_select_file() eficonfig_select_file() -> eficonfig_show_file_selection() eficonfig_display_select_file_option() -> eficonfig_process_show_file_option() Finally, test_eficonfig.py need to be updated to get aligned with the above modification. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
1167e88a |
|
14-Nov-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: fix missing variable initialization The 'ret' variable must be initialized before use in eficonfig_delete_invalid_boot_option(). Fixes: c416f1c0bc ("bootmenu: add removable media entries") Addresses-Coverity: 376207 ("Uninitialized variables") Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
3d595ac5 |
|
09-Nov-2022 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: remove superfluous if in eficonfig_edit_boot_option Goto for an immediately succeeding label is superfluous. Fixes: 87d791423ac6 ("eficonfig: menu-driven addition of UEFI boot option") Addresses-Coverity: 376202 ("Identical code for different branches") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
f19171c9 |
|
08-Jan-2024 |
Ilias Apalodimas <ilias.apalodimas@linaro.org> |
efi_loader: Clean up efi_dp_append and efi_dp_concat Looking back at the initrd storing functionality, we introduced three functions, efi_dp_append_or_concatenate(), efi_dp_append/concat(). In hindsight we could have simplified that by a lot. First of all none of the functions append anything. They all allocate a new device path and concatenate the contents of two device paths in one. A boolean parameter controls the final device path -- if that's true an end node is injected between the two device paths. So let's rewrite this and make it a bit easier to read. Get rid of efi_dp_append(), efi_dp_concat() and rename efi_dp_append_or_concatenate() to efi_dp_concat(). This is far more intuitive and the only adjustment that is needed is an extra boolean argument on all callsites. Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
64658007 |
|
17-Nov-2023 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: eficonfig: create shortened boot options The boot options created by eficonfig should use shortened device-paths to avoid problems if drives are enumerated in a different sequence. Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
9945bc4f |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Fix incorrect return code of boot option update Correct the return code for out-of-memory and no boot option found Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
339b527b |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Move bootorder and bootoption apis to lib Rename and move bootorder and bootoption apis from cmd to lib for re-use between eficonfig and bootmgr Fix 'unexpected indentation' when 'make htmldocs' after functions are moved Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
2c0b0c31 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_SECURE_BOOT This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_SECURE_BOOT defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
83f3d121 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_MM_COMM_TEE This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_MM_COMM_TEE defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
88df3634 |
|
02-Feb-2023 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: CTRL+S to save the boot order 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>
|
#
45f5319f |
|
02-Feb-2023 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
menu: remove CTRL+C to quit On the sandbox called without "--terminal raw" CTRL+C leaves U-Boot, "ESC/CTRL+C to quit" is misleading. Let's remove CTRL+C to quit key handling from bootmenu and eficonfig menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
|
#
8dbd0a0f |
|
23-Jan-2023 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: add vertical scroll support The current eficonfig menu does not support vertical scroll, so it can not display the menu entries greater than the console row size. This commit add the vertial scroll support. The console size is retrieved by SIMPLE_TEXT_OUTPUT_PROTOCOL.QueryMode() service, then calculates the row size for menu entry by subtracting menu header and description row size from the console row size. "start" and "end" are added in the efimenu structure. "start" keeps the menu entry index at the top, "end" keeps the bottom menu entry index. item_data_print() menu function only draws the menu entry between "start" and "end". This commit also fixes the issue that "Save" and "Quit" entries can be moved by BKEY_PLUS in change boot order menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
0d590852 |
|
23-Jan-2023 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: refactor change boot order implementation This commit removes the change boot order specific menu implementation. The change boot order implementation calls eficonfig_process_common() same as other menus. The change boot order menu requires own item_data_print and item_choice implementation, but display_statusline function can be a same function as other menus. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
cd160b27 |
|
23-Jan-2023 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: refactor eficonfig_process_common function Current change boot order implementation does not call eficonfig_process_common() and call own menu functions for display_statusline, item_data_print and item_choice. Change boot order functionality should call eficonfig_process_common() to improve maintenanceability. This commit is a preparation to remove the change boot order specific implementation. The menu functions (display_statusline, item_data_print and item_choice) are added as argument of eficonfig_process_common(). The menu description string displayed at the bottom of the menu is also added as argument. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
32bab0ea |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Make use of CLI character processing Avoid duplicating some of the escape-sequence processing here and use the CLI function instead. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
d0ca98db |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Update bootmenu_loop() to return the code Use the return value to save having to pass around a pointer. This also resolves any ambiguity about what *key contains when the function is called. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
2da4a15e |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Rename KEY_... to BKEY_... This enum values conflict with linux/input.h so rename them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
64550274 |
|
18-Dec-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: avoid SetVariable between GetNextVariableName calls The current code calls efi_set_variable_int() to delete the invalid boot option between calls to efi_get_next_variable_name_int(), it may produce unpredictable results. This commit moves removal of the invalid boot option outside of the efi_get_next_variable_name_int() calls. EFI_NOT_FOUND returned from efi_get_next_variable_name_int() indicates we retrieved all EFI variables, it should be treated as EFI_SUCEESS. To address the checkpatch warning of too many leading tabs, combine two if statement into one. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
ce327084 |
|
18-Dec-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: carve out efi_get_next_variable_name_int calls To retrieve the EFI variable name by efi_get_next_variable_name_int(), the sequence of alloc -> efi_get_next_variable_name_int -> realloc -> efi_get_next_variable_name_int is required. In current code, this sequence repeatedly appears in the several functions. It should be curved out a common function. This commit also fixes the missing free() of var_name16 in eficonfig_delete_invalid_boot_option(). Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
140a8959 |
|
01-Dec-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: use efi_get_next_variable_name_int() eficonfig command reads all possible UEFI load options from 0x0000 to 0xFFFF to construct the menu. This takes too much time in some environment. This commit uses efi_get_next_variable_name_int() to read all existing UEFI load options to significantlly reduce the count of efi_get_var() call. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
78b1ccc4 |
|
01-Dec-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: use u16_strsize() to get u16 string buffer size Use u16_strsize() to simplify the u16 string buffer size calculation. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c67d3c9e |
|
01-Dec-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: fix going one directory up issue The directory name in eficonfig menu entry contains the '\' separator. strcmp() argument ".." is wrong and one directory up handling does not work correctly. strcmp() argument must include '\' separator. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c3b5af63 |
|
19-Nov-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: add UEFI Secure Boot Key enrollment interface This commit adds the menu-driven UEFI Secure Boot Key enrollment interface. User can enroll PK, KEK, db and dbx by selecting file. Only the signed EFI Signature List(s) with an authenticated header, typically '.auth' file, is accepted. To clear the PK, KEK, db and dbx, user needs to enroll the null key signed by PK or KEK. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
21faf4ef |
|
19-Nov-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: use protocol interface for file selection EFI_SIMPLE_FILE_SYSTEM_PROTOCOL is not always provided by U-Boot. Use protocol interface functions instead of U-Boot internal functions. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d6566113 |
|
19-Nov-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: expose eficonfig_create_device_path() Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use eficonfig_create_device_path() to construct the full device path from device path of the volume and file path, so move it out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d571f9b2 |
|
19-Nov-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: refactor change boot order implementation All the eficonfig menus other than "Change Boot Order" use 'eficonfig_entry' structure for each menu entry. This commit refactors change boot order implementation to use 'eficonfig_entry' structure same as other menus to have consistent menu handling. This commit also simplifies the data->active handling when KEY_SPACE is pressed, and sizeof() parameter. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
8961e93e |
|
19-Nov-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: expose append entry function Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use append_entry() and append_quit_entry() to construct the menu, so move them out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
a84040ab |
|
19-Nov-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: refactor file selection handling eficonfig_select_file_handler() is commonly used to select the file. eficonfig_display_select_file_option() adds an additional menu to clear the selected file. eficonfig_display_select_file_option() is not always necessary for the file selection process, so it must be outside of eficonfig_select_file_handler(). This commit also renames the following functions to avoid confusion. eficonfig_select_file_handler() -> eficonfig_process_select_file() eficonfig_select_file() -> eficonfig_show_file_selection() eficonfig_display_select_file_option() -> eficonfig_process_show_file_option() Finally, test_eficonfig.py need to be updated to get aligned with the above modification. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
1167e88a |
|
14-Nov-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: fix missing variable initialization The 'ret' variable must be initialized before use in eficonfig_delete_invalid_boot_option(). Fixes: c416f1c0bc ("bootmenu: add removable media entries") Addresses-Coverity: 376207 ("Uninitialized variables") Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
3d595ac5 |
|
09-Nov-2022 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: remove superfluous if in eficonfig_edit_boot_option Goto for an immediately succeeding label is superfluous. Fixes: 87d791423ac6 ("eficonfig: menu-driven addition of UEFI boot option") Addresses-Coverity: 376202 ("Identical code for different branches") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
f19171c9 |
|
08-Jan-2024 |
Ilias Apalodimas <ilias.apalodimas@linaro.org> |
efi_loader: Clean up efi_dp_append and efi_dp_concat Looking back at the initrd storing functionality, we introduced three functions, efi_dp_append_or_concatenate(), efi_dp_append/concat(). In hindsight we could have simplified that by a lot. First of all none of the functions append anything. They all allocate a new device path and concatenate the contents of two device paths in one. A boolean parameter controls the final device path -- if that's true an end node is injected between the two device paths. So let's rewrite this and make it a bit easier to read. Get rid of efi_dp_append(), efi_dp_concat() and rename efi_dp_append_or_concatenate() to efi_dp_concat(). This is far more intuitive and the only adjustment that is needed is an extra boolean argument on all callsites. Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
64658007 |
|
17-Nov-2023 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: eficonfig: create shortened boot options The boot options created by eficonfig should use shortened device-paths to avoid problems if drives are enumerated in a different sequence. Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
9945bc4f |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Fix incorrect return code of boot option update Correct the return code for out-of-memory and no boot option found Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
339b527b |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Move bootorder and bootoption apis to lib Rename and move bootorder and bootoption apis from cmd to lib for re-use between eficonfig and bootmgr Fix 'unexpected indentation' when 'make htmldocs' after functions are moved Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
2c0b0c31 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_SECURE_BOOT This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_SECURE_BOOT defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
83f3d121 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_MM_COMM_TEE This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_MM_COMM_TEE defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
88df3634 |
|
02-Feb-2023 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: CTRL+S to save the boot order 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>
|
#
45f5319f |
|
02-Feb-2023 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
menu: remove CTRL+C to quit On the sandbox called without "--terminal raw" CTRL+C leaves U-Boot, "ESC/CTRL+C to quit" is misleading. Let's remove CTRL+C to quit key handling from bootmenu and eficonfig menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
|
#
8dbd0a0f |
|
23-Jan-2023 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: add vertical scroll support The current eficonfig menu does not support vertical scroll, so it can not display the menu entries greater than the console row size. This commit add the vertial scroll support. The console size is retrieved by SIMPLE_TEXT_OUTPUT_PROTOCOL.QueryMode() service, then calculates the row size for menu entry by subtracting menu header and description row size from the console row size. "start" and "end" are added in the efimenu structure. "start" keeps the menu entry index at the top, "end" keeps the bottom menu entry index. item_data_print() menu function only draws the menu entry between "start" and "end". This commit also fixes the issue that "Save" and "Quit" entries can be moved by BKEY_PLUS in change boot order menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
0d590852 |
|
23-Jan-2023 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: refactor change boot order implementation This commit removes the change boot order specific menu implementation. The change boot order implementation calls eficonfig_process_common() same as other menus. The change boot order menu requires own item_data_print and item_choice implementation, but display_statusline function can be a same function as other menus. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
cd160b27 |
|
23-Jan-2023 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: refactor eficonfig_process_common function Current change boot order implementation does not call eficonfig_process_common() and call own menu functions for display_statusline, item_data_print and item_choice. Change boot order functionality should call eficonfig_process_common() to improve maintenanceability. This commit is a preparation to remove the change boot order specific implementation. The menu functions (display_statusline, item_data_print and item_choice) are added as argument of eficonfig_process_common(). The menu description string displayed at the bottom of the menu is also added as argument. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
32bab0ea |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Make use of CLI character processing Avoid duplicating some of the escape-sequence processing here and use the CLI function instead. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
d0ca98db |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Update bootmenu_loop() to return the code Use the return value to save having to pass around a pointer. This also resolves any ambiguity about what *key contains when the function is called. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
2da4a15e |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Rename KEY_... to BKEY_... This enum values conflict with linux/input.h so rename them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
64550274 |
|
18-Dec-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: avoid SetVariable between GetNextVariableName calls The current code calls efi_set_variable_int() to delete the invalid boot option between calls to efi_get_next_variable_name_int(), it may produce unpredictable results. This commit moves removal of the invalid boot option outside of the efi_get_next_variable_name_int() calls. EFI_NOT_FOUND returned from efi_get_next_variable_name_int() indicates we retrieved all EFI variables, it should be treated as EFI_SUCEESS. To address the checkpatch warning of too many leading tabs, combine two if statement into one. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
ce327084 |
|
18-Dec-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: carve out efi_get_next_variable_name_int calls To retrieve the EFI variable name by efi_get_next_variable_name_int(), the sequence of alloc -> efi_get_next_variable_name_int -> realloc -> efi_get_next_variable_name_int is required. In current code, this sequence repeatedly appears in the several functions. It should be curved out a common function. This commit also fixes the missing free() of var_name16 in eficonfig_delete_invalid_boot_option(). Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
140a8959 |
|
01-Dec-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: use efi_get_next_variable_name_int() eficonfig command reads all possible UEFI load options from 0x0000 to 0xFFFF to construct the menu. This takes too much time in some environment. This commit uses efi_get_next_variable_name_int() to read all existing UEFI load options to significantlly reduce the count of efi_get_var() call. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
78b1ccc4 |
|
01-Dec-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: use u16_strsize() to get u16 string buffer size Use u16_strsize() to simplify the u16 string buffer size calculation. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c67d3c9e |
|
01-Dec-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: fix going one directory up issue The directory name in eficonfig menu entry contains the '\' separator. strcmp() argument ".." is wrong and one directory up handling does not work correctly. strcmp() argument must include '\' separator. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c3b5af63 |
|
19-Nov-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: add UEFI Secure Boot Key enrollment interface This commit adds the menu-driven UEFI Secure Boot Key enrollment interface. User can enroll PK, KEK, db and dbx by selecting file. Only the signed EFI Signature List(s) with an authenticated header, typically '.auth' file, is accepted. To clear the PK, KEK, db and dbx, user needs to enroll the null key signed by PK or KEK. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
21faf4ef |
|
19-Nov-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: use protocol interface for file selection EFI_SIMPLE_FILE_SYSTEM_PROTOCOL is not always provided by U-Boot. Use protocol interface functions instead of U-Boot internal functions. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d6566113 |
|
19-Nov-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: expose eficonfig_create_device_path() Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use eficonfig_create_device_path() to construct the full device path from device path of the volume and file path, so move it out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d571f9b2 |
|
19-Nov-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: refactor change boot order implementation All the eficonfig menus other than "Change Boot Order" use 'eficonfig_entry' structure for each menu entry. This commit refactors change boot order implementation to use 'eficonfig_entry' structure same as other menus to have consistent menu handling. This commit also simplifies the data->active handling when KEY_SPACE is pressed, and sizeof() parameter. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
8961e93e |
|
19-Nov-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: expose append entry function Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use append_entry() and append_quit_entry() to construct the menu, so move them out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
a84040ab |
|
19-Nov-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: refactor file selection handling eficonfig_select_file_handler() is commonly used to select the file. eficonfig_display_select_file_option() adds an additional menu to clear the selected file. eficonfig_display_select_file_option() is not always necessary for the file selection process, so it must be outside of eficonfig_select_file_handler(). This commit also renames the following functions to avoid confusion. eficonfig_select_file_handler() -> eficonfig_process_select_file() eficonfig_select_file() -> eficonfig_show_file_selection() eficonfig_display_select_file_option() -> eficonfig_process_show_file_option() Finally, test_eficonfig.py need to be updated to get aligned with the above modification. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
1167e88a |
|
14-Nov-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: fix missing variable initialization The 'ret' variable must be initialized before use in eficonfig_delete_invalid_boot_option(). Fixes: c416f1c0bc ("bootmenu: add removable media entries") Addresses-Coverity: 376207 ("Uninitialized variables") Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
3d595ac5 |
|
09-Nov-2022 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: remove superfluous if in eficonfig_edit_boot_option Goto for an immediately succeeding label is superfluous. Fixes: 87d791423ac6 ("eficonfig: menu-driven addition of UEFI boot option") Addresses-Coverity: 376202 ("Identical code for different branches") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
f19171c9 |
|
08-Jan-2024 |
Ilias Apalodimas <ilias.apalodimas@linaro.org> |
efi_loader: Clean up efi_dp_append and efi_dp_concat Looking back at the initrd storing functionality, we introduced three functions, efi_dp_append_or_concatenate(), efi_dp_append/concat(). In hindsight we could have simplified that by a lot. First of all none of the functions append anything. They all allocate a new device path and concatenate the contents of two device paths in one. A boolean parameter controls the final device path -- if that's true an end node is injected between the two device paths. So let's rewrite this and make it a bit easier to read. Get rid of efi_dp_append(), efi_dp_concat() and rename efi_dp_append_or_concatenate() to efi_dp_concat(). This is far more intuitive and the only adjustment that is needed is an extra boolean argument on all callsites. Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
64658007 |
|
17-Nov-2023 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: eficonfig: create shortened boot options The boot options created by eficonfig should use shortened device-paths to avoid problems if drives are enumerated in a different sequence. Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
9945bc4f |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Fix incorrect return code of boot option update Correct the return code for out-of-memory and no boot option found Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
339b527b |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Move bootorder and bootoption apis to lib Rename and move bootorder and bootoption apis from cmd to lib for re-use between eficonfig and bootmgr Fix 'unexpected indentation' when 'make htmldocs' after functions are moved Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
2c0b0c31 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_SECURE_BOOT This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_SECURE_BOOT defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
83f3d121 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_MM_COMM_TEE This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_MM_COMM_TEE defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
88df3634 |
|
02-Feb-2023 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: CTRL+S to save the boot order 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>
|
#
45f5319f |
|
02-Feb-2023 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
menu: remove CTRL+C to quit On the sandbox called without "--terminal raw" CTRL+C leaves U-Boot, "ESC/CTRL+C to quit" is misleading. Let's remove CTRL+C to quit key handling from bootmenu and eficonfig menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
|
#
8dbd0a0f |
|
23-Jan-2023 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: add vertical scroll support The current eficonfig menu does not support vertical scroll, so it can not display the menu entries greater than the console row size. This commit add the vertial scroll support. The console size is retrieved by SIMPLE_TEXT_OUTPUT_PROTOCOL.QueryMode() service, then calculates the row size for menu entry by subtracting menu header and description row size from the console row size. "start" and "end" are added in the efimenu structure. "start" keeps the menu entry index at the top, "end" keeps the bottom menu entry index. item_data_print() menu function only draws the menu entry between "start" and "end". This commit also fixes the issue that "Save" and "Quit" entries can be moved by BKEY_PLUS in change boot order menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
0d590852 |
|
23-Jan-2023 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: refactor change boot order implementation This commit removes the change boot order specific menu implementation. The change boot order implementation calls eficonfig_process_common() same as other menus. The change boot order menu requires own item_data_print and item_choice implementation, but display_statusline function can be a same function as other menus. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
cd160b27 |
|
23-Jan-2023 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: refactor eficonfig_process_common function Current change boot order implementation does not call eficonfig_process_common() and call own menu functions for display_statusline, item_data_print and item_choice. Change boot order functionality should call eficonfig_process_common() to improve maintenanceability. This commit is a preparation to remove the change boot order specific implementation. The menu functions (display_statusline, item_data_print and item_choice) are added as argument of eficonfig_process_common(). The menu description string displayed at the bottom of the menu is also added as argument. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
32bab0ea |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Make use of CLI character processing Avoid duplicating some of the escape-sequence processing here and use the CLI function instead. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
d0ca98db |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Update bootmenu_loop() to return the code Use the return value to save having to pass around a pointer. This also resolves any ambiguity about what *key contains when the function is called. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
2da4a15e |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Rename KEY_... to BKEY_... This enum values conflict with linux/input.h so rename them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
64550274 |
|
18-Dec-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: avoid SetVariable between GetNextVariableName calls The current code calls efi_set_variable_int() to delete the invalid boot option between calls to efi_get_next_variable_name_int(), it may produce unpredictable results. This commit moves removal of the invalid boot option outside of the efi_get_next_variable_name_int() calls. EFI_NOT_FOUND returned from efi_get_next_variable_name_int() indicates we retrieved all EFI variables, it should be treated as EFI_SUCEESS. To address the checkpatch warning of too many leading tabs, combine two if statement into one. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
ce327084 |
|
18-Dec-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: carve out efi_get_next_variable_name_int calls To retrieve the EFI variable name by efi_get_next_variable_name_int(), the sequence of alloc -> efi_get_next_variable_name_int -> realloc -> efi_get_next_variable_name_int is required. In current code, this sequence repeatedly appears in the several functions. It should be curved out a common function. This commit also fixes the missing free() of var_name16 in eficonfig_delete_invalid_boot_option(). Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
140a8959 |
|
01-Dec-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: use efi_get_next_variable_name_int() eficonfig command reads all possible UEFI load options from 0x0000 to 0xFFFF to construct the menu. This takes too much time in some environment. This commit uses efi_get_next_variable_name_int() to read all existing UEFI load options to significantlly reduce the count of efi_get_var() call. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
78b1ccc4 |
|
01-Dec-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: use u16_strsize() to get u16 string buffer size Use u16_strsize() to simplify the u16 string buffer size calculation. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c67d3c9e |
|
01-Dec-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: fix going one directory up issue The directory name in eficonfig menu entry contains the '\' separator. strcmp() argument ".." is wrong and one directory up handling does not work correctly. strcmp() argument must include '\' separator. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c3b5af63 |
|
19-Nov-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: add UEFI Secure Boot Key enrollment interface This commit adds the menu-driven UEFI Secure Boot Key enrollment interface. User can enroll PK, KEK, db and dbx by selecting file. Only the signed EFI Signature List(s) with an authenticated header, typically '.auth' file, is accepted. To clear the PK, KEK, db and dbx, user needs to enroll the null key signed by PK or KEK. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
21faf4ef |
|
19-Nov-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: use protocol interface for file selection EFI_SIMPLE_FILE_SYSTEM_PROTOCOL is not always provided by U-Boot. Use protocol interface functions instead of U-Boot internal functions. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d6566113 |
|
19-Nov-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: expose eficonfig_create_device_path() Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use eficonfig_create_device_path() to construct the full device path from device path of the volume and file path, so move it out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d571f9b2 |
|
19-Nov-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: refactor change boot order implementation All the eficonfig menus other than "Change Boot Order" use 'eficonfig_entry' structure for each menu entry. This commit refactors change boot order implementation to use 'eficonfig_entry' structure same as other menus to have consistent menu handling. This commit also simplifies the data->active handling when KEY_SPACE is pressed, and sizeof() parameter. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
8961e93e |
|
19-Nov-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: expose append entry function Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use append_entry() and append_quit_entry() to construct the menu, so move them out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
a84040ab |
|
19-Nov-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: refactor file selection handling eficonfig_select_file_handler() is commonly used to select the file. eficonfig_display_select_file_option() adds an additional menu to clear the selected file. eficonfig_display_select_file_option() is not always necessary for the file selection process, so it must be outside of eficonfig_select_file_handler(). This commit also renames the following functions to avoid confusion. eficonfig_select_file_handler() -> eficonfig_process_select_file() eficonfig_select_file() -> eficonfig_show_file_selection() eficonfig_display_select_file_option() -> eficonfig_process_show_file_option() Finally, test_eficonfig.py need to be updated to get aligned with the above modification. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
1167e88a |
|
14-Nov-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: fix missing variable initialization The 'ret' variable must be initialized before use in eficonfig_delete_invalid_boot_option(). Fixes: c416f1c0bc ("bootmenu: add removable media entries") Addresses-Coverity: 376207 ("Uninitialized variables") Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
3d595ac5 |
|
09-Nov-2022 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: remove superfluous if in eficonfig_edit_boot_option Goto for an immediately succeeding label is superfluous. Fixes: 87d791423ac6 ("eficonfig: menu-driven addition of UEFI boot option") Addresses-Coverity: 376202 ("Identical code for different branches") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
f19171c9 |
|
08-Jan-2024 |
Ilias Apalodimas <ilias.apalodimas@linaro.org> |
efi_loader: Clean up efi_dp_append and efi_dp_concat Looking back at the initrd storing functionality, we introduced three functions, efi_dp_append_or_concatenate(), efi_dp_append/concat(). In hindsight we could have simplified that by a lot. First of all none of the functions append anything. They all allocate a new device path and concatenate the contents of two device paths in one. A boolean parameter controls the final device path -- if that's true an end node is injected between the two device paths. So let's rewrite this and make it a bit easier to read. Get rid of efi_dp_append(), efi_dp_concat() and rename efi_dp_append_or_concatenate() to efi_dp_concat(). This is far more intuitive and the only adjustment that is needed is an extra boolean argument on all callsites. Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
64658007 |
|
17-Nov-2023 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: eficonfig: create shortened boot options The boot options created by eficonfig should use shortened device-paths to avoid problems if drives are enumerated in a different sequence. Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
9945bc4f |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Fix incorrect return code of boot option update Correct the return code for out-of-memory and no boot option found Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
339b527b |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Move bootorder and bootoption apis to lib Rename and move bootorder and bootoption apis from cmd to lib for re-use between eficonfig and bootmgr Fix 'unexpected indentation' when 'make htmldocs' after functions are moved Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
2c0b0c31 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_SECURE_BOOT This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_SECURE_BOOT defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
83f3d121 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_MM_COMM_TEE This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_MM_COMM_TEE defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
88df3634 |
|
02-Feb-2023 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: CTRL+S to save the boot order 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>
|
#
45f5319f |
|
02-Feb-2023 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
menu: remove CTRL+C to quit On the sandbox called without "--terminal raw" CTRL+C leaves U-Boot, "ESC/CTRL+C to quit" is misleading. Let's remove CTRL+C to quit key handling from bootmenu and eficonfig menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
|
#
8dbd0a0f |
|
23-Jan-2023 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: add vertical scroll support The current eficonfig menu does not support vertical scroll, so it can not display the menu entries greater than the console row size. This commit add the vertial scroll support. The console size is retrieved by SIMPLE_TEXT_OUTPUT_PROTOCOL.QueryMode() service, then calculates the row size for menu entry by subtracting menu header and description row size from the console row size. "start" and "end" are added in the efimenu structure. "start" keeps the menu entry index at the top, "end" keeps the bottom menu entry index. item_data_print() menu function only draws the menu entry between "start" and "end". This commit also fixes the issue that "Save" and "Quit" entries can be moved by BKEY_PLUS in change boot order menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
0d590852 |
|
23-Jan-2023 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: refactor change boot order implementation This commit removes the change boot order specific menu implementation. The change boot order implementation calls eficonfig_process_common() same as other menus. The change boot order menu requires own item_data_print and item_choice implementation, but display_statusline function can be a same function as other menus. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
cd160b27 |
|
23-Jan-2023 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: refactor eficonfig_process_common function Current change boot order implementation does not call eficonfig_process_common() and call own menu functions for display_statusline, item_data_print and item_choice. Change boot order functionality should call eficonfig_process_common() to improve maintenanceability. This commit is a preparation to remove the change boot order specific implementation. The menu functions (display_statusline, item_data_print and item_choice) are added as argument of eficonfig_process_common(). The menu description string displayed at the bottom of the menu is also added as argument. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
32bab0ea |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Make use of CLI character processing Avoid duplicating some of the escape-sequence processing here and use the CLI function instead. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
d0ca98db |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Update bootmenu_loop() to return the code Use the return value to save having to pass around a pointer. This also resolves any ambiguity about what *key contains when the function is called. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
2da4a15e |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Rename KEY_... to BKEY_... This enum values conflict with linux/input.h so rename them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
64550274 |
|
18-Dec-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: avoid SetVariable between GetNextVariableName calls The current code calls efi_set_variable_int() to delete the invalid boot option between calls to efi_get_next_variable_name_int(), it may produce unpredictable results. This commit moves removal of the invalid boot option outside of the efi_get_next_variable_name_int() calls. EFI_NOT_FOUND returned from efi_get_next_variable_name_int() indicates we retrieved all EFI variables, it should be treated as EFI_SUCEESS. To address the checkpatch warning of too many leading tabs, combine two if statement into one. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
ce327084 |
|
18-Dec-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: carve out efi_get_next_variable_name_int calls To retrieve the EFI variable name by efi_get_next_variable_name_int(), the sequence of alloc -> efi_get_next_variable_name_int -> realloc -> efi_get_next_variable_name_int is required. In current code, this sequence repeatedly appears in the several functions. It should be curved out a common function. This commit also fixes the missing free() of var_name16 in eficonfig_delete_invalid_boot_option(). Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
140a8959 |
|
01-Dec-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: use efi_get_next_variable_name_int() eficonfig command reads all possible UEFI load options from 0x0000 to 0xFFFF to construct the menu. This takes too much time in some environment. This commit uses efi_get_next_variable_name_int() to read all existing UEFI load options to significantlly reduce the count of efi_get_var() call. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
78b1ccc4 |
|
01-Dec-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: use u16_strsize() to get u16 string buffer size Use u16_strsize() to simplify the u16 string buffer size calculation. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c67d3c9e |
|
01-Dec-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: fix going one directory up issue The directory name in eficonfig menu entry contains the '\' separator. strcmp() argument ".." is wrong and one directory up handling does not work correctly. strcmp() argument must include '\' separator. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c3b5af63 |
|
19-Nov-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: add UEFI Secure Boot Key enrollment interface This commit adds the menu-driven UEFI Secure Boot Key enrollment interface. User can enroll PK, KEK, db and dbx by selecting file. Only the signed EFI Signature List(s) with an authenticated header, typically '.auth' file, is accepted. To clear the PK, KEK, db and dbx, user needs to enroll the null key signed by PK or KEK. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
21faf4ef |
|
19-Nov-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: use protocol interface for file selection EFI_SIMPLE_FILE_SYSTEM_PROTOCOL is not always provided by U-Boot. Use protocol interface functions instead of U-Boot internal functions. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d6566113 |
|
19-Nov-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: expose eficonfig_create_device_path() Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use eficonfig_create_device_path() to construct the full device path from device path of the volume and file path, so move it out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d571f9b2 |
|
19-Nov-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: refactor change boot order implementation All the eficonfig menus other than "Change Boot Order" use 'eficonfig_entry' structure for each menu entry. This commit refactors change boot order implementation to use 'eficonfig_entry' structure same as other menus to have consistent menu handling. This commit also simplifies the data->active handling when KEY_SPACE is pressed, and sizeof() parameter. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
8961e93e |
|
19-Nov-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: expose append entry function Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use append_entry() and append_quit_entry() to construct the menu, so move them out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
a84040ab |
|
19-Nov-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: refactor file selection handling eficonfig_select_file_handler() is commonly used to select the file. eficonfig_display_select_file_option() adds an additional menu to clear the selected file. eficonfig_display_select_file_option() is not always necessary for the file selection process, so it must be outside of eficonfig_select_file_handler(). This commit also renames the following functions to avoid confusion. eficonfig_select_file_handler() -> eficonfig_process_select_file() eficonfig_select_file() -> eficonfig_show_file_selection() eficonfig_display_select_file_option() -> eficonfig_process_show_file_option() Finally, test_eficonfig.py need to be updated to get aligned with the above modification. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
1167e88a |
|
14-Nov-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: fix missing variable initialization The 'ret' variable must be initialized before use in eficonfig_delete_invalid_boot_option(). Fixes: c416f1c0bc ("bootmenu: add removable media entries") Addresses-Coverity: 376207 ("Uninitialized variables") Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
3d595ac5 |
|
09-Nov-2022 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: remove superfluous if in eficonfig_edit_boot_option Goto for an immediately succeeding label is superfluous. Fixes: 87d791423ac6 ("eficonfig: menu-driven addition of UEFI boot option") Addresses-Coverity: 376202 ("Identical code for different branches") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
f19171c9 |
|
08-Jan-2024 |
Ilias Apalodimas <ilias.apalodimas@linaro.org> |
efi_loader: Clean up efi_dp_append and efi_dp_concat Looking back at the initrd storing functionality, we introduced three functions, efi_dp_append_or_concatenate(), efi_dp_append/concat(). In hindsight we could have simplified that by a lot. First of all none of the functions append anything. They all allocate a new device path and concatenate the contents of two device paths in one. A boolean parameter controls the final device path -- if that's true an end node is injected between the two device paths. So let's rewrite this and make it a bit easier to read. Get rid of efi_dp_append(), efi_dp_concat() and rename efi_dp_append_or_concatenate() to efi_dp_concat(). This is far more intuitive and the only adjustment that is needed is an extra boolean argument on all callsites. Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
64658007 |
|
17-Nov-2023 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: eficonfig: create shortened boot options The boot options created by eficonfig should use shortened device-paths to avoid problems if drives are enumerated in a different sequence. Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
9945bc4f |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Fix incorrect return code of boot option update Correct the return code for out-of-memory and no boot option found Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
339b527b |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Move bootorder and bootoption apis to lib Rename and move bootorder and bootoption apis from cmd to lib for re-use between eficonfig and bootmgr Fix 'unexpected indentation' when 'make htmldocs' after functions are moved Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
2c0b0c31 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_SECURE_BOOT This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_SECURE_BOOT defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
83f3d121 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_MM_COMM_TEE This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_MM_COMM_TEE defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
88df3634 |
|
02-Feb-2023 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: CTRL+S to save the boot order 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>
|
#
45f5319f |
|
02-Feb-2023 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
menu: remove CTRL+C to quit On the sandbox called without "--terminal raw" CTRL+C leaves U-Boot, "ESC/CTRL+C to quit" is misleading. Let's remove CTRL+C to quit key handling from bootmenu and eficonfig menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
|
#
8dbd0a0f |
|
23-Jan-2023 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: add vertical scroll support The current eficonfig menu does not support vertical scroll, so it can not display the menu entries greater than the console row size. This commit add the vertial scroll support. The console size is retrieved by SIMPLE_TEXT_OUTPUT_PROTOCOL.QueryMode() service, then calculates the row size for menu entry by subtracting menu header and description row size from the console row size. "start" and "end" are added in the efimenu structure. "start" keeps the menu entry index at the top, "end" keeps the bottom menu entry index. item_data_print() menu function only draws the menu entry between "start" and "end". This commit also fixes the issue that "Save" and "Quit" entries can be moved by BKEY_PLUS in change boot order menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
0d590852 |
|
23-Jan-2023 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: refactor change boot order implementation This commit removes the change boot order specific menu implementation. The change boot order implementation calls eficonfig_process_common() same as other menus. The change boot order menu requires own item_data_print and item_choice implementation, but display_statusline function can be a same function as other menus. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
cd160b27 |
|
23-Jan-2023 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: refactor eficonfig_process_common function Current change boot order implementation does not call eficonfig_process_common() and call own menu functions for display_statusline, item_data_print and item_choice. Change boot order functionality should call eficonfig_process_common() to improve maintenanceability. This commit is a preparation to remove the change boot order specific implementation. The menu functions (display_statusline, item_data_print and item_choice) are added as argument of eficonfig_process_common(). The menu description string displayed at the bottom of the menu is also added as argument. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
32bab0ea |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Make use of CLI character processing Avoid duplicating some of the escape-sequence processing here and use the CLI function instead. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
d0ca98db |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Update bootmenu_loop() to return the code Use the return value to save having to pass around a pointer. This also resolves any ambiguity about what *key contains when the function is called. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
2da4a15e |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Rename KEY_... to BKEY_... This enum values conflict with linux/input.h so rename them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
64550274 |
|
18-Dec-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: avoid SetVariable between GetNextVariableName calls The current code calls efi_set_variable_int() to delete the invalid boot option between calls to efi_get_next_variable_name_int(), it may produce unpredictable results. This commit moves removal of the invalid boot option outside of the efi_get_next_variable_name_int() calls. EFI_NOT_FOUND returned from efi_get_next_variable_name_int() indicates we retrieved all EFI variables, it should be treated as EFI_SUCEESS. To address the checkpatch warning of too many leading tabs, combine two if statement into one. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
ce327084 |
|
18-Dec-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: carve out efi_get_next_variable_name_int calls To retrieve the EFI variable name by efi_get_next_variable_name_int(), the sequence of alloc -> efi_get_next_variable_name_int -> realloc -> efi_get_next_variable_name_int is required. In current code, this sequence repeatedly appears in the several functions. It should be curved out a common function. This commit also fixes the missing free() of var_name16 in eficonfig_delete_invalid_boot_option(). Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
140a8959 |
|
01-Dec-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: use efi_get_next_variable_name_int() eficonfig command reads all possible UEFI load options from 0x0000 to 0xFFFF to construct the menu. This takes too much time in some environment. This commit uses efi_get_next_variable_name_int() to read all existing UEFI load options to significantlly reduce the count of efi_get_var() call. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
78b1ccc4 |
|
01-Dec-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: use u16_strsize() to get u16 string buffer size Use u16_strsize() to simplify the u16 string buffer size calculation. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c67d3c9e |
|
01-Dec-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: fix going one directory up issue The directory name in eficonfig menu entry contains the '\' separator. strcmp() argument ".." is wrong and one directory up handling does not work correctly. strcmp() argument must include '\' separator. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c3b5af63 |
|
19-Nov-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: add UEFI Secure Boot Key enrollment interface This commit adds the menu-driven UEFI Secure Boot Key enrollment interface. User can enroll PK, KEK, db and dbx by selecting file. Only the signed EFI Signature List(s) with an authenticated header, typically '.auth' file, is accepted. To clear the PK, KEK, db and dbx, user needs to enroll the null key signed by PK or KEK. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
21faf4ef |
|
19-Nov-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: use protocol interface for file selection EFI_SIMPLE_FILE_SYSTEM_PROTOCOL is not always provided by U-Boot. Use protocol interface functions instead of U-Boot internal functions. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d6566113 |
|
19-Nov-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: expose eficonfig_create_device_path() Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use eficonfig_create_device_path() to construct the full device path from device path of the volume and file path, so move it out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d571f9b2 |
|
19-Nov-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: refactor change boot order implementation All the eficonfig menus other than "Change Boot Order" use 'eficonfig_entry' structure for each menu entry. This commit refactors change boot order implementation to use 'eficonfig_entry' structure same as other menus to have consistent menu handling. This commit also simplifies the data->active handling when KEY_SPACE is pressed, and sizeof() parameter. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
8961e93e |
|
19-Nov-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: expose append entry function Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use append_entry() and append_quit_entry() to construct the menu, so move them out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
a84040ab |
|
19-Nov-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: refactor file selection handling eficonfig_select_file_handler() is commonly used to select the file. eficonfig_display_select_file_option() adds an additional menu to clear the selected file. eficonfig_display_select_file_option() is not always necessary for the file selection process, so it must be outside of eficonfig_select_file_handler(). This commit also renames the following functions to avoid confusion. eficonfig_select_file_handler() -> eficonfig_process_select_file() eficonfig_select_file() -> eficonfig_show_file_selection() eficonfig_display_select_file_option() -> eficonfig_process_show_file_option() Finally, test_eficonfig.py need to be updated to get aligned with the above modification. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
1167e88a |
|
14-Nov-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: fix missing variable initialization The 'ret' variable must be initialized before use in eficonfig_delete_invalid_boot_option(). Fixes: c416f1c0bc ("bootmenu: add removable media entries") Addresses-Coverity: 376207 ("Uninitialized variables") Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
3d595ac5 |
|
09-Nov-2022 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: remove superfluous if in eficonfig_edit_boot_option Goto for an immediately succeeding label is superfluous. Fixes: 87d791423ac6 ("eficonfig: menu-driven addition of UEFI boot option") Addresses-Coverity: 376202 ("Identical code for different branches") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
f19171c9 |
|
08-Jan-2024 |
Ilias Apalodimas <ilias.apalodimas@linaro.org> |
efi_loader: Clean up efi_dp_append and efi_dp_concat Looking back at the initrd storing functionality, we introduced three functions, efi_dp_append_or_concatenate(), efi_dp_append/concat(). In hindsight we could have simplified that by a lot. First of all none of the functions append anything. They all allocate a new device path and concatenate the contents of two device paths in one. A boolean parameter controls the final device path -- if that's true an end node is injected between the two device paths. So let's rewrite this and make it a bit easier to read. Get rid of efi_dp_append(), efi_dp_concat() and rename efi_dp_append_or_concatenate() to efi_dp_concat(). This is far more intuitive and the only adjustment that is needed is an extra boolean argument on all callsites. Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
64658007 |
|
17-Nov-2023 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: eficonfig: create shortened boot options The boot options created by eficonfig should use shortened device-paths to avoid problems if drives are enumerated in a different sequence. Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
9945bc4f |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Fix incorrect return code of boot option update Correct the return code for out-of-memory and no boot option found Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
339b527b |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Move bootorder and bootoption apis to lib Rename and move bootorder and bootoption apis from cmd to lib for re-use between eficonfig and bootmgr Fix 'unexpected indentation' when 'make htmldocs' after functions are moved Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
2c0b0c31 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_SECURE_BOOT This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_SECURE_BOOT defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
83f3d121 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_MM_COMM_TEE This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_MM_COMM_TEE defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
88df3634 |
|
02-Feb-2023 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: CTRL+S to save the boot order 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>
|
#
45f5319f |
|
02-Feb-2023 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
menu: remove CTRL+C to quit On the sandbox called without "--terminal raw" CTRL+C leaves U-Boot, "ESC/CTRL+C to quit" is misleading. Let's remove CTRL+C to quit key handling from bootmenu and eficonfig menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
|
#
8dbd0a0f |
|
23-Jan-2023 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: add vertical scroll support The current eficonfig menu does not support vertical scroll, so it can not display the menu entries greater than the console row size. This commit add the vertial scroll support. The console size is retrieved by SIMPLE_TEXT_OUTPUT_PROTOCOL.QueryMode() service, then calculates the row size for menu entry by subtracting menu header and description row size from the console row size. "start" and "end" are added in the efimenu structure. "start" keeps the menu entry index at the top, "end" keeps the bottom menu entry index. item_data_print() menu function only draws the menu entry between "start" and "end". This commit also fixes the issue that "Save" and "Quit" entries can be moved by BKEY_PLUS in change boot order menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
0d590852 |
|
23-Jan-2023 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: refactor change boot order implementation This commit removes the change boot order specific menu implementation. The change boot order implementation calls eficonfig_process_common() same as other menus. The change boot order menu requires own item_data_print and item_choice implementation, but display_statusline function can be a same function as other menus. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
cd160b27 |
|
23-Jan-2023 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: refactor eficonfig_process_common function Current change boot order implementation does not call eficonfig_process_common() and call own menu functions for display_statusline, item_data_print and item_choice. Change boot order functionality should call eficonfig_process_common() to improve maintenanceability. This commit is a preparation to remove the change boot order specific implementation. The menu functions (display_statusline, item_data_print and item_choice) are added as argument of eficonfig_process_common(). The menu description string displayed at the bottom of the menu is also added as argument. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
32bab0ea |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Make use of CLI character processing Avoid duplicating some of the escape-sequence processing here and use the CLI function instead. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
d0ca98db |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Update bootmenu_loop() to return the code Use the return value to save having to pass around a pointer. This also resolves any ambiguity about what *key contains when the function is called. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
2da4a15e |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Rename KEY_... to BKEY_... This enum values conflict with linux/input.h so rename them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
64550274 |
|
18-Dec-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: avoid SetVariable between GetNextVariableName calls The current code calls efi_set_variable_int() to delete the invalid boot option between calls to efi_get_next_variable_name_int(), it may produce unpredictable results. This commit moves removal of the invalid boot option outside of the efi_get_next_variable_name_int() calls. EFI_NOT_FOUND returned from efi_get_next_variable_name_int() indicates we retrieved all EFI variables, it should be treated as EFI_SUCEESS. To address the checkpatch warning of too many leading tabs, combine two if statement into one. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
ce327084 |
|
18-Dec-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: carve out efi_get_next_variable_name_int calls To retrieve the EFI variable name by efi_get_next_variable_name_int(), the sequence of alloc -> efi_get_next_variable_name_int -> realloc -> efi_get_next_variable_name_int is required. In current code, this sequence repeatedly appears in the several functions. It should be curved out a common function. This commit also fixes the missing free() of var_name16 in eficonfig_delete_invalid_boot_option(). Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
140a8959 |
|
01-Dec-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: use efi_get_next_variable_name_int() eficonfig command reads all possible UEFI load options from 0x0000 to 0xFFFF to construct the menu. This takes too much time in some environment. This commit uses efi_get_next_variable_name_int() to read all existing UEFI load options to significantlly reduce the count of efi_get_var() call. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
78b1ccc4 |
|
01-Dec-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: use u16_strsize() to get u16 string buffer size Use u16_strsize() to simplify the u16 string buffer size calculation. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c67d3c9e |
|
01-Dec-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: fix going one directory up issue The directory name in eficonfig menu entry contains the '\' separator. strcmp() argument ".." is wrong and one directory up handling does not work correctly. strcmp() argument must include '\' separator. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c3b5af63 |
|
19-Nov-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: add UEFI Secure Boot Key enrollment interface This commit adds the menu-driven UEFI Secure Boot Key enrollment interface. User can enroll PK, KEK, db and dbx by selecting file. Only the signed EFI Signature List(s) with an authenticated header, typically '.auth' file, is accepted. To clear the PK, KEK, db and dbx, user needs to enroll the null key signed by PK or KEK. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
21faf4ef |
|
19-Nov-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: use protocol interface for file selection EFI_SIMPLE_FILE_SYSTEM_PROTOCOL is not always provided by U-Boot. Use protocol interface functions instead of U-Boot internal functions. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d6566113 |
|
19-Nov-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: expose eficonfig_create_device_path() Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use eficonfig_create_device_path() to construct the full device path from device path of the volume and file path, so move it out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d571f9b2 |
|
19-Nov-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: refactor change boot order implementation All the eficonfig menus other than "Change Boot Order" use 'eficonfig_entry' structure for each menu entry. This commit refactors change boot order implementation to use 'eficonfig_entry' structure same as other menus to have consistent menu handling. This commit also simplifies the data->active handling when KEY_SPACE is pressed, and sizeof() parameter. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
8961e93e |
|
19-Nov-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: expose append entry function Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use append_entry() and append_quit_entry() to construct the menu, so move them out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
a84040ab |
|
19-Nov-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: refactor file selection handling eficonfig_select_file_handler() is commonly used to select the file. eficonfig_display_select_file_option() adds an additional menu to clear the selected file. eficonfig_display_select_file_option() is not always necessary for the file selection process, so it must be outside of eficonfig_select_file_handler(). This commit also renames the following functions to avoid confusion. eficonfig_select_file_handler() -> eficonfig_process_select_file() eficonfig_select_file() -> eficonfig_show_file_selection() eficonfig_display_select_file_option() -> eficonfig_process_show_file_option() Finally, test_eficonfig.py need to be updated to get aligned with the above modification. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
1167e88a |
|
14-Nov-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: fix missing variable initialization The 'ret' variable must be initialized before use in eficonfig_delete_invalid_boot_option(). Fixes: c416f1c0bc ("bootmenu: add removable media entries") Addresses-Coverity: 376207 ("Uninitialized variables") Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
3d595ac5 |
|
09-Nov-2022 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: remove superfluous if in eficonfig_edit_boot_option Goto for an immediately succeeding label is superfluous. Fixes: 87d791423ac6 ("eficonfig: menu-driven addition of UEFI boot option") Addresses-Coverity: 376202 ("Identical code for different branches") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
f19171c9 |
|
08-Jan-2024 |
Ilias Apalodimas <ilias.apalodimas@linaro.org> |
efi_loader: Clean up efi_dp_append and efi_dp_concat Looking back at the initrd storing functionality, we introduced three functions, efi_dp_append_or_concatenate(), efi_dp_append/concat(). In hindsight we could have simplified that by a lot. First of all none of the functions append anything. They all allocate a new device path and concatenate the contents of two device paths in one. A boolean parameter controls the final device path -- if that's true an end node is injected between the two device paths. So let's rewrite this and make it a bit easier to read. Get rid of efi_dp_append(), efi_dp_concat() and rename efi_dp_append_or_concatenate() to efi_dp_concat(). This is far more intuitive and the only adjustment that is needed is an extra boolean argument on all callsites. Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
64658007 |
|
17-Nov-2023 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: eficonfig: create shortened boot options The boot options created by eficonfig should use shortened device-paths to avoid problems if drives are enumerated in a different sequence. Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
9945bc4f |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Fix incorrect return code of boot option update Correct the return code for out-of-memory and no boot option found Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
339b527b |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Move bootorder and bootoption apis to lib Rename and move bootorder and bootoption apis from cmd to lib for re-use between eficonfig and bootmgr Fix 'unexpected indentation' when 'make htmldocs' after functions are moved Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
2c0b0c31 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_SECURE_BOOT This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_SECURE_BOOT defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
83f3d121 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_MM_COMM_TEE This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_MM_COMM_TEE defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
88df3634 |
|
02-Feb-2023 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: CTRL+S to save the boot order 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>
|
#
45f5319f |
|
02-Feb-2023 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
menu: remove CTRL+C to quit On the sandbox called without "--terminal raw" CTRL+C leaves U-Boot, "ESC/CTRL+C to quit" is misleading. Let's remove CTRL+C to quit key handling from bootmenu and eficonfig menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
|
#
8dbd0a0f |
|
23-Jan-2023 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: add vertical scroll support The current eficonfig menu does not support vertical scroll, so it can not display the menu entries greater than the console row size. This commit add the vertial scroll support. The console size is retrieved by SIMPLE_TEXT_OUTPUT_PROTOCOL.QueryMode() service, then calculates the row size for menu entry by subtracting menu header and description row size from the console row size. "start" and "end" are added in the efimenu structure. "start" keeps the menu entry index at the top, "end" keeps the bottom menu entry index. item_data_print() menu function only draws the menu entry between "start" and "end". This commit also fixes the issue that "Save" and "Quit" entries can be moved by BKEY_PLUS in change boot order menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
0d590852 |
|
23-Jan-2023 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: refactor change boot order implementation This commit removes the change boot order specific menu implementation. The change boot order implementation calls eficonfig_process_common() same as other menus. The change boot order menu requires own item_data_print and item_choice implementation, but display_statusline function can be a same function as other menus. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
cd160b27 |
|
23-Jan-2023 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: refactor eficonfig_process_common function Current change boot order implementation does not call eficonfig_process_common() and call own menu functions for display_statusline, item_data_print and item_choice. Change boot order functionality should call eficonfig_process_common() to improve maintenanceability. This commit is a preparation to remove the change boot order specific implementation. The menu functions (display_statusline, item_data_print and item_choice) are added as argument of eficonfig_process_common(). The menu description string displayed at the bottom of the menu is also added as argument. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
32bab0ea |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Make use of CLI character processing Avoid duplicating some of the escape-sequence processing here and use the CLI function instead. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
d0ca98db |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Update bootmenu_loop() to return the code Use the return value to save having to pass around a pointer. This also resolves any ambiguity about what *key contains when the function is called. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
2da4a15e |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Rename KEY_... to BKEY_... This enum values conflict with linux/input.h so rename them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
64550274 |
|
18-Dec-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: avoid SetVariable between GetNextVariableName calls The current code calls efi_set_variable_int() to delete the invalid boot option between calls to efi_get_next_variable_name_int(), it may produce unpredictable results. This commit moves removal of the invalid boot option outside of the efi_get_next_variable_name_int() calls. EFI_NOT_FOUND returned from efi_get_next_variable_name_int() indicates we retrieved all EFI variables, it should be treated as EFI_SUCEESS. To address the checkpatch warning of too many leading tabs, combine two if statement into one. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
ce327084 |
|
18-Dec-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: carve out efi_get_next_variable_name_int calls To retrieve the EFI variable name by efi_get_next_variable_name_int(), the sequence of alloc -> efi_get_next_variable_name_int -> realloc -> efi_get_next_variable_name_int is required. In current code, this sequence repeatedly appears in the several functions. It should be curved out a common function. This commit also fixes the missing free() of var_name16 in eficonfig_delete_invalid_boot_option(). Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
140a8959 |
|
01-Dec-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: use efi_get_next_variable_name_int() eficonfig command reads all possible UEFI load options from 0x0000 to 0xFFFF to construct the menu. This takes too much time in some environment. This commit uses efi_get_next_variable_name_int() to read all existing UEFI load options to significantlly reduce the count of efi_get_var() call. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
78b1ccc4 |
|
01-Dec-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: use u16_strsize() to get u16 string buffer size Use u16_strsize() to simplify the u16 string buffer size calculation. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c67d3c9e |
|
01-Dec-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: fix going one directory up issue The directory name in eficonfig menu entry contains the '\' separator. strcmp() argument ".." is wrong and one directory up handling does not work correctly. strcmp() argument must include '\' separator. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c3b5af63 |
|
19-Nov-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: add UEFI Secure Boot Key enrollment interface This commit adds the menu-driven UEFI Secure Boot Key enrollment interface. User can enroll PK, KEK, db and dbx by selecting file. Only the signed EFI Signature List(s) with an authenticated header, typically '.auth' file, is accepted. To clear the PK, KEK, db and dbx, user needs to enroll the null key signed by PK or KEK. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
21faf4ef |
|
19-Nov-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: use protocol interface for file selection EFI_SIMPLE_FILE_SYSTEM_PROTOCOL is not always provided by U-Boot. Use protocol interface functions instead of U-Boot internal functions. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d6566113 |
|
19-Nov-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: expose eficonfig_create_device_path() Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use eficonfig_create_device_path() to construct the full device path from device path of the volume and file path, so move it out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d571f9b2 |
|
19-Nov-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: refactor change boot order implementation All the eficonfig menus other than "Change Boot Order" use 'eficonfig_entry' structure for each menu entry. This commit refactors change boot order implementation to use 'eficonfig_entry' structure same as other menus to have consistent menu handling. This commit also simplifies the data->active handling when KEY_SPACE is pressed, and sizeof() parameter. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
8961e93e |
|
19-Nov-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: expose append entry function Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use append_entry() and append_quit_entry() to construct the menu, so move them out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
a84040ab |
|
19-Nov-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: refactor file selection handling eficonfig_select_file_handler() is commonly used to select the file. eficonfig_display_select_file_option() adds an additional menu to clear the selected file. eficonfig_display_select_file_option() is not always necessary for the file selection process, so it must be outside of eficonfig_select_file_handler(). This commit also renames the following functions to avoid confusion. eficonfig_select_file_handler() -> eficonfig_process_select_file() eficonfig_select_file() -> eficonfig_show_file_selection() eficonfig_display_select_file_option() -> eficonfig_process_show_file_option() Finally, test_eficonfig.py need to be updated to get aligned with the above modification. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
1167e88a |
|
14-Nov-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: fix missing variable initialization The 'ret' variable must be initialized before use in eficonfig_delete_invalid_boot_option(). Fixes: c416f1c0bc ("bootmenu: add removable media entries") Addresses-Coverity: 376207 ("Uninitialized variables") Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
3d595ac5 |
|
09-Nov-2022 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: remove superfluous if in eficonfig_edit_boot_option Goto for an immediately succeeding label is superfluous. Fixes: 87d791423ac6 ("eficonfig: menu-driven addition of UEFI boot option") Addresses-Coverity: 376202 ("Identical code for different branches") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
f19171c9 |
|
08-Jan-2024 |
Ilias Apalodimas <ilias.apalodimas@linaro.org> |
efi_loader: Clean up efi_dp_append and efi_dp_concat Looking back at the initrd storing functionality, we introduced three functions, efi_dp_append_or_concatenate(), efi_dp_append/concat(). In hindsight we could have simplified that by a lot. First of all none of the functions append anything. They all allocate a new device path and concatenate the contents of two device paths in one. A boolean parameter controls the final device path -- if that's true an end node is injected between the two device paths. So let's rewrite this and make it a bit easier to read. Get rid of efi_dp_append(), efi_dp_concat() and rename efi_dp_append_or_concatenate() to efi_dp_concat(). This is far more intuitive and the only adjustment that is needed is an extra boolean argument on all callsites. Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
64658007 |
|
17-Nov-2023 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: eficonfig: create shortened boot options The boot options created by eficonfig should use shortened device-paths to avoid problems if drives are enumerated in a different sequence. Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
9945bc4f |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Fix incorrect return code of boot option update Correct the return code for out-of-memory and no boot option found Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
339b527b |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Move bootorder and bootoption apis to lib Rename and move bootorder and bootoption apis from cmd to lib for re-use between eficonfig and bootmgr Fix 'unexpected indentation' when 'make htmldocs' after functions are moved Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
2c0b0c31 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_SECURE_BOOT This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_SECURE_BOOT defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
83f3d121 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_MM_COMM_TEE This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_MM_COMM_TEE defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
88df3634 |
|
02-Feb-2023 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: CTRL+S to save the boot order 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>
|
#
45f5319f |
|
02-Feb-2023 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
menu: remove CTRL+C to quit On the sandbox called without "--terminal raw" CTRL+C leaves U-Boot, "ESC/CTRL+C to quit" is misleading. Let's remove CTRL+C to quit key handling from bootmenu and eficonfig menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
|
#
8dbd0a0f |
|
23-Jan-2023 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: add vertical scroll support The current eficonfig menu does not support vertical scroll, so it can not display the menu entries greater than the console row size. This commit add the vertial scroll support. The console size is retrieved by SIMPLE_TEXT_OUTPUT_PROTOCOL.QueryMode() service, then calculates the row size for menu entry by subtracting menu header and description row size from the console row size. "start" and "end" are added in the efimenu structure. "start" keeps the menu entry index at the top, "end" keeps the bottom menu entry index. item_data_print() menu function only draws the menu entry between "start" and "end". This commit also fixes the issue that "Save" and "Quit" entries can be moved by BKEY_PLUS in change boot order menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
0d590852 |
|
23-Jan-2023 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: refactor change boot order implementation This commit removes the change boot order specific menu implementation. The change boot order implementation calls eficonfig_process_common() same as other menus. The change boot order menu requires own item_data_print and item_choice implementation, but display_statusline function can be a same function as other menus. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
cd160b27 |
|
23-Jan-2023 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: refactor eficonfig_process_common function Current change boot order implementation does not call eficonfig_process_common() and call own menu functions for display_statusline, item_data_print and item_choice. Change boot order functionality should call eficonfig_process_common() to improve maintenanceability. This commit is a preparation to remove the change boot order specific implementation. The menu functions (display_statusline, item_data_print and item_choice) are added as argument of eficonfig_process_common(). The menu description string displayed at the bottom of the menu is also added as argument. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
32bab0ea |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Make use of CLI character processing Avoid duplicating some of the escape-sequence processing here and use the CLI function instead. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
d0ca98db |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Update bootmenu_loop() to return the code Use the return value to save having to pass around a pointer. This also resolves any ambiguity about what *key contains when the function is called. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
2da4a15e |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Rename KEY_... to BKEY_... This enum values conflict with linux/input.h so rename them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
64550274 |
|
18-Dec-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: avoid SetVariable between GetNextVariableName calls The current code calls efi_set_variable_int() to delete the invalid boot option between calls to efi_get_next_variable_name_int(), it may produce unpredictable results. This commit moves removal of the invalid boot option outside of the efi_get_next_variable_name_int() calls. EFI_NOT_FOUND returned from efi_get_next_variable_name_int() indicates we retrieved all EFI variables, it should be treated as EFI_SUCEESS. To address the checkpatch warning of too many leading tabs, combine two if statement into one. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
ce327084 |
|
18-Dec-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: carve out efi_get_next_variable_name_int calls To retrieve the EFI variable name by efi_get_next_variable_name_int(), the sequence of alloc -> efi_get_next_variable_name_int -> realloc -> efi_get_next_variable_name_int is required. In current code, this sequence repeatedly appears in the several functions. It should be curved out a common function. This commit also fixes the missing free() of var_name16 in eficonfig_delete_invalid_boot_option(). Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
140a8959 |
|
01-Dec-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: use efi_get_next_variable_name_int() eficonfig command reads all possible UEFI load options from 0x0000 to 0xFFFF to construct the menu. This takes too much time in some environment. This commit uses efi_get_next_variable_name_int() to read all existing UEFI load options to significantlly reduce the count of efi_get_var() call. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
78b1ccc4 |
|
01-Dec-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: use u16_strsize() to get u16 string buffer size Use u16_strsize() to simplify the u16 string buffer size calculation. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c67d3c9e |
|
01-Dec-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: fix going one directory up issue The directory name in eficonfig menu entry contains the '\' separator. strcmp() argument ".." is wrong and one directory up handling does not work correctly. strcmp() argument must include '\' separator. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c3b5af63 |
|
19-Nov-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: add UEFI Secure Boot Key enrollment interface This commit adds the menu-driven UEFI Secure Boot Key enrollment interface. User can enroll PK, KEK, db and dbx by selecting file. Only the signed EFI Signature List(s) with an authenticated header, typically '.auth' file, is accepted. To clear the PK, KEK, db and dbx, user needs to enroll the null key signed by PK or KEK. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
21faf4ef |
|
19-Nov-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: use protocol interface for file selection EFI_SIMPLE_FILE_SYSTEM_PROTOCOL is not always provided by U-Boot. Use protocol interface functions instead of U-Boot internal functions. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d6566113 |
|
19-Nov-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: expose eficonfig_create_device_path() Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use eficonfig_create_device_path() to construct the full device path from device path of the volume and file path, so move it out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d571f9b2 |
|
19-Nov-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: refactor change boot order implementation All the eficonfig menus other than "Change Boot Order" use 'eficonfig_entry' structure for each menu entry. This commit refactors change boot order implementation to use 'eficonfig_entry' structure same as other menus to have consistent menu handling. This commit also simplifies the data->active handling when KEY_SPACE is pressed, and sizeof() parameter. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
8961e93e |
|
19-Nov-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: expose append entry function Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use append_entry() and append_quit_entry() to construct the menu, so move them out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
a84040ab |
|
19-Nov-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: refactor file selection handling eficonfig_select_file_handler() is commonly used to select the file. eficonfig_display_select_file_option() adds an additional menu to clear the selected file. eficonfig_display_select_file_option() is not always necessary for the file selection process, so it must be outside of eficonfig_select_file_handler(). This commit also renames the following functions to avoid confusion. eficonfig_select_file_handler() -> eficonfig_process_select_file() eficonfig_select_file() -> eficonfig_show_file_selection() eficonfig_display_select_file_option() -> eficonfig_process_show_file_option() Finally, test_eficonfig.py need to be updated to get aligned with the above modification. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
1167e88a |
|
14-Nov-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: fix missing variable initialization The 'ret' variable must be initialized before use in eficonfig_delete_invalid_boot_option(). Fixes: c416f1c0bc ("bootmenu: add removable media entries") Addresses-Coverity: 376207 ("Uninitialized variables") Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
3d595ac5 |
|
09-Nov-2022 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: remove superfluous if in eficonfig_edit_boot_option Goto for an immediately succeeding label is superfluous. Fixes: 87d791423ac6 ("eficonfig: menu-driven addition of UEFI boot option") Addresses-Coverity: 376202 ("Identical code for different branches") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
f19171c9 |
|
08-Jan-2024 |
Ilias Apalodimas <ilias.apalodimas@linaro.org> |
efi_loader: Clean up efi_dp_append and efi_dp_concat Looking back at the initrd storing functionality, we introduced three functions, efi_dp_append_or_concatenate(), efi_dp_append/concat(). In hindsight we could have simplified that by a lot. First of all none of the functions append anything. They all allocate a new device path and concatenate the contents of two device paths in one. A boolean parameter controls the final device path -- if that's true an end node is injected between the two device paths. So let's rewrite this and make it a bit easier to read. Get rid of efi_dp_append(), efi_dp_concat() and rename efi_dp_append_or_concatenate() to efi_dp_concat(). This is far more intuitive and the only adjustment that is needed is an extra boolean argument on all callsites. Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
64658007 |
|
17-Nov-2023 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: eficonfig: create shortened boot options The boot options created by eficonfig should use shortened device-paths to avoid problems if drives are enumerated in a different sequence. Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
9945bc4f |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Fix incorrect return code of boot option update Correct the return code for out-of-memory and no boot option found Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
339b527b |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Move bootorder and bootoption apis to lib Rename and move bootorder and bootoption apis from cmd to lib for re-use between eficonfig and bootmgr Fix 'unexpected indentation' when 'make htmldocs' after functions are moved Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
2c0b0c31 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_SECURE_BOOT This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_SECURE_BOOT defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
83f3d121 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_MM_COMM_TEE This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_MM_COMM_TEE defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
88df3634 |
|
02-Feb-2023 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: CTRL+S to save the boot order 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>
|
#
45f5319f |
|
02-Feb-2023 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
menu: remove CTRL+C to quit On the sandbox called without "--terminal raw" CTRL+C leaves U-Boot, "ESC/CTRL+C to quit" is misleading. Let's remove CTRL+C to quit key handling from bootmenu and eficonfig menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
|
#
8dbd0a0f |
|
23-Jan-2023 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: add vertical scroll support The current eficonfig menu does not support vertical scroll, so it can not display the menu entries greater than the console row size. This commit add the vertial scroll support. The console size is retrieved by SIMPLE_TEXT_OUTPUT_PROTOCOL.QueryMode() service, then calculates the row size for menu entry by subtracting menu header and description row size from the console row size. "start" and "end" are added in the efimenu structure. "start" keeps the menu entry index at the top, "end" keeps the bottom menu entry index. item_data_print() menu function only draws the menu entry between "start" and "end". This commit also fixes the issue that "Save" and "Quit" entries can be moved by BKEY_PLUS in change boot order menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
0d590852 |
|
23-Jan-2023 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: refactor change boot order implementation This commit removes the change boot order specific menu implementation. The change boot order implementation calls eficonfig_process_common() same as other menus. The change boot order menu requires own item_data_print and item_choice implementation, but display_statusline function can be a same function as other menus. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
cd160b27 |
|
23-Jan-2023 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: refactor eficonfig_process_common function Current change boot order implementation does not call eficonfig_process_common() and call own menu functions for display_statusline, item_data_print and item_choice. Change boot order functionality should call eficonfig_process_common() to improve maintenanceability. This commit is a preparation to remove the change boot order specific implementation. The menu functions (display_statusline, item_data_print and item_choice) are added as argument of eficonfig_process_common(). The menu description string displayed at the bottom of the menu is also added as argument. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
32bab0ea |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Make use of CLI character processing Avoid duplicating some of the escape-sequence processing here and use the CLI function instead. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
d0ca98db |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Update bootmenu_loop() to return the code Use the return value to save having to pass around a pointer. This also resolves any ambiguity about what *key contains when the function is called. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
2da4a15e |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Rename KEY_... to BKEY_... This enum values conflict with linux/input.h so rename them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
64550274 |
|
18-Dec-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: avoid SetVariable between GetNextVariableName calls The current code calls efi_set_variable_int() to delete the invalid boot option between calls to efi_get_next_variable_name_int(), it may produce unpredictable results. This commit moves removal of the invalid boot option outside of the efi_get_next_variable_name_int() calls. EFI_NOT_FOUND returned from efi_get_next_variable_name_int() indicates we retrieved all EFI variables, it should be treated as EFI_SUCEESS. To address the checkpatch warning of too many leading tabs, combine two if statement into one. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
ce327084 |
|
18-Dec-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: carve out efi_get_next_variable_name_int calls To retrieve the EFI variable name by efi_get_next_variable_name_int(), the sequence of alloc -> efi_get_next_variable_name_int -> realloc -> efi_get_next_variable_name_int is required. In current code, this sequence repeatedly appears in the several functions. It should be curved out a common function. This commit also fixes the missing free() of var_name16 in eficonfig_delete_invalid_boot_option(). Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
140a8959 |
|
01-Dec-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: use efi_get_next_variable_name_int() eficonfig command reads all possible UEFI load options from 0x0000 to 0xFFFF to construct the menu. This takes too much time in some environment. This commit uses efi_get_next_variable_name_int() to read all existing UEFI load options to significantlly reduce the count of efi_get_var() call. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
78b1ccc4 |
|
01-Dec-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: use u16_strsize() to get u16 string buffer size Use u16_strsize() to simplify the u16 string buffer size calculation. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c67d3c9e |
|
01-Dec-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: fix going one directory up issue The directory name in eficonfig menu entry contains the '\' separator. strcmp() argument ".." is wrong and one directory up handling does not work correctly. strcmp() argument must include '\' separator. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c3b5af63 |
|
19-Nov-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: add UEFI Secure Boot Key enrollment interface This commit adds the menu-driven UEFI Secure Boot Key enrollment interface. User can enroll PK, KEK, db and dbx by selecting file. Only the signed EFI Signature List(s) with an authenticated header, typically '.auth' file, is accepted. To clear the PK, KEK, db and dbx, user needs to enroll the null key signed by PK or KEK. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
21faf4ef |
|
19-Nov-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: use protocol interface for file selection EFI_SIMPLE_FILE_SYSTEM_PROTOCOL is not always provided by U-Boot. Use protocol interface functions instead of U-Boot internal functions. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d6566113 |
|
19-Nov-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: expose eficonfig_create_device_path() Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use eficonfig_create_device_path() to construct the full device path from device path of the volume and file path, so move it out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d571f9b2 |
|
19-Nov-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: refactor change boot order implementation All the eficonfig menus other than "Change Boot Order" use 'eficonfig_entry' structure for each menu entry. This commit refactors change boot order implementation to use 'eficonfig_entry' structure same as other menus to have consistent menu handling. This commit also simplifies the data->active handling when KEY_SPACE is pressed, and sizeof() parameter. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
8961e93e |
|
19-Nov-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: expose append entry function Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use append_entry() and append_quit_entry() to construct the menu, so move them out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
a84040ab |
|
19-Nov-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: refactor file selection handling eficonfig_select_file_handler() is commonly used to select the file. eficonfig_display_select_file_option() adds an additional menu to clear the selected file. eficonfig_display_select_file_option() is not always necessary for the file selection process, so it must be outside of eficonfig_select_file_handler(). This commit also renames the following functions to avoid confusion. eficonfig_select_file_handler() -> eficonfig_process_select_file() eficonfig_select_file() -> eficonfig_show_file_selection() eficonfig_display_select_file_option() -> eficonfig_process_show_file_option() Finally, test_eficonfig.py need to be updated to get aligned with the above modification. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
1167e88a |
|
14-Nov-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: fix missing variable initialization The 'ret' variable must be initialized before use in eficonfig_delete_invalid_boot_option(). Fixes: c416f1c0bc ("bootmenu: add removable media entries") Addresses-Coverity: 376207 ("Uninitialized variables") Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
3d595ac5 |
|
09-Nov-2022 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: remove superfluous if in eficonfig_edit_boot_option Goto for an immediately succeeding label is superfluous. Fixes: 87d791423ac6 ("eficonfig: menu-driven addition of UEFI boot option") Addresses-Coverity: 376202 ("Identical code for different branches") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
f19171c9 |
|
08-Jan-2024 |
Ilias Apalodimas <ilias.apalodimas@linaro.org> |
efi_loader: Clean up efi_dp_append and efi_dp_concat Looking back at the initrd storing functionality, we introduced three functions, efi_dp_append_or_concatenate(), efi_dp_append/concat(). In hindsight we could have simplified that by a lot. First of all none of the functions append anything. They all allocate a new device path and concatenate the contents of two device paths in one. A boolean parameter controls the final device path -- if that's true an end node is injected between the two device paths. So let's rewrite this and make it a bit easier to read. Get rid of efi_dp_append(), efi_dp_concat() and rename efi_dp_append_or_concatenate() to efi_dp_concat(). This is far more intuitive and the only adjustment that is needed is an extra boolean argument on all callsites. Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
64658007 |
|
17-Nov-2023 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: eficonfig: create shortened boot options The boot options created by eficonfig should use shortened device-paths to avoid problems if drives are enumerated in a different sequence. Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
9945bc4f |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Fix incorrect return code of boot option update Correct the return code for out-of-memory and no boot option found Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
339b527b |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Move bootorder and bootoption apis to lib Rename and move bootorder and bootoption apis from cmd to lib for re-use between eficonfig and bootmgr Fix 'unexpected indentation' when 'make htmldocs' after functions are moved Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
2c0b0c31 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_SECURE_BOOT This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_SECURE_BOOT defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
83f3d121 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_MM_COMM_TEE This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_MM_COMM_TEE defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
88df3634 |
|
02-Feb-2023 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: CTRL+S to save the boot order 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>
|
#
45f5319f |
|
02-Feb-2023 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
menu: remove CTRL+C to quit On the sandbox called without "--terminal raw" CTRL+C leaves U-Boot, "ESC/CTRL+C to quit" is misleading. Let's remove CTRL+C to quit key handling from bootmenu and eficonfig menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
|
#
8dbd0a0f |
|
23-Jan-2023 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: add vertical scroll support The current eficonfig menu does not support vertical scroll, so it can not display the menu entries greater than the console row size. This commit add the vertial scroll support. The console size is retrieved by SIMPLE_TEXT_OUTPUT_PROTOCOL.QueryMode() service, then calculates the row size for menu entry by subtracting menu header and description row size from the console row size. "start" and "end" are added in the efimenu structure. "start" keeps the menu entry index at the top, "end" keeps the bottom menu entry index. item_data_print() menu function only draws the menu entry between "start" and "end". This commit also fixes the issue that "Save" and "Quit" entries can be moved by BKEY_PLUS in change boot order menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
0d590852 |
|
23-Jan-2023 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: refactor change boot order implementation This commit removes the change boot order specific menu implementation. The change boot order implementation calls eficonfig_process_common() same as other menus. The change boot order menu requires own item_data_print and item_choice implementation, but display_statusline function can be a same function as other menus. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
cd160b27 |
|
23-Jan-2023 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: refactor eficonfig_process_common function Current change boot order implementation does not call eficonfig_process_common() and call own menu functions for display_statusline, item_data_print and item_choice. Change boot order functionality should call eficonfig_process_common() to improve maintenanceability. This commit is a preparation to remove the change boot order specific implementation. The menu functions (display_statusline, item_data_print and item_choice) are added as argument of eficonfig_process_common(). The menu description string displayed at the bottom of the menu is also added as argument. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
32bab0ea |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Make use of CLI character processing Avoid duplicating some of the escape-sequence processing here and use the CLI function instead. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
d0ca98db |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Update bootmenu_loop() to return the code Use the return value to save having to pass around a pointer. This also resolves any ambiguity about what *key contains when the function is called. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
2da4a15e |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Rename KEY_... to BKEY_... This enum values conflict with linux/input.h so rename them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
64550274 |
|
18-Dec-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: avoid SetVariable between GetNextVariableName calls The current code calls efi_set_variable_int() to delete the invalid boot option between calls to efi_get_next_variable_name_int(), it may produce unpredictable results. This commit moves removal of the invalid boot option outside of the efi_get_next_variable_name_int() calls. EFI_NOT_FOUND returned from efi_get_next_variable_name_int() indicates we retrieved all EFI variables, it should be treated as EFI_SUCEESS. To address the checkpatch warning of too many leading tabs, combine two if statement into one. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
ce327084 |
|
18-Dec-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: carve out efi_get_next_variable_name_int calls To retrieve the EFI variable name by efi_get_next_variable_name_int(), the sequence of alloc -> efi_get_next_variable_name_int -> realloc -> efi_get_next_variable_name_int is required. In current code, this sequence repeatedly appears in the several functions. It should be curved out a common function. This commit also fixes the missing free() of var_name16 in eficonfig_delete_invalid_boot_option(). Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
140a8959 |
|
01-Dec-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: use efi_get_next_variable_name_int() eficonfig command reads all possible UEFI load options from 0x0000 to 0xFFFF to construct the menu. This takes too much time in some environment. This commit uses efi_get_next_variable_name_int() to read all existing UEFI load options to significantlly reduce the count of efi_get_var() call. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
78b1ccc4 |
|
01-Dec-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: use u16_strsize() to get u16 string buffer size Use u16_strsize() to simplify the u16 string buffer size calculation. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c67d3c9e |
|
01-Dec-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: fix going one directory up issue The directory name in eficonfig menu entry contains the '\' separator. strcmp() argument ".." is wrong and one directory up handling does not work correctly. strcmp() argument must include '\' separator. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c3b5af63 |
|
19-Nov-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: add UEFI Secure Boot Key enrollment interface This commit adds the menu-driven UEFI Secure Boot Key enrollment interface. User can enroll PK, KEK, db and dbx by selecting file. Only the signed EFI Signature List(s) with an authenticated header, typically '.auth' file, is accepted. To clear the PK, KEK, db and dbx, user needs to enroll the null key signed by PK or KEK. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
21faf4ef |
|
19-Nov-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: use protocol interface for file selection EFI_SIMPLE_FILE_SYSTEM_PROTOCOL is not always provided by U-Boot. Use protocol interface functions instead of U-Boot internal functions. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d6566113 |
|
19-Nov-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: expose eficonfig_create_device_path() Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use eficonfig_create_device_path() to construct the full device path from device path of the volume and file path, so move it out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d571f9b2 |
|
19-Nov-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: refactor change boot order implementation All the eficonfig menus other than "Change Boot Order" use 'eficonfig_entry' structure for each menu entry. This commit refactors change boot order implementation to use 'eficonfig_entry' structure same as other menus to have consistent menu handling. This commit also simplifies the data->active handling when KEY_SPACE is pressed, and sizeof() parameter. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
8961e93e |
|
19-Nov-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: expose append entry function Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use append_entry() and append_quit_entry() to construct the menu, so move them out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
a84040ab |
|
19-Nov-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: refactor file selection handling eficonfig_select_file_handler() is commonly used to select the file. eficonfig_display_select_file_option() adds an additional menu to clear the selected file. eficonfig_display_select_file_option() is not always necessary for the file selection process, so it must be outside of eficonfig_select_file_handler(). This commit also renames the following functions to avoid confusion. eficonfig_select_file_handler() -> eficonfig_process_select_file() eficonfig_select_file() -> eficonfig_show_file_selection() eficonfig_display_select_file_option() -> eficonfig_process_show_file_option() Finally, test_eficonfig.py need to be updated to get aligned with the above modification. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
1167e88a |
|
14-Nov-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: fix missing variable initialization The 'ret' variable must be initialized before use in eficonfig_delete_invalid_boot_option(). Fixes: c416f1c0bc ("bootmenu: add removable media entries") Addresses-Coverity: 376207 ("Uninitialized variables") Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
3d595ac5 |
|
09-Nov-2022 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: remove superfluous if in eficonfig_edit_boot_option Goto for an immediately succeeding label is superfluous. Fixes: 87d791423ac6 ("eficonfig: menu-driven addition of UEFI boot option") Addresses-Coverity: 376202 ("Identical code for different branches") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
f19171c9 |
|
08-Jan-2024 |
Ilias Apalodimas <ilias.apalodimas@linaro.org> |
efi_loader: Clean up efi_dp_append and efi_dp_concat Looking back at the initrd storing functionality, we introduced three functions, efi_dp_append_or_concatenate(), efi_dp_append/concat(). In hindsight we could have simplified that by a lot. First of all none of the functions append anything. They all allocate a new device path and concatenate the contents of two device paths in one. A boolean parameter controls the final device path -- if that's true an end node is injected between the two device paths. So let's rewrite this and make it a bit easier to read. Get rid of efi_dp_append(), efi_dp_concat() and rename efi_dp_append_or_concatenate() to efi_dp_concat(). This is far more intuitive and the only adjustment that is needed is an extra boolean argument on all callsites. Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
64658007 |
|
17-Nov-2023 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: eficonfig: create shortened boot options The boot options created by eficonfig should use shortened device-paths to avoid problems if drives are enumerated in a different sequence. Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
9945bc4f |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Fix incorrect return code of boot option update Correct the return code for out-of-memory and no boot option found Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
339b527b |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Move bootorder and bootoption apis to lib Rename and move bootorder and bootoption apis from cmd to lib for re-use between eficonfig and bootmgr Fix 'unexpected indentation' when 'make htmldocs' after functions are moved Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
2c0b0c31 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_SECURE_BOOT This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_SECURE_BOOT defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
83f3d121 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_MM_COMM_TEE This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_MM_COMM_TEE defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
88df3634 |
|
02-Feb-2023 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: CTRL+S to save the boot order 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>
|
#
45f5319f |
|
02-Feb-2023 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
menu: remove CTRL+C to quit On the sandbox called without "--terminal raw" CTRL+C leaves U-Boot, "ESC/CTRL+C to quit" is misleading. Let's remove CTRL+C to quit key handling from bootmenu and eficonfig menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
|
#
8dbd0a0f |
|
23-Jan-2023 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: add vertical scroll support The current eficonfig menu does not support vertical scroll, so it can not display the menu entries greater than the console row size. This commit add the vertial scroll support. The console size is retrieved by SIMPLE_TEXT_OUTPUT_PROTOCOL.QueryMode() service, then calculates the row size for menu entry by subtracting menu header and description row size from the console row size. "start" and "end" are added in the efimenu structure. "start" keeps the menu entry index at the top, "end" keeps the bottom menu entry index. item_data_print() menu function only draws the menu entry between "start" and "end". This commit also fixes the issue that "Save" and "Quit" entries can be moved by BKEY_PLUS in change boot order menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
0d590852 |
|
23-Jan-2023 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: refactor change boot order implementation This commit removes the change boot order specific menu implementation. The change boot order implementation calls eficonfig_process_common() same as other menus. The change boot order menu requires own item_data_print and item_choice implementation, but display_statusline function can be a same function as other menus. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
cd160b27 |
|
23-Jan-2023 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: refactor eficonfig_process_common function Current change boot order implementation does not call eficonfig_process_common() and call own menu functions for display_statusline, item_data_print and item_choice. Change boot order functionality should call eficonfig_process_common() to improve maintenanceability. This commit is a preparation to remove the change boot order specific implementation. The menu functions (display_statusline, item_data_print and item_choice) are added as argument of eficonfig_process_common(). The menu description string displayed at the bottom of the menu is also added as argument. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
32bab0ea |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Make use of CLI character processing Avoid duplicating some of the escape-sequence processing here and use the CLI function instead. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
d0ca98db |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Update bootmenu_loop() to return the code Use the return value to save having to pass around a pointer. This also resolves any ambiguity about what *key contains when the function is called. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
2da4a15e |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Rename KEY_... to BKEY_... This enum values conflict with linux/input.h so rename them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
64550274 |
|
18-Dec-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: avoid SetVariable between GetNextVariableName calls The current code calls efi_set_variable_int() to delete the invalid boot option between calls to efi_get_next_variable_name_int(), it may produce unpredictable results. This commit moves removal of the invalid boot option outside of the efi_get_next_variable_name_int() calls. EFI_NOT_FOUND returned from efi_get_next_variable_name_int() indicates we retrieved all EFI variables, it should be treated as EFI_SUCEESS. To address the checkpatch warning of too many leading tabs, combine two if statement into one. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
ce327084 |
|
18-Dec-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: carve out efi_get_next_variable_name_int calls To retrieve the EFI variable name by efi_get_next_variable_name_int(), the sequence of alloc -> efi_get_next_variable_name_int -> realloc -> efi_get_next_variable_name_int is required. In current code, this sequence repeatedly appears in the several functions. It should be curved out a common function. This commit also fixes the missing free() of var_name16 in eficonfig_delete_invalid_boot_option(). Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
140a8959 |
|
01-Dec-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: use efi_get_next_variable_name_int() eficonfig command reads all possible UEFI load options from 0x0000 to 0xFFFF to construct the menu. This takes too much time in some environment. This commit uses efi_get_next_variable_name_int() to read all existing UEFI load options to significantlly reduce the count of efi_get_var() call. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
78b1ccc4 |
|
01-Dec-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: use u16_strsize() to get u16 string buffer size Use u16_strsize() to simplify the u16 string buffer size calculation. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c67d3c9e |
|
01-Dec-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: fix going one directory up issue The directory name in eficonfig menu entry contains the '\' separator. strcmp() argument ".." is wrong and one directory up handling does not work correctly. strcmp() argument must include '\' separator. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c3b5af63 |
|
19-Nov-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: add UEFI Secure Boot Key enrollment interface This commit adds the menu-driven UEFI Secure Boot Key enrollment interface. User can enroll PK, KEK, db and dbx by selecting file. Only the signed EFI Signature List(s) with an authenticated header, typically '.auth' file, is accepted. To clear the PK, KEK, db and dbx, user needs to enroll the null key signed by PK or KEK. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
21faf4ef |
|
19-Nov-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: use protocol interface for file selection EFI_SIMPLE_FILE_SYSTEM_PROTOCOL is not always provided by U-Boot. Use protocol interface functions instead of U-Boot internal functions. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d6566113 |
|
19-Nov-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: expose eficonfig_create_device_path() Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use eficonfig_create_device_path() to construct the full device path from device path of the volume and file path, so move it out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d571f9b2 |
|
19-Nov-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: refactor change boot order implementation All the eficonfig menus other than "Change Boot Order" use 'eficonfig_entry' structure for each menu entry. This commit refactors change boot order implementation to use 'eficonfig_entry' structure same as other menus to have consistent menu handling. This commit also simplifies the data->active handling when KEY_SPACE is pressed, and sizeof() parameter. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
8961e93e |
|
19-Nov-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: expose append entry function Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use append_entry() and append_quit_entry() to construct the menu, so move them out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
a84040ab |
|
19-Nov-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: refactor file selection handling eficonfig_select_file_handler() is commonly used to select the file. eficonfig_display_select_file_option() adds an additional menu to clear the selected file. eficonfig_display_select_file_option() is not always necessary for the file selection process, so it must be outside of eficonfig_select_file_handler(). This commit also renames the following functions to avoid confusion. eficonfig_select_file_handler() -> eficonfig_process_select_file() eficonfig_select_file() -> eficonfig_show_file_selection() eficonfig_display_select_file_option() -> eficonfig_process_show_file_option() Finally, test_eficonfig.py need to be updated to get aligned with the above modification. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
1167e88a |
|
14-Nov-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: fix missing variable initialization The 'ret' variable must be initialized before use in eficonfig_delete_invalid_boot_option(). Fixes: c416f1c0bc ("bootmenu: add removable media entries") Addresses-Coverity: 376207 ("Uninitialized variables") Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
3d595ac5 |
|
09-Nov-2022 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: remove superfluous if in eficonfig_edit_boot_option Goto for an immediately succeeding label is superfluous. Fixes: 87d791423ac6 ("eficonfig: menu-driven addition of UEFI boot option") Addresses-Coverity: 376202 ("Identical code for different branches") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
f19171c9 |
|
08-Jan-2024 |
Ilias Apalodimas <ilias.apalodimas@linaro.org> |
efi_loader: Clean up efi_dp_append and efi_dp_concat Looking back at the initrd storing functionality, we introduced three functions, efi_dp_append_or_concatenate(), efi_dp_append/concat(). In hindsight we could have simplified that by a lot. First of all none of the functions append anything. They all allocate a new device path and concatenate the contents of two device paths in one. A boolean parameter controls the final device path -- if that's true an end node is injected between the two device paths. So let's rewrite this and make it a bit easier to read. Get rid of efi_dp_append(), efi_dp_concat() and rename efi_dp_append_or_concatenate() to efi_dp_concat(). This is far more intuitive and the only adjustment that is needed is an extra boolean argument on all callsites. Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
64658007 |
|
17-Nov-2023 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: eficonfig: create shortened boot options The boot options created by eficonfig should use shortened device-paths to avoid problems if drives are enumerated in a different sequence. Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
9945bc4f |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Fix incorrect return code of boot option update Correct the return code for out-of-memory and no boot option found Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
339b527b |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Move bootorder and bootoption apis to lib Rename and move bootorder and bootoption apis from cmd to lib for re-use between eficonfig and bootmgr Fix 'unexpected indentation' when 'make htmldocs' after functions are moved Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
2c0b0c31 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_SECURE_BOOT This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_SECURE_BOOT defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
83f3d121 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_MM_COMM_TEE This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_MM_COMM_TEE defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
88df3634 |
|
02-Feb-2023 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: CTRL+S to save the boot order 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>
|
#
45f5319f |
|
02-Feb-2023 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
menu: remove CTRL+C to quit On the sandbox called without "--terminal raw" CTRL+C leaves U-Boot, "ESC/CTRL+C to quit" is misleading. Let's remove CTRL+C to quit key handling from bootmenu and eficonfig menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
|
#
8dbd0a0f |
|
23-Jan-2023 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: add vertical scroll support The current eficonfig menu does not support vertical scroll, so it can not display the menu entries greater than the console row size. This commit add the vertial scroll support. The console size is retrieved by SIMPLE_TEXT_OUTPUT_PROTOCOL.QueryMode() service, then calculates the row size for menu entry by subtracting menu header and description row size from the console row size. "start" and "end" are added in the efimenu structure. "start" keeps the menu entry index at the top, "end" keeps the bottom menu entry index. item_data_print() menu function only draws the menu entry between "start" and "end". This commit also fixes the issue that "Save" and "Quit" entries can be moved by BKEY_PLUS in change boot order menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
0d590852 |
|
23-Jan-2023 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: refactor change boot order implementation This commit removes the change boot order specific menu implementation. The change boot order implementation calls eficonfig_process_common() same as other menus. The change boot order menu requires own item_data_print and item_choice implementation, but display_statusline function can be a same function as other menus. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
cd160b27 |
|
23-Jan-2023 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: refactor eficonfig_process_common function Current change boot order implementation does not call eficonfig_process_common() and call own menu functions for display_statusline, item_data_print and item_choice. Change boot order functionality should call eficonfig_process_common() to improve maintenanceability. This commit is a preparation to remove the change boot order specific implementation. The menu functions (display_statusline, item_data_print and item_choice) are added as argument of eficonfig_process_common(). The menu description string displayed at the bottom of the menu is also added as argument. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
32bab0ea |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Make use of CLI character processing Avoid duplicating some of the escape-sequence processing here and use the CLI function instead. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
d0ca98db |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Update bootmenu_loop() to return the code Use the return value to save having to pass around a pointer. This also resolves any ambiguity about what *key contains when the function is called. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
2da4a15e |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Rename KEY_... to BKEY_... This enum values conflict with linux/input.h so rename them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
64550274 |
|
18-Dec-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: avoid SetVariable between GetNextVariableName calls The current code calls efi_set_variable_int() to delete the invalid boot option between calls to efi_get_next_variable_name_int(), it may produce unpredictable results. This commit moves removal of the invalid boot option outside of the efi_get_next_variable_name_int() calls. EFI_NOT_FOUND returned from efi_get_next_variable_name_int() indicates we retrieved all EFI variables, it should be treated as EFI_SUCEESS. To address the checkpatch warning of too many leading tabs, combine two if statement into one. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
ce327084 |
|
18-Dec-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: carve out efi_get_next_variable_name_int calls To retrieve the EFI variable name by efi_get_next_variable_name_int(), the sequence of alloc -> efi_get_next_variable_name_int -> realloc -> efi_get_next_variable_name_int is required. In current code, this sequence repeatedly appears in the several functions. It should be curved out a common function. This commit also fixes the missing free() of var_name16 in eficonfig_delete_invalid_boot_option(). Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
140a8959 |
|
01-Dec-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: use efi_get_next_variable_name_int() eficonfig command reads all possible UEFI load options from 0x0000 to 0xFFFF to construct the menu. This takes too much time in some environment. This commit uses efi_get_next_variable_name_int() to read all existing UEFI load options to significantlly reduce the count of efi_get_var() call. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
78b1ccc4 |
|
01-Dec-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: use u16_strsize() to get u16 string buffer size Use u16_strsize() to simplify the u16 string buffer size calculation. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c67d3c9e |
|
01-Dec-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: fix going one directory up issue The directory name in eficonfig menu entry contains the '\' separator. strcmp() argument ".." is wrong and one directory up handling does not work correctly. strcmp() argument must include '\' separator. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c3b5af63 |
|
19-Nov-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: add UEFI Secure Boot Key enrollment interface This commit adds the menu-driven UEFI Secure Boot Key enrollment interface. User can enroll PK, KEK, db and dbx by selecting file. Only the signed EFI Signature List(s) with an authenticated header, typically '.auth' file, is accepted. To clear the PK, KEK, db and dbx, user needs to enroll the null key signed by PK or KEK. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
21faf4ef |
|
19-Nov-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: use protocol interface for file selection EFI_SIMPLE_FILE_SYSTEM_PROTOCOL is not always provided by U-Boot. Use protocol interface functions instead of U-Boot internal functions. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d6566113 |
|
19-Nov-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: expose eficonfig_create_device_path() Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use eficonfig_create_device_path() to construct the full device path from device path of the volume and file path, so move it out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d571f9b2 |
|
19-Nov-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: refactor change boot order implementation All the eficonfig menus other than "Change Boot Order" use 'eficonfig_entry' structure for each menu entry. This commit refactors change boot order implementation to use 'eficonfig_entry' structure same as other menus to have consistent menu handling. This commit also simplifies the data->active handling when KEY_SPACE is pressed, and sizeof() parameter. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
8961e93e |
|
19-Nov-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: expose append entry function Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use append_entry() and append_quit_entry() to construct the menu, so move them out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
a84040ab |
|
19-Nov-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: refactor file selection handling eficonfig_select_file_handler() is commonly used to select the file. eficonfig_display_select_file_option() adds an additional menu to clear the selected file. eficonfig_display_select_file_option() is not always necessary for the file selection process, so it must be outside of eficonfig_select_file_handler(). This commit also renames the following functions to avoid confusion. eficonfig_select_file_handler() -> eficonfig_process_select_file() eficonfig_select_file() -> eficonfig_show_file_selection() eficonfig_display_select_file_option() -> eficonfig_process_show_file_option() Finally, test_eficonfig.py need to be updated to get aligned with the above modification. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
1167e88a |
|
14-Nov-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: fix missing variable initialization The 'ret' variable must be initialized before use in eficonfig_delete_invalid_boot_option(). Fixes: c416f1c0bc ("bootmenu: add removable media entries") Addresses-Coverity: 376207 ("Uninitialized variables") Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
3d595ac5 |
|
09-Nov-2022 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: remove superfluous if in eficonfig_edit_boot_option Goto for an immediately succeeding label is superfluous. Fixes: 87d791423ac6 ("eficonfig: menu-driven addition of UEFI boot option") Addresses-Coverity: 376202 ("Identical code for different branches") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
f19171c9 |
|
08-Jan-2024 |
Ilias Apalodimas <ilias.apalodimas@linaro.org> |
efi_loader: Clean up efi_dp_append and efi_dp_concat Looking back at the initrd storing functionality, we introduced three functions, efi_dp_append_or_concatenate(), efi_dp_append/concat(). In hindsight we could have simplified that by a lot. First of all none of the functions append anything. They all allocate a new device path and concatenate the contents of two device paths in one. A boolean parameter controls the final device path -- if that's true an end node is injected between the two device paths. So let's rewrite this and make it a bit easier to read. Get rid of efi_dp_append(), efi_dp_concat() and rename efi_dp_append_or_concatenate() to efi_dp_concat(). This is far more intuitive and the only adjustment that is needed is an extra boolean argument on all callsites. Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
64658007 |
|
17-Nov-2023 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: eficonfig: create shortened boot options The boot options created by eficonfig should use shortened device-paths to avoid problems if drives are enumerated in a different sequence. Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
9945bc4f |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Fix incorrect return code of boot option update Correct the return code for out-of-memory and no boot option found Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
339b527b |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Move bootorder and bootoption apis to lib Rename and move bootorder and bootoption apis from cmd to lib for re-use between eficonfig and bootmgr Fix 'unexpected indentation' when 'make htmldocs' after functions are moved Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
2c0b0c31 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_SECURE_BOOT This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_SECURE_BOOT defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
83f3d121 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_MM_COMM_TEE This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_MM_COMM_TEE defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
88df3634 |
|
02-Feb-2023 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: CTRL+S to save the boot order 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>
|
#
45f5319f |
|
02-Feb-2023 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
menu: remove CTRL+C to quit On the sandbox called without "--terminal raw" CTRL+C leaves U-Boot, "ESC/CTRL+C to quit" is misleading. Let's remove CTRL+C to quit key handling from bootmenu and eficonfig menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
|
#
8dbd0a0f |
|
23-Jan-2023 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: add vertical scroll support The current eficonfig menu does not support vertical scroll, so it can not display the menu entries greater than the console row size. This commit add the vertial scroll support. The console size is retrieved by SIMPLE_TEXT_OUTPUT_PROTOCOL.QueryMode() service, then calculates the row size for menu entry by subtracting menu header and description row size from the console row size. "start" and "end" are added in the efimenu structure. "start" keeps the menu entry index at the top, "end" keeps the bottom menu entry index. item_data_print() menu function only draws the menu entry between "start" and "end". This commit also fixes the issue that "Save" and "Quit" entries can be moved by BKEY_PLUS in change boot order menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
0d590852 |
|
23-Jan-2023 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: refactor change boot order implementation This commit removes the change boot order specific menu implementation. The change boot order implementation calls eficonfig_process_common() same as other menus. The change boot order menu requires own item_data_print and item_choice implementation, but display_statusline function can be a same function as other menus. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
cd160b27 |
|
23-Jan-2023 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: refactor eficonfig_process_common function Current change boot order implementation does not call eficonfig_process_common() and call own menu functions for display_statusline, item_data_print and item_choice. Change boot order functionality should call eficonfig_process_common() to improve maintenanceability. This commit is a preparation to remove the change boot order specific implementation. The menu functions (display_statusline, item_data_print and item_choice) are added as argument of eficonfig_process_common(). The menu description string displayed at the bottom of the menu is also added as argument. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
32bab0ea |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Make use of CLI character processing Avoid duplicating some of the escape-sequence processing here and use the CLI function instead. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
d0ca98db |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Update bootmenu_loop() to return the code Use the return value to save having to pass around a pointer. This also resolves any ambiguity about what *key contains when the function is called. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
2da4a15e |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Rename KEY_... to BKEY_... This enum values conflict with linux/input.h so rename them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
64550274 |
|
18-Dec-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: avoid SetVariable between GetNextVariableName calls The current code calls efi_set_variable_int() to delete the invalid boot option between calls to efi_get_next_variable_name_int(), it may produce unpredictable results. This commit moves removal of the invalid boot option outside of the efi_get_next_variable_name_int() calls. EFI_NOT_FOUND returned from efi_get_next_variable_name_int() indicates we retrieved all EFI variables, it should be treated as EFI_SUCEESS. To address the checkpatch warning of too many leading tabs, combine two if statement into one. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
ce327084 |
|
18-Dec-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: carve out efi_get_next_variable_name_int calls To retrieve the EFI variable name by efi_get_next_variable_name_int(), the sequence of alloc -> efi_get_next_variable_name_int -> realloc -> efi_get_next_variable_name_int is required. In current code, this sequence repeatedly appears in the several functions. It should be curved out a common function. This commit also fixes the missing free() of var_name16 in eficonfig_delete_invalid_boot_option(). Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
140a8959 |
|
01-Dec-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: use efi_get_next_variable_name_int() eficonfig command reads all possible UEFI load options from 0x0000 to 0xFFFF to construct the menu. This takes too much time in some environment. This commit uses efi_get_next_variable_name_int() to read all existing UEFI load options to significantlly reduce the count of efi_get_var() call. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
78b1ccc4 |
|
01-Dec-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: use u16_strsize() to get u16 string buffer size Use u16_strsize() to simplify the u16 string buffer size calculation. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c67d3c9e |
|
01-Dec-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: fix going one directory up issue The directory name in eficonfig menu entry contains the '\' separator. strcmp() argument ".." is wrong and one directory up handling does not work correctly. strcmp() argument must include '\' separator. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c3b5af63 |
|
19-Nov-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: add UEFI Secure Boot Key enrollment interface This commit adds the menu-driven UEFI Secure Boot Key enrollment interface. User can enroll PK, KEK, db and dbx by selecting file. Only the signed EFI Signature List(s) with an authenticated header, typically '.auth' file, is accepted. To clear the PK, KEK, db and dbx, user needs to enroll the null key signed by PK or KEK. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
21faf4ef |
|
19-Nov-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: use protocol interface for file selection EFI_SIMPLE_FILE_SYSTEM_PROTOCOL is not always provided by U-Boot. Use protocol interface functions instead of U-Boot internal functions. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d6566113 |
|
19-Nov-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: expose eficonfig_create_device_path() Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use eficonfig_create_device_path() to construct the full device path from device path of the volume and file path, so move it out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d571f9b2 |
|
19-Nov-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: refactor change boot order implementation All the eficonfig menus other than "Change Boot Order" use 'eficonfig_entry' structure for each menu entry. This commit refactors change boot order implementation to use 'eficonfig_entry' structure same as other menus to have consistent menu handling. This commit also simplifies the data->active handling when KEY_SPACE is pressed, and sizeof() parameter. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
8961e93e |
|
19-Nov-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: expose append entry function Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use append_entry() and append_quit_entry() to construct the menu, so move them out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
a84040ab |
|
19-Nov-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: refactor file selection handling eficonfig_select_file_handler() is commonly used to select the file. eficonfig_display_select_file_option() adds an additional menu to clear the selected file. eficonfig_display_select_file_option() is not always necessary for the file selection process, so it must be outside of eficonfig_select_file_handler(). This commit also renames the following functions to avoid confusion. eficonfig_select_file_handler() -> eficonfig_process_select_file() eficonfig_select_file() -> eficonfig_show_file_selection() eficonfig_display_select_file_option() -> eficonfig_process_show_file_option() Finally, test_eficonfig.py need to be updated to get aligned with the above modification. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
1167e88a |
|
14-Nov-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: fix missing variable initialization The 'ret' variable must be initialized before use in eficonfig_delete_invalid_boot_option(). Fixes: c416f1c0bc ("bootmenu: add removable media entries") Addresses-Coverity: 376207 ("Uninitialized variables") Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
3d595ac5 |
|
09-Nov-2022 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: remove superfluous if in eficonfig_edit_boot_option Goto for an immediately succeeding label is superfluous. Fixes: 87d791423ac6 ("eficonfig: menu-driven addition of UEFI boot option") Addresses-Coverity: 376202 ("Identical code for different branches") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
f19171c9 |
|
08-Jan-2024 |
Ilias Apalodimas <ilias.apalodimas@linaro.org> |
efi_loader: Clean up efi_dp_append and efi_dp_concat Looking back at the initrd storing functionality, we introduced three functions, efi_dp_append_or_concatenate(), efi_dp_append/concat(). In hindsight we could have simplified that by a lot. First of all none of the functions append anything. They all allocate a new device path and concatenate the contents of two device paths in one. A boolean parameter controls the final device path -- if that's true an end node is injected between the two device paths. So let's rewrite this and make it a bit easier to read. Get rid of efi_dp_append(), efi_dp_concat() and rename efi_dp_append_or_concatenate() to efi_dp_concat(). This is far more intuitive and the only adjustment that is needed is an extra boolean argument on all callsites. Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
64658007 |
|
17-Nov-2023 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: eficonfig: create shortened boot options The boot options created by eficonfig should use shortened device-paths to avoid problems if drives are enumerated in a different sequence. Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
9945bc4f |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Fix incorrect return code of boot option update Correct the return code for out-of-memory and no boot option found Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
339b527b |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Move bootorder and bootoption apis to lib Rename and move bootorder and bootoption apis from cmd to lib for re-use between eficonfig and bootmgr Fix 'unexpected indentation' when 'make htmldocs' after functions are moved Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
2c0b0c31 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_SECURE_BOOT This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_SECURE_BOOT defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
83f3d121 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_MM_COMM_TEE This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_MM_COMM_TEE defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
88df3634 |
|
02-Feb-2023 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: CTRL+S to save the boot order 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>
|
#
45f5319f |
|
02-Feb-2023 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
menu: remove CTRL+C to quit On the sandbox called without "--terminal raw" CTRL+C leaves U-Boot, "ESC/CTRL+C to quit" is misleading. Let's remove CTRL+C to quit key handling from bootmenu and eficonfig menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
|
#
8dbd0a0f |
|
23-Jan-2023 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: add vertical scroll support The current eficonfig menu does not support vertical scroll, so it can not display the menu entries greater than the console row size. This commit add the vertial scroll support. The console size is retrieved by SIMPLE_TEXT_OUTPUT_PROTOCOL.QueryMode() service, then calculates the row size for menu entry by subtracting menu header and description row size from the console row size. "start" and "end" are added in the efimenu structure. "start" keeps the menu entry index at the top, "end" keeps the bottom menu entry index. item_data_print() menu function only draws the menu entry between "start" and "end". This commit also fixes the issue that "Save" and "Quit" entries can be moved by BKEY_PLUS in change boot order menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
0d590852 |
|
23-Jan-2023 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: refactor change boot order implementation This commit removes the change boot order specific menu implementation. The change boot order implementation calls eficonfig_process_common() same as other menus. The change boot order menu requires own item_data_print and item_choice implementation, but display_statusline function can be a same function as other menus. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
cd160b27 |
|
23-Jan-2023 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: refactor eficonfig_process_common function Current change boot order implementation does not call eficonfig_process_common() and call own menu functions for display_statusline, item_data_print and item_choice. Change boot order functionality should call eficonfig_process_common() to improve maintenanceability. This commit is a preparation to remove the change boot order specific implementation. The menu functions (display_statusline, item_data_print and item_choice) are added as argument of eficonfig_process_common(). The menu description string displayed at the bottom of the menu is also added as argument. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
32bab0ea |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Make use of CLI character processing Avoid duplicating some of the escape-sequence processing here and use the CLI function instead. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
d0ca98db |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Update bootmenu_loop() to return the code Use the return value to save having to pass around a pointer. This also resolves any ambiguity about what *key contains when the function is called. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
2da4a15e |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Rename KEY_... to BKEY_... This enum values conflict with linux/input.h so rename them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
64550274 |
|
18-Dec-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: avoid SetVariable between GetNextVariableName calls The current code calls efi_set_variable_int() to delete the invalid boot option between calls to efi_get_next_variable_name_int(), it may produce unpredictable results. This commit moves removal of the invalid boot option outside of the efi_get_next_variable_name_int() calls. EFI_NOT_FOUND returned from efi_get_next_variable_name_int() indicates we retrieved all EFI variables, it should be treated as EFI_SUCEESS. To address the checkpatch warning of too many leading tabs, combine two if statement into one. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
ce327084 |
|
18-Dec-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: carve out efi_get_next_variable_name_int calls To retrieve the EFI variable name by efi_get_next_variable_name_int(), the sequence of alloc -> efi_get_next_variable_name_int -> realloc -> efi_get_next_variable_name_int is required. In current code, this sequence repeatedly appears in the several functions. It should be curved out a common function. This commit also fixes the missing free() of var_name16 in eficonfig_delete_invalid_boot_option(). Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
140a8959 |
|
01-Dec-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: use efi_get_next_variable_name_int() eficonfig command reads all possible UEFI load options from 0x0000 to 0xFFFF to construct the menu. This takes too much time in some environment. This commit uses efi_get_next_variable_name_int() to read all existing UEFI load options to significantlly reduce the count of efi_get_var() call. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
78b1ccc4 |
|
01-Dec-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: use u16_strsize() to get u16 string buffer size Use u16_strsize() to simplify the u16 string buffer size calculation. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c67d3c9e |
|
01-Dec-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: fix going one directory up issue The directory name in eficonfig menu entry contains the '\' separator. strcmp() argument ".." is wrong and one directory up handling does not work correctly. strcmp() argument must include '\' separator. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c3b5af63 |
|
19-Nov-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: add UEFI Secure Boot Key enrollment interface This commit adds the menu-driven UEFI Secure Boot Key enrollment interface. User can enroll PK, KEK, db and dbx by selecting file. Only the signed EFI Signature List(s) with an authenticated header, typically '.auth' file, is accepted. To clear the PK, KEK, db and dbx, user needs to enroll the null key signed by PK or KEK. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
21faf4ef |
|
19-Nov-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: use protocol interface for file selection EFI_SIMPLE_FILE_SYSTEM_PROTOCOL is not always provided by U-Boot. Use protocol interface functions instead of U-Boot internal functions. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d6566113 |
|
19-Nov-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: expose eficonfig_create_device_path() Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use eficonfig_create_device_path() to construct the full device path from device path of the volume and file path, so move it out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d571f9b2 |
|
19-Nov-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: refactor change boot order implementation All the eficonfig menus other than "Change Boot Order" use 'eficonfig_entry' structure for each menu entry. This commit refactors change boot order implementation to use 'eficonfig_entry' structure same as other menus to have consistent menu handling. This commit also simplifies the data->active handling when KEY_SPACE is pressed, and sizeof() parameter. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
8961e93e |
|
19-Nov-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: expose append entry function Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use append_entry() and append_quit_entry() to construct the menu, so move them out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
a84040ab |
|
19-Nov-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: refactor file selection handling eficonfig_select_file_handler() is commonly used to select the file. eficonfig_display_select_file_option() adds an additional menu to clear the selected file. eficonfig_display_select_file_option() is not always necessary for the file selection process, so it must be outside of eficonfig_select_file_handler(). This commit also renames the following functions to avoid confusion. eficonfig_select_file_handler() -> eficonfig_process_select_file() eficonfig_select_file() -> eficonfig_show_file_selection() eficonfig_display_select_file_option() -> eficonfig_process_show_file_option() Finally, test_eficonfig.py need to be updated to get aligned with the above modification. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
1167e88a |
|
14-Nov-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: fix missing variable initialization The 'ret' variable must be initialized before use in eficonfig_delete_invalid_boot_option(). Fixes: c416f1c0bc ("bootmenu: add removable media entries") Addresses-Coverity: 376207 ("Uninitialized variables") Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
3d595ac5 |
|
09-Nov-2022 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: remove superfluous if in eficonfig_edit_boot_option Goto for an immediately succeeding label is superfluous. Fixes: 87d791423ac6 ("eficonfig: menu-driven addition of UEFI boot option") Addresses-Coverity: 376202 ("Identical code for different branches") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <kojima.masahisa@socionext.com> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
f19171c9 |
|
08-Jan-2024 |
Ilias Apalodimas <ilias.apalodimas@linaro.org> |
efi_loader: Clean up efi_dp_append and efi_dp_concat Looking back at the initrd storing functionality, we introduced three functions, efi_dp_append_or_concatenate(), efi_dp_append/concat(). In hindsight we could have simplified that by a lot. First of all none of the functions append anything. They all allocate a new device path and concatenate the contents of two device paths in one. A boolean parameter controls the final device path -- if that's true an end node is injected between the two device paths. So let's rewrite this and make it a bit easier to read. Get rid of efi_dp_append(), efi_dp_concat() and rename efi_dp_append_or_concatenate() to efi_dp_concat(). This is far more intuitive and the only adjustment that is needed is an extra boolean argument on all callsites. Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
64658007 |
|
17-Nov-2023 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: eficonfig: create shortened boot options The boot options created by eficonfig should use shortened device-paths to avoid problems if drives are enumerated in a different sequence. Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
9945bc4f |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Fix incorrect return code of boot option update Correct the return code for out-of-memory and no boot option found Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
339b527b |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Move bootorder and bootoption apis to lib Rename and move bootorder and bootoption apis from cmd to lib for re-use between eficonfig and bootmgr Fix 'unexpected indentation' when 'make htmldocs' after functions are moved Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
2c0b0c31 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_SECURE_BOOT This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_SECURE_BOOT defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
83f3d121 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_MM_COMM_TEE This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_MM_COMM_TEE defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
88df3634 |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: CTRL+S to save the boot order 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>
|
#
45f5319f |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
menu: remove CTRL+C to quit On the sandbox called without "--terminal raw" CTRL+C leaves U-Boot, "ESC/CTRL+C to quit" is misleading. Let's remove CTRL+C to quit key handling from bootmenu and eficonfig menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
|
#
8dbd0a0f |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add vertical scroll support The current eficonfig menu does not support vertical scroll, so it can not display the menu entries greater than the console row size. This commit add the vertial scroll support. The console size is retrieved by SIMPLE_TEXT_OUTPUT_PROTOCOL.QueryMode() service, then calculates the row size for menu entry by subtracting menu header and description row size from the console row size. "start" and "end" are added in the efimenu structure. "start" keeps the menu entry index at the top, "end" keeps the bottom menu entry index. item_data_print() menu function only draws the menu entry between "start" and "end". This commit also fixes the issue that "Save" and "Quit" entries can be moved by BKEY_PLUS in change boot order menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
0d590852 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation This commit removes the change boot order specific menu implementation. The change boot order implementation calls eficonfig_process_common() same as other menus. The change boot order menu requires own item_data_print and item_choice implementation, but display_statusline function can be a same function as other menus. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
cd160b27 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor eficonfig_process_common function Current change boot order implementation does not call eficonfig_process_common() and call own menu functions for display_statusline, item_data_print and item_choice. Change boot order functionality should call eficonfig_process_common() to improve maintenanceability. This commit is a preparation to remove the change boot order specific implementation. The menu functions (display_statusline, item_data_print and item_choice) are added as argument of eficonfig_process_common(). The menu description string displayed at the bottom of the menu is also added as argument. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
32bab0ea |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Make use of CLI character processing Avoid duplicating some of the escape-sequence processing here and use the CLI function instead. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
d0ca98db |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Update bootmenu_loop() to return the code Use the return value to save having to pass around a pointer. This also resolves any ambiguity about what *key contains when the function is called. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
2da4a15e |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Rename KEY_... to BKEY_... This enum values conflict with linux/input.h so rename them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
64550274 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: avoid SetVariable between GetNextVariableName calls The current code calls efi_set_variable_int() to delete the invalid boot option between calls to efi_get_next_variable_name_int(), it may produce unpredictable results. This commit moves removal of the invalid boot option outside of the efi_get_next_variable_name_int() calls. EFI_NOT_FOUND returned from efi_get_next_variable_name_int() indicates we retrieved all EFI variables, it should be treated as EFI_SUCEESS. To address the checkpatch warning of too many leading tabs, combine two if statement into one. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
ce327084 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: carve out efi_get_next_variable_name_int calls To retrieve the EFI variable name by efi_get_next_variable_name_int(), the sequence of alloc -> efi_get_next_variable_name_int -> realloc -> efi_get_next_variable_name_int is required. In current code, this sequence repeatedly appears in the several functions. It should be curved out a common function. This commit also fixes the missing free() of var_name16 in eficonfig_delete_invalid_boot_option(). Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
140a8959 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use efi_get_next_variable_name_int() eficonfig command reads all possible UEFI load options from 0x0000 to 0xFFFF to construct the menu. This takes too much time in some environment. This commit uses efi_get_next_variable_name_int() to read all existing UEFI load options to significantlly reduce the count of efi_get_var() call. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
78b1ccc4 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use u16_strsize() to get u16 string buffer size Use u16_strsize() to simplify the u16 string buffer size calculation. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c67d3c9e |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix going one directory up issue The directory name in eficonfig menu entry contains the '\' separator. strcmp() argument ".." is wrong and one directory up handling does not work correctly. strcmp() argument must include '\' separator. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c3b5af63 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add UEFI Secure Boot Key enrollment interface This commit adds the menu-driven UEFI Secure Boot Key enrollment interface. User can enroll PK, KEK, db and dbx by selecting file. Only the signed EFI Signature List(s) with an authenticated header, typically '.auth' file, is accepted. To clear the PK, KEK, db and dbx, user needs to enroll the null key signed by PK or KEK. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
21faf4ef |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use protocol interface for file selection EFI_SIMPLE_FILE_SYSTEM_PROTOCOL is not always provided by U-Boot. Use protocol interface functions instead of U-Boot internal functions. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d6566113 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose eficonfig_create_device_path() Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use eficonfig_create_device_path() to construct the full device path from device path of the volume and file path, so move it out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d571f9b2 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation All the eficonfig menus other than "Change Boot Order" use 'eficonfig_entry' structure for each menu entry. This commit refactors change boot order implementation to use 'eficonfig_entry' structure same as other menus to have consistent menu handling. This commit also simplifies the data->active handling when KEY_SPACE is pressed, and sizeof() parameter. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
8961e93e |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose append entry function Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use append_entry() and append_quit_entry() to construct the menu, so move them out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
a84040ab |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor file selection handling eficonfig_select_file_handler() is commonly used to select the file. eficonfig_display_select_file_option() adds an additional menu to clear the selected file. eficonfig_display_select_file_option() is not always necessary for the file selection process, so it must be outside of eficonfig_select_file_handler(). This commit also renames the following functions to avoid confusion. eficonfig_select_file_handler() -> eficonfig_process_select_file() eficonfig_select_file() -> eficonfig_show_file_selection() eficonfig_display_select_file_option() -> eficonfig_process_show_file_option() Finally, test_eficonfig.py need to be updated to get aligned with the above modification. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
1167e88a |
|
14-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix missing variable initialization The 'ret' variable must be initialized before use in eficonfig_delete_invalid_boot_option(). Fixes: c416f1c0bc ("bootmenu: add removable media entries") Addresses-Coverity: 376207 ("Uninitialized variables") Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
3d595ac5 |
|
09-Nov-2022 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: remove superfluous if in eficonfig_edit_boot_option Goto for an immediately succeeding label is superfluous. Fixes: 87d791423ac6 ("eficonfig: menu-driven addition of UEFI boot option") Addresses-Coverity: 376202 ("Identical code for different branches") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
f19171c9 |
|
08-Jan-2024 |
Ilias Apalodimas <ilias.apalodimas@linaro.org> |
efi_loader: Clean up efi_dp_append and efi_dp_concat Looking back at the initrd storing functionality, we introduced three functions, efi_dp_append_or_concatenate(), efi_dp_append/concat(). In hindsight we could have simplified that by a lot. First of all none of the functions append anything. They all allocate a new device path and concatenate the contents of two device paths in one. A boolean parameter controls the final device path -- if that's true an end node is injected between the two device paths. So let's rewrite this and make it a bit easier to read. Get rid of efi_dp_append(), efi_dp_concat() and rename efi_dp_append_or_concatenate() to efi_dp_concat(). This is far more intuitive and the only adjustment that is needed is an extra boolean argument on all callsites. Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
64658007 |
|
17-Nov-2023 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: eficonfig: create shortened boot options The boot options created by eficonfig should use shortened device-paths to avoid problems if drives are enumerated in a different sequence. Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
9945bc4f |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Fix incorrect return code of boot option update Correct the return code for out-of-memory and no boot option found Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
339b527b |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Move bootorder and bootoption apis to lib Rename and move bootorder and bootoption apis from cmd to lib for re-use between eficonfig and bootmgr Fix 'unexpected indentation' when 'make htmldocs' after functions are moved Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
2c0b0c31 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_SECURE_BOOT This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_SECURE_BOOT defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
83f3d121 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_MM_COMM_TEE This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_MM_COMM_TEE defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
88df3634 |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: CTRL+S to save the boot order 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>
|
#
45f5319f |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
menu: remove CTRL+C to quit On the sandbox called without "--terminal raw" CTRL+C leaves U-Boot, "ESC/CTRL+C to quit" is misleading. Let's remove CTRL+C to quit key handling from bootmenu and eficonfig menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
|
#
8dbd0a0f |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add vertical scroll support The current eficonfig menu does not support vertical scroll, so it can not display the menu entries greater than the console row size. This commit add the vertial scroll support. The console size is retrieved by SIMPLE_TEXT_OUTPUT_PROTOCOL.QueryMode() service, then calculates the row size for menu entry by subtracting menu header and description row size from the console row size. "start" and "end" are added in the efimenu structure. "start" keeps the menu entry index at the top, "end" keeps the bottom menu entry index. item_data_print() menu function only draws the menu entry between "start" and "end". This commit also fixes the issue that "Save" and "Quit" entries can be moved by BKEY_PLUS in change boot order menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
0d590852 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation This commit removes the change boot order specific menu implementation. The change boot order implementation calls eficonfig_process_common() same as other menus. The change boot order menu requires own item_data_print and item_choice implementation, but display_statusline function can be a same function as other menus. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
cd160b27 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor eficonfig_process_common function Current change boot order implementation does not call eficonfig_process_common() and call own menu functions for display_statusline, item_data_print and item_choice. Change boot order functionality should call eficonfig_process_common() to improve maintenanceability. This commit is a preparation to remove the change boot order specific implementation. The menu functions (display_statusline, item_data_print and item_choice) are added as argument of eficonfig_process_common(). The menu description string displayed at the bottom of the menu is also added as argument. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
32bab0ea |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Make use of CLI character processing Avoid duplicating some of the escape-sequence processing here and use the CLI function instead. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
d0ca98db |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Update bootmenu_loop() to return the code Use the return value to save having to pass around a pointer. This also resolves any ambiguity about what *key contains when the function is called. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
2da4a15e |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Rename KEY_... to BKEY_... This enum values conflict with linux/input.h so rename them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
64550274 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: avoid SetVariable between GetNextVariableName calls The current code calls efi_set_variable_int() to delete the invalid boot option between calls to efi_get_next_variable_name_int(), it may produce unpredictable results. This commit moves removal of the invalid boot option outside of the efi_get_next_variable_name_int() calls. EFI_NOT_FOUND returned from efi_get_next_variable_name_int() indicates we retrieved all EFI variables, it should be treated as EFI_SUCEESS. To address the checkpatch warning of too many leading tabs, combine two if statement into one. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
ce327084 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: carve out efi_get_next_variable_name_int calls To retrieve the EFI variable name by efi_get_next_variable_name_int(), the sequence of alloc -> efi_get_next_variable_name_int -> realloc -> efi_get_next_variable_name_int is required. In current code, this sequence repeatedly appears in the several functions. It should be curved out a common function. This commit also fixes the missing free() of var_name16 in eficonfig_delete_invalid_boot_option(). Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
140a8959 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use efi_get_next_variable_name_int() eficonfig command reads all possible UEFI load options from 0x0000 to 0xFFFF to construct the menu. This takes too much time in some environment. This commit uses efi_get_next_variable_name_int() to read all existing UEFI load options to significantlly reduce the count of efi_get_var() call. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
78b1ccc4 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use u16_strsize() to get u16 string buffer size Use u16_strsize() to simplify the u16 string buffer size calculation. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c67d3c9e |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix going one directory up issue The directory name in eficonfig menu entry contains the '\' separator. strcmp() argument ".." is wrong and one directory up handling does not work correctly. strcmp() argument must include '\' separator. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c3b5af63 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add UEFI Secure Boot Key enrollment interface This commit adds the menu-driven UEFI Secure Boot Key enrollment interface. User can enroll PK, KEK, db and dbx by selecting file. Only the signed EFI Signature List(s) with an authenticated header, typically '.auth' file, is accepted. To clear the PK, KEK, db and dbx, user needs to enroll the null key signed by PK or KEK. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
21faf4ef |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use protocol interface for file selection EFI_SIMPLE_FILE_SYSTEM_PROTOCOL is not always provided by U-Boot. Use protocol interface functions instead of U-Boot internal functions. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d6566113 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose eficonfig_create_device_path() Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use eficonfig_create_device_path() to construct the full device path from device path of the volume and file path, so move it out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d571f9b2 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation All the eficonfig menus other than "Change Boot Order" use 'eficonfig_entry' structure for each menu entry. This commit refactors change boot order implementation to use 'eficonfig_entry' structure same as other menus to have consistent menu handling. This commit also simplifies the data->active handling when KEY_SPACE is pressed, and sizeof() parameter. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
8961e93e |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose append entry function Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use append_entry() and append_quit_entry() to construct the menu, so move them out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
a84040ab |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor file selection handling eficonfig_select_file_handler() is commonly used to select the file. eficonfig_display_select_file_option() adds an additional menu to clear the selected file. eficonfig_display_select_file_option() is not always necessary for the file selection process, so it must be outside of eficonfig_select_file_handler(). This commit also renames the following functions to avoid confusion. eficonfig_select_file_handler() -> eficonfig_process_select_file() eficonfig_select_file() -> eficonfig_show_file_selection() eficonfig_display_select_file_option() -> eficonfig_process_show_file_option() Finally, test_eficonfig.py need to be updated to get aligned with the above modification. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
1167e88a |
|
14-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix missing variable initialization The 'ret' variable must be initialized before use in eficonfig_delete_invalid_boot_option(). Fixes: c416f1c0bc ("bootmenu: add removable media entries") Addresses-Coverity: 376207 ("Uninitialized variables") Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
3d595ac5 |
|
09-Nov-2022 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: remove superfluous if in eficonfig_edit_boot_option Goto for an immediately succeeding label is superfluous. Fixes: 87d791423ac6 ("eficonfig: menu-driven addition of UEFI boot option") Addresses-Coverity: 376202 ("Identical code for different branches") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
f19171c9 |
|
08-Jan-2024 |
Ilias Apalodimas <ilias.apalodimas@linaro.org> |
efi_loader: Clean up efi_dp_append and efi_dp_concat Looking back at the initrd storing functionality, we introduced three functions, efi_dp_append_or_concatenate(), efi_dp_append/concat(). In hindsight we could have simplified that by a lot. First of all none of the functions append anything. They all allocate a new device path and concatenate the contents of two device paths in one. A boolean parameter controls the final device path -- if that's true an end node is injected between the two device paths. So let's rewrite this and make it a bit easier to read. Get rid of efi_dp_append(), efi_dp_concat() and rename efi_dp_append_or_concatenate() to efi_dp_concat(). This is far more intuitive and the only adjustment that is needed is an extra boolean argument on all callsites. Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
64658007 |
|
17-Nov-2023 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: eficonfig: create shortened boot options The boot options created by eficonfig should use shortened device-paths to avoid problems if drives are enumerated in a different sequence. Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
9945bc4f |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Fix incorrect return code of boot option update Correct the return code for out-of-memory and no boot option found Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
339b527b |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Move bootorder and bootoption apis to lib Rename and move bootorder and bootoption apis from cmd to lib for re-use between eficonfig and bootmgr Fix 'unexpected indentation' when 'make htmldocs' after functions are moved Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
2c0b0c31 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_SECURE_BOOT This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_SECURE_BOOT defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
83f3d121 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_MM_COMM_TEE This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_MM_COMM_TEE defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
88df3634 |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: CTRL+S to save the boot order 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>
|
#
45f5319f |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
menu: remove CTRL+C to quit On the sandbox called without "--terminal raw" CTRL+C leaves U-Boot, "ESC/CTRL+C to quit" is misleading. Let's remove CTRL+C to quit key handling from bootmenu and eficonfig menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
|
#
8dbd0a0f |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add vertical scroll support The current eficonfig menu does not support vertical scroll, so it can not display the menu entries greater than the console row size. This commit add the vertial scroll support. The console size is retrieved by SIMPLE_TEXT_OUTPUT_PROTOCOL.QueryMode() service, then calculates the row size for menu entry by subtracting menu header and description row size from the console row size. "start" and "end" are added in the efimenu structure. "start" keeps the menu entry index at the top, "end" keeps the bottom menu entry index. item_data_print() menu function only draws the menu entry between "start" and "end". This commit also fixes the issue that "Save" and "Quit" entries can be moved by BKEY_PLUS in change boot order menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
0d590852 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation This commit removes the change boot order specific menu implementation. The change boot order implementation calls eficonfig_process_common() same as other menus. The change boot order menu requires own item_data_print and item_choice implementation, but display_statusline function can be a same function as other menus. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
cd160b27 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor eficonfig_process_common function Current change boot order implementation does not call eficonfig_process_common() and call own menu functions for display_statusline, item_data_print and item_choice. Change boot order functionality should call eficonfig_process_common() to improve maintenanceability. This commit is a preparation to remove the change boot order specific implementation. The menu functions (display_statusline, item_data_print and item_choice) are added as argument of eficonfig_process_common(). The menu description string displayed at the bottom of the menu is also added as argument. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
32bab0ea |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Make use of CLI character processing Avoid duplicating some of the escape-sequence processing here and use the CLI function instead. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
d0ca98db |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Update bootmenu_loop() to return the code Use the return value to save having to pass around a pointer. This also resolves any ambiguity about what *key contains when the function is called. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
2da4a15e |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Rename KEY_... to BKEY_... This enum values conflict with linux/input.h so rename them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
64550274 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: avoid SetVariable between GetNextVariableName calls The current code calls efi_set_variable_int() to delete the invalid boot option between calls to efi_get_next_variable_name_int(), it may produce unpredictable results. This commit moves removal of the invalid boot option outside of the efi_get_next_variable_name_int() calls. EFI_NOT_FOUND returned from efi_get_next_variable_name_int() indicates we retrieved all EFI variables, it should be treated as EFI_SUCEESS. To address the checkpatch warning of too many leading tabs, combine two if statement into one. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
ce327084 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: carve out efi_get_next_variable_name_int calls To retrieve the EFI variable name by efi_get_next_variable_name_int(), the sequence of alloc -> efi_get_next_variable_name_int -> realloc -> efi_get_next_variable_name_int is required. In current code, this sequence repeatedly appears in the several functions. It should be curved out a common function. This commit also fixes the missing free() of var_name16 in eficonfig_delete_invalid_boot_option(). Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
140a8959 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use efi_get_next_variable_name_int() eficonfig command reads all possible UEFI load options from 0x0000 to 0xFFFF to construct the menu. This takes too much time in some environment. This commit uses efi_get_next_variable_name_int() to read all existing UEFI load options to significantlly reduce the count of efi_get_var() call. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
78b1ccc4 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use u16_strsize() to get u16 string buffer size Use u16_strsize() to simplify the u16 string buffer size calculation. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c67d3c9e |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix going one directory up issue The directory name in eficonfig menu entry contains the '\' separator. strcmp() argument ".." is wrong and one directory up handling does not work correctly. strcmp() argument must include '\' separator. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c3b5af63 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add UEFI Secure Boot Key enrollment interface This commit adds the menu-driven UEFI Secure Boot Key enrollment interface. User can enroll PK, KEK, db and dbx by selecting file. Only the signed EFI Signature List(s) with an authenticated header, typically '.auth' file, is accepted. To clear the PK, KEK, db and dbx, user needs to enroll the null key signed by PK or KEK. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
21faf4ef |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use protocol interface for file selection EFI_SIMPLE_FILE_SYSTEM_PROTOCOL is not always provided by U-Boot. Use protocol interface functions instead of U-Boot internal functions. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d6566113 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose eficonfig_create_device_path() Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use eficonfig_create_device_path() to construct the full device path from device path of the volume and file path, so move it out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d571f9b2 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation All the eficonfig menus other than "Change Boot Order" use 'eficonfig_entry' structure for each menu entry. This commit refactors change boot order implementation to use 'eficonfig_entry' structure same as other menus to have consistent menu handling. This commit also simplifies the data->active handling when KEY_SPACE is pressed, and sizeof() parameter. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
8961e93e |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose append entry function Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use append_entry() and append_quit_entry() to construct the menu, so move them out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
a84040ab |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor file selection handling eficonfig_select_file_handler() is commonly used to select the file. eficonfig_display_select_file_option() adds an additional menu to clear the selected file. eficonfig_display_select_file_option() is not always necessary for the file selection process, so it must be outside of eficonfig_select_file_handler(). This commit also renames the following functions to avoid confusion. eficonfig_select_file_handler() -> eficonfig_process_select_file() eficonfig_select_file() -> eficonfig_show_file_selection() eficonfig_display_select_file_option() -> eficonfig_process_show_file_option() Finally, test_eficonfig.py need to be updated to get aligned with the above modification. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
1167e88a |
|
14-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix missing variable initialization The 'ret' variable must be initialized before use in eficonfig_delete_invalid_boot_option(). Fixes: c416f1c0bc ("bootmenu: add removable media entries") Addresses-Coverity: 376207 ("Uninitialized variables") Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
3d595ac5 |
|
09-Nov-2022 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: remove superfluous if in eficonfig_edit_boot_option Goto for an immediately succeeding label is superfluous. Fixes: 87d791423ac6 ("eficonfig: menu-driven addition of UEFI boot option") Addresses-Coverity: 376202 ("Identical code for different branches") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
f19171c9 |
|
08-Jan-2024 |
Ilias Apalodimas <ilias.apalodimas@linaro.org> |
efi_loader: Clean up efi_dp_append and efi_dp_concat Looking back at the initrd storing functionality, we introduced three functions, efi_dp_append_or_concatenate(), efi_dp_append/concat(). In hindsight we could have simplified that by a lot. First of all none of the functions append anything. They all allocate a new device path and concatenate the contents of two device paths in one. A boolean parameter controls the final device path -- if that's true an end node is injected between the two device paths. So let's rewrite this and make it a bit easier to read. Get rid of efi_dp_append(), efi_dp_concat() and rename efi_dp_append_or_concatenate() to efi_dp_concat(). This is far more intuitive and the only adjustment that is needed is an extra boolean argument on all callsites. Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
64658007 |
|
17-Nov-2023 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: eficonfig: create shortened boot options The boot options created by eficonfig should use shortened device-paths to avoid problems if drives are enumerated in a different sequence. Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
9945bc4f |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Fix incorrect return code of boot option update Correct the return code for out-of-memory and no boot option found Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
339b527b |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Move bootorder and bootoption apis to lib Rename and move bootorder and bootoption apis from cmd to lib for re-use between eficonfig and bootmgr Fix 'unexpected indentation' when 'make htmldocs' after functions are moved Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
2c0b0c31 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_SECURE_BOOT This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_SECURE_BOOT defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
83f3d121 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_MM_COMM_TEE This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_MM_COMM_TEE defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
88df3634 |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: CTRL+S to save the boot order 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>
|
#
45f5319f |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
menu: remove CTRL+C to quit On the sandbox called without "--terminal raw" CTRL+C leaves U-Boot, "ESC/CTRL+C to quit" is misleading. Let's remove CTRL+C to quit key handling from bootmenu and eficonfig menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
|
#
8dbd0a0f |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add vertical scroll support The current eficonfig menu does not support vertical scroll, so it can not display the menu entries greater than the console row size. This commit add the vertial scroll support. The console size is retrieved by SIMPLE_TEXT_OUTPUT_PROTOCOL.QueryMode() service, then calculates the row size for menu entry by subtracting menu header and description row size from the console row size. "start" and "end" are added in the efimenu structure. "start" keeps the menu entry index at the top, "end" keeps the bottom menu entry index. item_data_print() menu function only draws the menu entry between "start" and "end". This commit also fixes the issue that "Save" and "Quit" entries can be moved by BKEY_PLUS in change boot order menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
0d590852 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation This commit removes the change boot order specific menu implementation. The change boot order implementation calls eficonfig_process_common() same as other menus. The change boot order menu requires own item_data_print and item_choice implementation, but display_statusline function can be a same function as other menus. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
cd160b27 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor eficonfig_process_common function Current change boot order implementation does not call eficonfig_process_common() and call own menu functions for display_statusline, item_data_print and item_choice. Change boot order functionality should call eficonfig_process_common() to improve maintenanceability. This commit is a preparation to remove the change boot order specific implementation. The menu functions (display_statusline, item_data_print and item_choice) are added as argument of eficonfig_process_common(). The menu description string displayed at the bottom of the menu is also added as argument. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
32bab0ea |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Make use of CLI character processing Avoid duplicating some of the escape-sequence processing here and use the CLI function instead. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
d0ca98db |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Update bootmenu_loop() to return the code Use the return value to save having to pass around a pointer. This also resolves any ambiguity about what *key contains when the function is called. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
2da4a15e |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Rename KEY_... to BKEY_... This enum values conflict with linux/input.h so rename them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
64550274 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: avoid SetVariable between GetNextVariableName calls The current code calls efi_set_variable_int() to delete the invalid boot option between calls to efi_get_next_variable_name_int(), it may produce unpredictable results. This commit moves removal of the invalid boot option outside of the efi_get_next_variable_name_int() calls. EFI_NOT_FOUND returned from efi_get_next_variable_name_int() indicates we retrieved all EFI variables, it should be treated as EFI_SUCEESS. To address the checkpatch warning of too many leading tabs, combine two if statement into one. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
ce327084 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: carve out efi_get_next_variable_name_int calls To retrieve the EFI variable name by efi_get_next_variable_name_int(), the sequence of alloc -> efi_get_next_variable_name_int -> realloc -> efi_get_next_variable_name_int is required. In current code, this sequence repeatedly appears in the several functions. It should be curved out a common function. This commit also fixes the missing free() of var_name16 in eficonfig_delete_invalid_boot_option(). Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
140a8959 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use efi_get_next_variable_name_int() eficonfig command reads all possible UEFI load options from 0x0000 to 0xFFFF to construct the menu. This takes too much time in some environment. This commit uses efi_get_next_variable_name_int() to read all existing UEFI load options to significantlly reduce the count of efi_get_var() call. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
78b1ccc4 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use u16_strsize() to get u16 string buffer size Use u16_strsize() to simplify the u16 string buffer size calculation. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c67d3c9e |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix going one directory up issue The directory name in eficonfig menu entry contains the '\' separator. strcmp() argument ".." is wrong and one directory up handling does not work correctly. strcmp() argument must include '\' separator. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c3b5af63 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add UEFI Secure Boot Key enrollment interface This commit adds the menu-driven UEFI Secure Boot Key enrollment interface. User can enroll PK, KEK, db and dbx by selecting file. Only the signed EFI Signature List(s) with an authenticated header, typically '.auth' file, is accepted. To clear the PK, KEK, db and dbx, user needs to enroll the null key signed by PK or KEK. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
21faf4ef |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use protocol interface for file selection EFI_SIMPLE_FILE_SYSTEM_PROTOCOL is not always provided by U-Boot. Use protocol interface functions instead of U-Boot internal functions. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d6566113 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose eficonfig_create_device_path() Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use eficonfig_create_device_path() to construct the full device path from device path of the volume and file path, so move it out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d571f9b2 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation All the eficonfig menus other than "Change Boot Order" use 'eficonfig_entry' structure for each menu entry. This commit refactors change boot order implementation to use 'eficonfig_entry' structure same as other menus to have consistent menu handling. This commit also simplifies the data->active handling when KEY_SPACE is pressed, and sizeof() parameter. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
8961e93e |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose append entry function Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use append_entry() and append_quit_entry() to construct the menu, so move them out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
a84040ab |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor file selection handling eficonfig_select_file_handler() is commonly used to select the file. eficonfig_display_select_file_option() adds an additional menu to clear the selected file. eficonfig_display_select_file_option() is not always necessary for the file selection process, so it must be outside of eficonfig_select_file_handler(). This commit also renames the following functions to avoid confusion. eficonfig_select_file_handler() -> eficonfig_process_select_file() eficonfig_select_file() -> eficonfig_show_file_selection() eficonfig_display_select_file_option() -> eficonfig_process_show_file_option() Finally, test_eficonfig.py need to be updated to get aligned with the above modification. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
1167e88a |
|
14-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix missing variable initialization The 'ret' variable must be initialized before use in eficonfig_delete_invalid_boot_option(). Fixes: c416f1c0bc ("bootmenu: add removable media entries") Addresses-Coverity: 376207 ("Uninitialized variables") Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
3d595ac5 |
|
09-Nov-2022 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: remove superfluous if in eficonfig_edit_boot_option Goto for an immediately succeeding label is superfluous. Fixes: 87d791423ac6 ("eficonfig: menu-driven addition of UEFI boot option") Addresses-Coverity: 376202 ("Identical code for different branches") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
f19171c9 |
|
08-Jan-2024 |
Ilias Apalodimas <ilias.apalodimas@linaro.org> |
efi_loader: Clean up efi_dp_append and efi_dp_concat Looking back at the initrd storing functionality, we introduced three functions, efi_dp_append_or_concatenate(), efi_dp_append/concat(). In hindsight we could have simplified that by a lot. First of all none of the functions append anything. They all allocate a new device path and concatenate the contents of two device paths in one. A boolean parameter controls the final device path -- if that's true an end node is injected between the two device paths. So let's rewrite this and make it a bit easier to read. Get rid of efi_dp_append(), efi_dp_concat() and rename efi_dp_append_or_concatenate() to efi_dp_concat(). This is far more intuitive and the only adjustment that is needed is an extra boolean argument on all callsites. Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
64658007 |
|
17-Nov-2023 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: eficonfig: create shortened boot options The boot options created by eficonfig should use shortened device-paths to avoid problems if drives are enumerated in a different sequence. Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
9945bc4f |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Fix incorrect return code of boot option update Correct the return code for out-of-memory and no boot option found Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
339b527b |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Move bootorder and bootoption apis to lib Rename and move bootorder and bootoption apis from cmd to lib for re-use between eficonfig and bootmgr Fix 'unexpected indentation' when 'make htmldocs' after functions are moved Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
2c0b0c31 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_SECURE_BOOT This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_SECURE_BOOT defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
83f3d121 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_MM_COMM_TEE This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_MM_COMM_TEE defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
88df3634 |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: CTRL+S to save the boot order 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>
|
#
45f5319f |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
menu: remove CTRL+C to quit On the sandbox called without "--terminal raw" CTRL+C leaves U-Boot, "ESC/CTRL+C to quit" is misleading. Let's remove CTRL+C to quit key handling from bootmenu and eficonfig menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
|
#
8dbd0a0f |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add vertical scroll support The current eficonfig menu does not support vertical scroll, so it can not display the menu entries greater than the console row size. This commit add the vertial scroll support. The console size is retrieved by SIMPLE_TEXT_OUTPUT_PROTOCOL.QueryMode() service, then calculates the row size for menu entry by subtracting menu header and description row size from the console row size. "start" and "end" are added in the efimenu structure. "start" keeps the menu entry index at the top, "end" keeps the bottom menu entry index. item_data_print() menu function only draws the menu entry between "start" and "end". This commit also fixes the issue that "Save" and "Quit" entries can be moved by BKEY_PLUS in change boot order menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
0d590852 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation This commit removes the change boot order specific menu implementation. The change boot order implementation calls eficonfig_process_common() same as other menus. The change boot order menu requires own item_data_print and item_choice implementation, but display_statusline function can be a same function as other menus. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
cd160b27 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor eficonfig_process_common function Current change boot order implementation does not call eficonfig_process_common() and call own menu functions for display_statusline, item_data_print and item_choice. Change boot order functionality should call eficonfig_process_common() to improve maintenanceability. This commit is a preparation to remove the change boot order specific implementation. The menu functions (display_statusline, item_data_print and item_choice) are added as argument of eficonfig_process_common(). The menu description string displayed at the bottom of the menu is also added as argument. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
32bab0ea |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Make use of CLI character processing Avoid duplicating some of the escape-sequence processing here and use the CLI function instead. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
d0ca98db |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Update bootmenu_loop() to return the code Use the return value to save having to pass around a pointer. This also resolves any ambiguity about what *key contains when the function is called. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
2da4a15e |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Rename KEY_... to BKEY_... This enum values conflict with linux/input.h so rename them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
64550274 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: avoid SetVariable between GetNextVariableName calls The current code calls efi_set_variable_int() to delete the invalid boot option between calls to efi_get_next_variable_name_int(), it may produce unpredictable results. This commit moves removal of the invalid boot option outside of the efi_get_next_variable_name_int() calls. EFI_NOT_FOUND returned from efi_get_next_variable_name_int() indicates we retrieved all EFI variables, it should be treated as EFI_SUCEESS. To address the checkpatch warning of too many leading tabs, combine two if statement into one. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
ce327084 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: carve out efi_get_next_variable_name_int calls To retrieve the EFI variable name by efi_get_next_variable_name_int(), the sequence of alloc -> efi_get_next_variable_name_int -> realloc -> efi_get_next_variable_name_int is required. In current code, this sequence repeatedly appears in the several functions. It should be curved out a common function. This commit also fixes the missing free() of var_name16 in eficonfig_delete_invalid_boot_option(). Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
140a8959 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use efi_get_next_variable_name_int() eficonfig command reads all possible UEFI load options from 0x0000 to 0xFFFF to construct the menu. This takes too much time in some environment. This commit uses efi_get_next_variable_name_int() to read all existing UEFI load options to significantlly reduce the count of efi_get_var() call. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
78b1ccc4 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use u16_strsize() to get u16 string buffer size Use u16_strsize() to simplify the u16 string buffer size calculation. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c67d3c9e |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix going one directory up issue The directory name in eficonfig menu entry contains the '\' separator. strcmp() argument ".." is wrong and one directory up handling does not work correctly. strcmp() argument must include '\' separator. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c3b5af63 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add UEFI Secure Boot Key enrollment interface This commit adds the menu-driven UEFI Secure Boot Key enrollment interface. User can enroll PK, KEK, db and dbx by selecting file. Only the signed EFI Signature List(s) with an authenticated header, typically '.auth' file, is accepted. To clear the PK, KEK, db and dbx, user needs to enroll the null key signed by PK or KEK. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
21faf4ef |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use protocol interface for file selection EFI_SIMPLE_FILE_SYSTEM_PROTOCOL is not always provided by U-Boot. Use protocol interface functions instead of U-Boot internal functions. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d6566113 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose eficonfig_create_device_path() Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use eficonfig_create_device_path() to construct the full device path from device path of the volume and file path, so move it out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d571f9b2 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation All the eficonfig menus other than "Change Boot Order" use 'eficonfig_entry' structure for each menu entry. This commit refactors change boot order implementation to use 'eficonfig_entry' structure same as other menus to have consistent menu handling. This commit also simplifies the data->active handling when KEY_SPACE is pressed, and sizeof() parameter. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
8961e93e |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose append entry function Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use append_entry() and append_quit_entry() to construct the menu, so move them out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
a84040ab |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor file selection handling eficonfig_select_file_handler() is commonly used to select the file. eficonfig_display_select_file_option() adds an additional menu to clear the selected file. eficonfig_display_select_file_option() is not always necessary for the file selection process, so it must be outside of eficonfig_select_file_handler(). This commit also renames the following functions to avoid confusion. eficonfig_select_file_handler() -> eficonfig_process_select_file() eficonfig_select_file() -> eficonfig_show_file_selection() eficonfig_display_select_file_option() -> eficonfig_process_show_file_option() Finally, test_eficonfig.py need to be updated to get aligned with the above modification. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
1167e88a |
|
14-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix missing variable initialization The 'ret' variable must be initialized before use in eficonfig_delete_invalid_boot_option(). Fixes: c416f1c0bc ("bootmenu: add removable media entries") Addresses-Coverity: 376207 ("Uninitialized variables") Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
3d595ac5 |
|
09-Nov-2022 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: remove superfluous if in eficonfig_edit_boot_option Goto for an immediately succeeding label is superfluous. Fixes: 87d791423ac6 ("eficonfig: menu-driven addition of UEFI boot option") Addresses-Coverity: 376202 ("Identical code for different branches") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
f19171c9 |
|
08-Jan-2024 |
Ilias Apalodimas <ilias.apalodimas@linaro.org> |
efi_loader: Clean up efi_dp_append and efi_dp_concat Looking back at the initrd storing functionality, we introduced three functions, efi_dp_append_or_concatenate(), efi_dp_append/concat(). In hindsight we could have simplified that by a lot. First of all none of the functions append anything. They all allocate a new device path and concatenate the contents of two device paths in one. A boolean parameter controls the final device path -- if that's true an end node is injected between the two device paths. So let's rewrite this and make it a bit easier to read. Get rid of efi_dp_append(), efi_dp_concat() and rename efi_dp_append_or_concatenate() to efi_dp_concat(). This is far more intuitive and the only adjustment that is needed is an extra boolean argument on all callsites. Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
64658007 |
|
17-Nov-2023 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: eficonfig: create shortened boot options The boot options created by eficonfig should use shortened device-paths to avoid problems if drives are enumerated in a different sequence. Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
9945bc4f |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Fix incorrect return code of boot option update Correct the return code for out-of-memory and no boot option found Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
339b527b |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Move bootorder and bootoption apis to lib Rename and move bootorder and bootoption apis from cmd to lib for re-use between eficonfig and bootmgr Fix 'unexpected indentation' when 'make htmldocs' after functions are moved Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
2c0b0c31 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_SECURE_BOOT This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_SECURE_BOOT defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
83f3d121 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_MM_COMM_TEE This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_MM_COMM_TEE defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
88df3634 |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: CTRL+S to save the boot order 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>
|
#
45f5319f |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
menu: remove CTRL+C to quit On the sandbox called without "--terminal raw" CTRL+C leaves U-Boot, "ESC/CTRL+C to quit" is misleading. Let's remove CTRL+C to quit key handling from bootmenu and eficonfig menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
|
#
8dbd0a0f |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add vertical scroll support The current eficonfig menu does not support vertical scroll, so it can not display the menu entries greater than the console row size. This commit add the vertial scroll support. The console size is retrieved by SIMPLE_TEXT_OUTPUT_PROTOCOL.QueryMode() service, then calculates the row size for menu entry by subtracting menu header and description row size from the console row size. "start" and "end" are added in the efimenu structure. "start" keeps the menu entry index at the top, "end" keeps the bottom menu entry index. item_data_print() menu function only draws the menu entry between "start" and "end". This commit also fixes the issue that "Save" and "Quit" entries can be moved by BKEY_PLUS in change boot order menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
0d590852 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation This commit removes the change boot order specific menu implementation. The change boot order implementation calls eficonfig_process_common() same as other menus. The change boot order menu requires own item_data_print and item_choice implementation, but display_statusline function can be a same function as other menus. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
cd160b27 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor eficonfig_process_common function Current change boot order implementation does not call eficonfig_process_common() and call own menu functions for display_statusline, item_data_print and item_choice. Change boot order functionality should call eficonfig_process_common() to improve maintenanceability. This commit is a preparation to remove the change boot order specific implementation. The menu functions (display_statusline, item_data_print and item_choice) are added as argument of eficonfig_process_common(). The menu description string displayed at the bottom of the menu is also added as argument. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
32bab0ea |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Make use of CLI character processing Avoid duplicating some of the escape-sequence processing here and use the CLI function instead. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
d0ca98db |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Update bootmenu_loop() to return the code Use the return value to save having to pass around a pointer. This also resolves any ambiguity about what *key contains when the function is called. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
2da4a15e |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Rename KEY_... to BKEY_... This enum values conflict with linux/input.h so rename them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
64550274 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: avoid SetVariable between GetNextVariableName calls The current code calls efi_set_variable_int() to delete the invalid boot option between calls to efi_get_next_variable_name_int(), it may produce unpredictable results. This commit moves removal of the invalid boot option outside of the efi_get_next_variable_name_int() calls. EFI_NOT_FOUND returned from efi_get_next_variable_name_int() indicates we retrieved all EFI variables, it should be treated as EFI_SUCEESS. To address the checkpatch warning of too many leading tabs, combine two if statement into one. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
ce327084 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: carve out efi_get_next_variable_name_int calls To retrieve the EFI variable name by efi_get_next_variable_name_int(), the sequence of alloc -> efi_get_next_variable_name_int -> realloc -> efi_get_next_variable_name_int is required. In current code, this sequence repeatedly appears in the several functions. It should be curved out a common function. This commit also fixes the missing free() of var_name16 in eficonfig_delete_invalid_boot_option(). Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
140a8959 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use efi_get_next_variable_name_int() eficonfig command reads all possible UEFI load options from 0x0000 to 0xFFFF to construct the menu. This takes too much time in some environment. This commit uses efi_get_next_variable_name_int() to read all existing UEFI load options to significantlly reduce the count of efi_get_var() call. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
78b1ccc4 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use u16_strsize() to get u16 string buffer size Use u16_strsize() to simplify the u16 string buffer size calculation. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c67d3c9e |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix going one directory up issue The directory name in eficonfig menu entry contains the '\' separator. strcmp() argument ".." is wrong and one directory up handling does not work correctly. strcmp() argument must include '\' separator. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c3b5af63 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add UEFI Secure Boot Key enrollment interface This commit adds the menu-driven UEFI Secure Boot Key enrollment interface. User can enroll PK, KEK, db and dbx by selecting file. Only the signed EFI Signature List(s) with an authenticated header, typically '.auth' file, is accepted. To clear the PK, KEK, db and dbx, user needs to enroll the null key signed by PK or KEK. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
21faf4ef |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use protocol interface for file selection EFI_SIMPLE_FILE_SYSTEM_PROTOCOL is not always provided by U-Boot. Use protocol interface functions instead of U-Boot internal functions. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d6566113 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose eficonfig_create_device_path() Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use eficonfig_create_device_path() to construct the full device path from device path of the volume and file path, so move it out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d571f9b2 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation All the eficonfig menus other than "Change Boot Order" use 'eficonfig_entry' structure for each menu entry. This commit refactors change boot order implementation to use 'eficonfig_entry' structure same as other menus to have consistent menu handling. This commit also simplifies the data->active handling when KEY_SPACE is pressed, and sizeof() parameter. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
8961e93e |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose append entry function Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use append_entry() and append_quit_entry() to construct the menu, so move them out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
a84040ab |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor file selection handling eficonfig_select_file_handler() is commonly used to select the file. eficonfig_display_select_file_option() adds an additional menu to clear the selected file. eficonfig_display_select_file_option() is not always necessary for the file selection process, so it must be outside of eficonfig_select_file_handler(). This commit also renames the following functions to avoid confusion. eficonfig_select_file_handler() -> eficonfig_process_select_file() eficonfig_select_file() -> eficonfig_show_file_selection() eficonfig_display_select_file_option() -> eficonfig_process_show_file_option() Finally, test_eficonfig.py need to be updated to get aligned with the above modification. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
1167e88a |
|
14-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix missing variable initialization The 'ret' variable must be initialized before use in eficonfig_delete_invalid_boot_option(). Fixes: c416f1c0bc ("bootmenu: add removable media entries") Addresses-Coverity: 376207 ("Uninitialized variables") Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
3d595ac5 |
|
09-Nov-2022 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: remove superfluous if in eficonfig_edit_boot_option Goto for an immediately succeeding label is superfluous. Fixes: 87d791423ac6 ("eficonfig: menu-driven addition of UEFI boot option") Addresses-Coverity: 376202 ("Identical code for different branches") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
f19171c9 |
|
08-Jan-2024 |
Ilias Apalodimas <ilias.apalodimas@linaro.org> |
efi_loader: Clean up efi_dp_append and efi_dp_concat Looking back at the initrd storing functionality, we introduced three functions, efi_dp_append_or_concatenate(), efi_dp_append/concat(). In hindsight we could have simplified that by a lot. First of all none of the functions append anything. They all allocate a new device path and concatenate the contents of two device paths in one. A boolean parameter controls the final device path -- if that's true an end node is injected between the two device paths. So let's rewrite this and make it a bit easier to read. Get rid of efi_dp_append(), efi_dp_concat() and rename efi_dp_append_or_concatenate() to efi_dp_concat(). This is far more intuitive and the only adjustment that is needed is an extra boolean argument on all callsites. Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
64658007 |
|
17-Nov-2023 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: eficonfig: create shortened boot options The boot options created by eficonfig should use shortened device-paths to avoid problems if drives are enumerated in a different sequence. Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
9945bc4f |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Fix incorrect return code of boot option update Correct the return code for out-of-memory and no boot option found Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
339b527b |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Move bootorder and bootoption apis to lib Rename and move bootorder and bootoption apis from cmd to lib for re-use between eficonfig and bootmgr Fix 'unexpected indentation' when 'make htmldocs' after functions are moved Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
2c0b0c31 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_SECURE_BOOT This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_SECURE_BOOT defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
83f3d121 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_MM_COMM_TEE This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_MM_COMM_TEE defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
88df3634 |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: CTRL+S to save the boot order 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>
|
#
45f5319f |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
menu: remove CTRL+C to quit On the sandbox called without "--terminal raw" CTRL+C leaves U-Boot, "ESC/CTRL+C to quit" is misleading. Let's remove CTRL+C to quit key handling from bootmenu and eficonfig menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
|
#
8dbd0a0f |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add vertical scroll support The current eficonfig menu does not support vertical scroll, so it can not display the menu entries greater than the console row size. This commit add the vertial scroll support. The console size is retrieved by SIMPLE_TEXT_OUTPUT_PROTOCOL.QueryMode() service, then calculates the row size for menu entry by subtracting menu header and description row size from the console row size. "start" and "end" are added in the efimenu structure. "start" keeps the menu entry index at the top, "end" keeps the bottom menu entry index. item_data_print() menu function only draws the menu entry between "start" and "end". This commit also fixes the issue that "Save" and "Quit" entries can be moved by BKEY_PLUS in change boot order menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
0d590852 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation This commit removes the change boot order specific menu implementation. The change boot order implementation calls eficonfig_process_common() same as other menus. The change boot order menu requires own item_data_print and item_choice implementation, but display_statusline function can be a same function as other menus. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
cd160b27 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor eficonfig_process_common function Current change boot order implementation does not call eficonfig_process_common() and call own menu functions for display_statusline, item_data_print and item_choice. Change boot order functionality should call eficonfig_process_common() to improve maintenanceability. This commit is a preparation to remove the change boot order specific implementation. The menu functions (display_statusline, item_data_print and item_choice) are added as argument of eficonfig_process_common(). The menu description string displayed at the bottom of the menu is also added as argument. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
32bab0ea |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Make use of CLI character processing Avoid duplicating some of the escape-sequence processing here and use the CLI function instead. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
d0ca98db |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Update bootmenu_loop() to return the code Use the return value to save having to pass around a pointer. This also resolves any ambiguity about what *key contains when the function is called. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
2da4a15e |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Rename KEY_... to BKEY_... This enum values conflict with linux/input.h so rename them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
64550274 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: avoid SetVariable between GetNextVariableName calls The current code calls efi_set_variable_int() to delete the invalid boot option between calls to efi_get_next_variable_name_int(), it may produce unpredictable results. This commit moves removal of the invalid boot option outside of the efi_get_next_variable_name_int() calls. EFI_NOT_FOUND returned from efi_get_next_variable_name_int() indicates we retrieved all EFI variables, it should be treated as EFI_SUCEESS. To address the checkpatch warning of too many leading tabs, combine two if statement into one. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
ce327084 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: carve out efi_get_next_variable_name_int calls To retrieve the EFI variable name by efi_get_next_variable_name_int(), the sequence of alloc -> efi_get_next_variable_name_int -> realloc -> efi_get_next_variable_name_int is required. In current code, this sequence repeatedly appears in the several functions. It should be curved out a common function. This commit also fixes the missing free() of var_name16 in eficonfig_delete_invalid_boot_option(). Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
140a8959 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use efi_get_next_variable_name_int() eficonfig command reads all possible UEFI load options from 0x0000 to 0xFFFF to construct the menu. This takes too much time in some environment. This commit uses efi_get_next_variable_name_int() to read all existing UEFI load options to significantlly reduce the count of efi_get_var() call. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
78b1ccc4 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use u16_strsize() to get u16 string buffer size Use u16_strsize() to simplify the u16 string buffer size calculation. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c67d3c9e |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix going one directory up issue The directory name in eficonfig menu entry contains the '\' separator. strcmp() argument ".." is wrong and one directory up handling does not work correctly. strcmp() argument must include '\' separator. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c3b5af63 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add UEFI Secure Boot Key enrollment interface This commit adds the menu-driven UEFI Secure Boot Key enrollment interface. User can enroll PK, KEK, db and dbx by selecting file. Only the signed EFI Signature List(s) with an authenticated header, typically '.auth' file, is accepted. To clear the PK, KEK, db and dbx, user needs to enroll the null key signed by PK or KEK. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
21faf4ef |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use protocol interface for file selection EFI_SIMPLE_FILE_SYSTEM_PROTOCOL is not always provided by U-Boot. Use protocol interface functions instead of U-Boot internal functions. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d6566113 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose eficonfig_create_device_path() Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use eficonfig_create_device_path() to construct the full device path from device path of the volume and file path, so move it out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d571f9b2 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation All the eficonfig menus other than "Change Boot Order" use 'eficonfig_entry' structure for each menu entry. This commit refactors change boot order implementation to use 'eficonfig_entry' structure same as other menus to have consistent menu handling. This commit also simplifies the data->active handling when KEY_SPACE is pressed, and sizeof() parameter. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
8961e93e |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose append entry function Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use append_entry() and append_quit_entry() to construct the menu, so move them out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
a84040ab |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor file selection handling eficonfig_select_file_handler() is commonly used to select the file. eficonfig_display_select_file_option() adds an additional menu to clear the selected file. eficonfig_display_select_file_option() is not always necessary for the file selection process, so it must be outside of eficonfig_select_file_handler(). This commit also renames the following functions to avoid confusion. eficonfig_select_file_handler() -> eficonfig_process_select_file() eficonfig_select_file() -> eficonfig_show_file_selection() eficonfig_display_select_file_option() -> eficonfig_process_show_file_option() Finally, test_eficonfig.py need to be updated to get aligned with the above modification. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
1167e88a |
|
14-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix missing variable initialization The 'ret' variable must be initialized before use in eficonfig_delete_invalid_boot_option(). Fixes: c416f1c0bc ("bootmenu: add removable media entries") Addresses-Coverity: 376207 ("Uninitialized variables") Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
3d595ac5 |
|
09-Nov-2022 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: remove superfluous if in eficonfig_edit_boot_option Goto for an immediately succeeding label is superfluous. Fixes: 87d791423ac6 ("eficonfig: menu-driven addition of UEFI boot option") Addresses-Coverity: 376202 ("Identical code for different branches") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
f19171c9 |
|
08-Jan-2024 |
Ilias Apalodimas <ilias.apalodimas@linaro.org> |
efi_loader: Clean up efi_dp_append and efi_dp_concat Looking back at the initrd storing functionality, we introduced three functions, efi_dp_append_or_concatenate(), efi_dp_append/concat(). In hindsight we could have simplified that by a lot. First of all none of the functions append anything. They all allocate a new device path and concatenate the contents of two device paths in one. A boolean parameter controls the final device path -- if that's true an end node is injected between the two device paths. So let's rewrite this and make it a bit easier to read. Get rid of efi_dp_append(), efi_dp_concat() and rename efi_dp_append_or_concatenate() to efi_dp_concat(). This is far more intuitive and the only adjustment that is needed is an extra boolean argument on all callsites. Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
64658007 |
|
17-Nov-2023 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: eficonfig: create shortened boot options The boot options created by eficonfig should use shortened device-paths to avoid problems if drives are enumerated in a different sequence. Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
9945bc4f |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Fix incorrect return code of boot option update Correct the return code for out-of-memory and no boot option found Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
339b527b |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Move bootorder and bootoption apis to lib Rename and move bootorder and bootoption apis from cmd to lib for re-use between eficonfig and bootmgr Fix 'unexpected indentation' when 'make htmldocs' after functions are moved Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
2c0b0c31 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_SECURE_BOOT This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_SECURE_BOOT defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
83f3d121 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_MM_COMM_TEE This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_MM_COMM_TEE defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
88df3634 |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: CTRL+S to save the boot order 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>
|
#
45f5319f |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
menu: remove CTRL+C to quit On the sandbox called without "--terminal raw" CTRL+C leaves U-Boot, "ESC/CTRL+C to quit" is misleading. Let's remove CTRL+C to quit key handling from bootmenu and eficonfig menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
|
#
8dbd0a0f |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add vertical scroll support The current eficonfig menu does not support vertical scroll, so it can not display the menu entries greater than the console row size. This commit add the vertial scroll support. The console size is retrieved by SIMPLE_TEXT_OUTPUT_PROTOCOL.QueryMode() service, then calculates the row size for menu entry by subtracting menu header and description row size from the console row size. "start" and "end" are added in the efimenu structure. "start" keeps the menu entry index at the top, "end" keeps the bottom menu entry index. item_data_print() menu function only draws the menu entry between "start" and "end". This commit also fixes the issue that "Save" and "Quit" entries can be moved by BKEY_PLUS in change boot order menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
0d590852 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation This commit removes the change boot order specific menu implementation. The change boot order implementation calls eficonfig_process_common() same as other menus. The change boot order menu requires own item_data_print and item_choice implementation, but display_statusline function can be a same function as other menus. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
cd160b27 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor eficonfig_process_common function Current change boot order implementation does not call eficonfig_process_common() and call own menu functions for display_statusline, item_data_print and item_choice. Change boot order functionality should call eficonfig_process_common() to improve maintenanceability. This commit is a preparation to remove the change boot order specific implementation. The menu functions (display_statusline, item_data_print and item_choice) are added as argument of eficonfig_process_common(). The menu description string displayed at the bottom of the menu is also added as argument. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
32bab0ea |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Make use of CLI character processing Avoid duplicating some of the escape-sequence processing here and use the CLI function instead. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
d0ca98db |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Update bootmenu_loop() to return the code Use the return value to save having to pass around a pointer. This also resolves any ambiguity about what *key contains when the function is called. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
2da4a15e |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Rename KEY_... to BKEY_... This enum values conflict with linux/input.h so rename them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
64550274 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: avoid SetVariable between GetNextVariableName calls The current code calls efi_set_variable_int() to delete the invalid boot option between calls to efi_get_next_variable_name_int(), it may produce unpredictable results. This commit moves removal of the invalid boot option outside of the efi_get_next_variable_name_int() calls. EFI_NOT_FOUND returned from efi_get_next_variable_name_int() indicates we retrieved all EFI variables, it should be treated as EFI_SUCEESS. To address the checkpatch warning of too many leading tabs, combine two if statement into one. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
ce327084 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: carve out efi_get_next_variable_name_int calls To retrieve the EFI variable name by efi_get_next_variable_name_int(), the sequence of alloc -> efi_get_next_variable_name_int -> realloc -> efi_get_next_variable_name_int is required. In current code, this sequence repeatedly appears in the several functions. It should be curved out a common function. This commit also fixes the missing free() of var_name16 in eficonfig_delete_invalid_boot_option(). Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
140a8959 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use efi_get_next_variable_name_int() eficonfig command reads all possible UEFI load options from 0x0000 to 0xFFFF to construct the menu. This takes too much time in some environment. This commit uses efi_get_next_variable_name_int() to read all existing UEFI load options to significantlly reduce the count of efi_get_var() call. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
78b1ccc4 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use u16_strsize() to get u16 string buffer size Use u16_strsize() to simplify the u16 string buffer size calculation. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c67d3c9e |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix going one directory up issue The directory name in eficonfig menu entry contains the '\' separator. strcmp() argument ".." is wrong and one directory up handling does not work correctly. strcmp() argument must include '\' separator. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c3b5af63 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add UEFI Secure Boot Key enrollment interface This commit adds the menu-driven UEFI Secure Boot Key enrollment interface. User can enroll PK, KEK, db and dbx by selecting file. Only the signed EFI Signature List(s) with an authenticated header, typically '.auth' file, is accepted. To clear the PK, KEK, db and dbx, user needs to enroll the null key signed by PK or KEK. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
21faf4ef |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use protocol interface for file selection EFI_SIMPLE_FILE_SYSTEM_PROTOCOL is not always provided by U-Boot. Use protocol interface functions instead of U-Boot internal functions. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d6566113 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose eficonfig_create_device_path() Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use eficonfig_create_device_path() to construct the full device path from device path of the volume and file path, so move it out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d571f9b2 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation All the eficonfig menus other than "Change Boot Order" use 'eficonfig_entry' structure for each menu entry. This commit refactors change boot order implementation to use 'eficonfig_entry' structure same as other menus to have consistent menu handling. This commit also simplifies the data->active handling when KEY_SPACE is pressed, and sizeof() parameter. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
8961e93e |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose append entry function Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use append_entry() and append_quit_entry() to construct the menu, so move them out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
a84040ab |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor file selection handling eficonfig_select_file_handler() is commonly used to select the file. eficonfig_display_select_file_option() adds an additional menu to clear the selected file. eficonfig_display_select_file_option() is not always necessary for the file selection process, so it must be outside of eficonfig_select_file_handler(). This commit also renames the following functions to avoid confusion. eficonfig_select_file_handler() -> eficonfig_process_select_file() eficonfig_select_file() -> eficonfig_show_file_selection() eficonfig_display_select_file_option() -> eficonfig_process_show_file_option() Finally, test_eficonfig.py need to be updated to get aligned with the above modification. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
1167e88a |
|
14-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix missing variable initialization The 'ret' variable must be initialized before use in eficonfig_delete_invalid_boot_option(). Fixes: c416f1c0bc ("bootmenu: add removable media entries") Addresses-Coverity: 376207 ("Uninitialized variables") Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
3d595ac5 |
|
09-Nov-2022 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: remove superfluous if in eficonfig_edit_boot_option Goto for an immediately succeeding label is superfluous. Fixes: 87d791423ac6 ("eficonfig: menu-driven addition of UEFI boot option") Addresses-Coverity: 376202 ("Identical code for different branches") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
f19171c9 |
|
08-Jan-2024 |
Ilias Apalodimas <ilias.apalodimas@linaro.org> |
efi_loader: Clean up efi_dp_append and efi_dp_concat Looking back at the initrd storing functionality, we introduced three functions, efi_dp_append_or_concatenate(), efi_dp_append/concat(). In hindsight we could have simplified that by a lot. First of all none of the functions append anything. They all allocate a new device path and concatenate the contents of two device paths in one. A boolean parameter controls the final device path -- if that's true an end node is injected between the two device paths. So let's rewrite this and make it a bit easier to read. Get rid of efi_dp_append(), efi_dp_concat() and rename efi_dp_append_or_concatenate() to efi_dp_concat(). This is far more intuitive and the only adjustment that is needed is an extra boolean argument on all callsites. Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
64658007 |
|
17-Nov-2023 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: eficonfig: create shortened boot options The boot options created by eficonfig should use shortened device-paths to avoid problems if drives are enumerated in a different sequence. Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
9945bc4f |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Fix incorrect return code of boot option update Correct the return code for out-of-memory and no boot option found Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
339b527b |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Move bootorder and bootoption apis to lib Rename and move bootorder and bootoption apis from cmd to lib for re-use between eficonfig and bootmgr Fix 'unexpected indentation' when 'make htmldocs' after functions are moved Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
2c0b0c31 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_SECURE_BOOT This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_SECURE_BOOT defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
83f3d121 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_MM_COMM_TEE This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_MM_COMM_TEE defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
88df3634 |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: CTRL+S to save the boot order 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>
|
#
45f5319f |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
menu: remove CTRL+C to quit On the sandbox called without "--terminal raw" CTRL+C leaves U-Boot, "ESC/CTRL+C to quit" is misleading. Let's remove CTRL+C to quit key handling from bootmenu and eficonfig menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
|
#
8dbd0a0f |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add vertical scroll support The current eficonfig menu does not support vertical scroll, so it can not display the menu entries greater than the console row size. This commit add the vertial scroll support. The console size is retrieved by SIMPLE_TEXT_OUTPUT_PROTOCOL.QueryMode() service, then calculates the row size for menu entry by subtracting menu header and description row size from the console row size. "start" and "end" are added in the efimenu structure. "start" keeps the menu entry index at the top, "end" keeps the bottom menu entry index. item_data_print() menu function only draws the menu entry between "start" and "end". This commit also fixes the issue that "Save" and "Quit" entries can be moved by BKEY_PLUS in change boot order menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
0d590852 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation This commit removes the change boot order specific menu implementation. The change boot order implementation calls eficonfig_process_common() same as other menus. The change boot order menu requires own item_data_print and item_choice implementation, but display_statusline function can be a same function as other menus. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
cd160b27 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor eficonfig_process_common function Current change boot order implementation does not call eficonfig_process_common() and call own menu functions for display_statusline, item_data_print and item_choice. Change boot order functionality should call eficonfig_process_common() to improve maintenanceability. This commit is a preparation to remove the change boot order specific implementation. The menu functions (display_statusline, item_data_print and item_choice) are added as argument of eficonfig_process_common(). The menu description string displayed at the bottom of the menu is also added as argument. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
32bab0ea |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Make use of CLI character processing Avoid duplicating some of the escape-sequence processing here and use the CLI function instead. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
d0ca98db |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Update bootmenu_loop() to return the code Use the return value to save having to pass around a pointer. This also resolves any ambiguity about what *key contains when the function is called. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
2da4a15e |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Rename KEY_... to BKEY_... This enum values conflict with linux/input.h so rename them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
64550274 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: avoid SetVariable between GetNextVariableName calls The current code calls efi_set_variable_int() to delete the invalid boot option between calls to efi_get_next_variable_name_int(), it may produce unpredictable results. This commit moves removal of the invalid boot option outside of the efi_get_next_variable_name_int() calls. EFI_NOT_FOUND returned from efi_get_next_variable_name_int() indicates we retrieved all EFI variables, it should be treated as EFI_SUCEESS. To address the checkpatch warning of too many leading tabs, combine two if statement into one. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
ce327084 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: carve out efi_get_next_variable_name_int calls To retrieve the EFI variable name by efi_get_next_variable_name_int(), the sequence of alloc -> efi_get_next_variable_name_int -> realloc -> efi_get_next_variable_name_int is required. In current code, this sequence repeatedly appears in the several functions. It should be curved out a common function. This commit also fixes the missing free() of var_name16 in eficonfig_delete_invalid_boot_option(). Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
140a8959 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use efi_get_next_variable_name_int() eficonfig command reads all possible UEFI load options from 0x0000 to 0xFFFF to construct the menu. This takes too much time in some environment. This commit uses efi_get_next_variable_name_int() to read all existing UEFI load options to significantlly reduce the count of efi_get_var() call. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
78b1ccc4 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use u16_strsize() to get u16 string buffer size Use u16_strsize() to simplify the u16 string buffer size calculation. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c67d3c9e |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix going one directory up issue The directory name in eficonfig menu entry contains the '\' separator. strcmp() argument ".." is wrong and one directory up handling does not work correctly. strcmp() argument must include '\' separator. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c3b5af63 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add UEFI Secure Boot Key enrollment interface This commit adds the menu-driven UEFI Secure Boot Key enrollment interface. User can enroll PK, KEK, db and dbx by selecting file. Only the signed EFI Signature List(s) with an authenticated header, typically '.auth' file, is accepted. To clear the PK, KEK, db and dbx, user needs to enroll the null key signed by PK or KEK. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
21faf4ef |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use protocol interface for file selection EFI_SIMPLE_FILE_SYSTEM_PROTOCOL is not always provided by U-Boot. Use protocol interface functions instead of U-Boot internal functions. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d6566113 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose eficonfig_create_device_path() Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use eficonfig_create_device_path() to construct the full device path from device path of the volume and file path, so move it out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d571f9b2 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation All the eficonfig menus other than "Change Boot Order" use 'eficonfig_entry' structure for each menu entry. This commit refactors change boot order implementation to use 'eficonfig_entry' structure same as other menus to have consistent menu handling. This commit also simplifies the data->active handling when KEY_SPACE is pressed, and sizeof() parameter. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
8961e93e |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose append entry function Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use append_entry() and append_quit_entry() to construct the menu, so move them out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
a84040ab |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor file selection handling eficonfig_select_file_handler() is commonly used to select the file. eficonfig_display_select_file_option() adds an additional menu to clear the selected file. eficonfig_display_select_file_option() is not always necessary for the file selection process, so it must be outside of eficonfig_select_file_handler(). This commit also renames the following functions to avoid confusion. eficonfig_select_file_handler() -> eficonfig_process_select_file() eficonfig_select_file() -> eficonfig_show_file_selection() eficonfig_display_select_file_option() -> eficonfig_process_show_file_option() Finally, test_eficonfig.py need to be updated to get aligned with the above modification. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
1167e88a |
|
14-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix missing variable initialization The 'ret' variable must be initialized before use in eficonfig_delete_invalid_boot_option(). Fixes: c416f1c0bc ("bootmenu: add removable media entries") Addresses-Coverity: 376207 ("Uninitialized variables") Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
3d595ac5 |
|
09-Nov-2022 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: remove superfluous if in eficonfig_edit_boot_option Goto for an immediately succeeding label is superfluous. Fixes: 87d791423ac6 ("eficonfig: menu-driven addition of UEFI boot option") Addresses-Coverity: 376202 ("Identical code for different branches") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
f19171c9 |
|
08-Jan-2024 |
Ilias Apalodimas <ilias.apalodimas@linaro.org> |
efi_loader: Clean up efi_dp_append and efi_dp_concat Looking back at the initrd storing functionality, we introduced three functions, efi_dp_append_or_concatenate(), efi_dp_append/concat(). In hindsight we could have simplified that by a lot. First of all none of the functions append anything. They all allocate a new device path and concatenate the contents of two device paths in one. A boolean parameter controls the final device path -- if that's true an end node is injected between the two device paths. So let's rewrite this and make it a bit easier to read. Get rid of efi_dp_append(), efi_dp_concat() and rename efi_dp_append_or_concatenate() to efi_dp_concat(). This is far more intuitive and the only adjustment that is needed is an extra boolean argument on all callsites. Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
64658007 |
|
17-Nov-2023 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: eficonfig: create shortened boot options The boot options created by eficonfig should use shortened device-paths to avoid problems if drives are enumerated in a different sequence. Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
9945bc4f |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Fix incorrect return code of boot option update Correct the return code for out-of-memory and no boot option found Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
339b527b |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Move bootorder and bootoption apis to lib Rename and move bootorder and bootoption apis from cmd to lib for re-use between eficonfig and bootmgr Fix 'unexpected indentation' when 'make htmldocs' after functions are moved Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
2c0b0c31 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_SECURE_BOOT This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_SECURE_BOOT defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
83f3d121 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_MM_COMM_TEE This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_MM_COMM_TEE defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
88df3634 |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: CTRL+S to save the boot order 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>
|
#
45f5319f |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
menu: remove CTRL+C to quit On the sandbox called without "--terminal raw" CTRL+C leaves U-Boot, "ESC/CTRL+C to quit" is misleading. Let's remove CTRL+C to quit key handling from bootmenu and eficonfig menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
|
#
8dbd0a0f |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add vertical scroll support The current eficonfig menu does not support vertical scroll, so it can not display the menu entries greater than the console row size. This commit add the vertial scroll support. The console size is retrieved by SIMPLE_TEXT_OUTPUT_PROTOCOL.QueryMode() service, then calculates the row size for menu entry by subtracting menu header and description row size from the console row size. "start" and "end" are added in the efimenu structure. "start" keeps the menu entry index at the top, "end" keeps the bottom menu entry index. item_data_print() menu function only draws the menu entry between "start" and "end". This commit also fixes the issue that "Save" and "Quit" entries can be moved by BKEY_PLUS in change boot order menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
0d590852 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation This commit removes the change boot order specific menu implementation. The change boot order implementation calls eficonfig_process_common() same as other menus. The change boot order menu requires own item_data_print and item_choice implementation, but display_statusline function can be a same function as other menus. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
cd160b27 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor eficonfig_process_common function Current change boot order implementation does not call eficonfig_process_common() and call own menu functions for display_statusline, item_data_print and item_choice. Change boot order functionality should call eficonfig_process_common() to improve maintenanceability. This commit is a preparation to remove the change boot order specific implementation. The menu functions (display_statusline, item_data_print and item_choice) are added as argument of eficonfig_process_common(). The menu description string displayed at the bottom of the menu is also added as argument. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
32bab0ea |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Make use of CLI character processing Avoid duplicating some of the escape-sequence processing here and use the CLI function instead. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
d0ca98db |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Update bootmenu_loop() to return the code Use the return value to save having to pass around a pointer. This also resolves any ambiguity about what *key contains when the function is called. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
2da4a15e |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Rename KEY_... to BKEY_... This enum values conflict with linux/input.h so rename them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
64550274 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: avoid SetVariable between GetNextVariableName calls The current code calls efi_set_variable_int() to delete the invalid boot option between calls to efi_get_next_variable_name_int(), it may produce unpredictable results. This commit moves removal of the invalid boot option outside of the efi_get_next_variable_name_int() calls. EFI_NOT_FOUND returned from efi_get_next_variable_name_int() indicates we retrieved all EFI variables, it should be treated as EFI_SUCEESS. To address the checkpatch warning of too many leading tabs, combine two if statement into one. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
ce327084 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: carve out efi_get_next_variable_name_int calls To retrieve the EFI variable name by efi_get_next_variable_name_int(), the sequence of alloc -> efi_get_next_variable_name_int -> realloc -> efi_get_next_variable_name_int is required. In current code, this sequence repeatedly appears in the several functions. It should be curved out a common function. This commit also fixes the missing free() of var_name16 in eficonfig_delete_invalid_boot_option(). Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
140a8959 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use efi_get_next_variable_name_int() eficonfig command reads all possible UEFI load options from 0x0000 to 0xFFFF to construct the menu. This takes too much time in some environment. This commit uses efi_get_next_variable_name_int() to read all existing UEFI load options to significantlly reduce the count of efi_get_var() call. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
78b1ccc4 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use u16_strsize() to get u16 string buffer size Use u16_strsize() to simplify the u16 string buffer size calculation. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c67d3c9e |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix going one directory up issue The directory name in eficonfig menu entry contains the '\' separator. strcmp() argument ".." is wrong and one directory up handling does not work correctly. strcmp() argument must include '\' separator. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c3b5af63 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add UEFI Secure Boot Key enrollment interface This commit adds the menu-driven UEFI Secure Boot Key enrollment interface. User can enroll PK, KEK, db and dbx by selecting file. Only the signed EFI Signature List(s) with an authenticated header, typically '.auth' file, is accepted. To clear the PK, KEK, db and dbx, user needs to enroll the null key signed by PK or KEK. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
21faf4ef |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use protocol interface for file selection EFI_SIMPLE_FILE_SYSTEM_PROTOCOL is not always provided by U-Boot. Use protocol interface functions instead of U-Boot internal functions. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d6566113 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose eficonfig_create_device_path() Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use eficonfig_create_device_path() to construct the full device path from device path of the volume and file path, so move it out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d571f9b2 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation All the eficonfig menus other than "Change Boot Order" use 'eficonfig_entry' structure for each menu entry. This commit refactors change boot order implementation to use 'eficonfig_entry' structure same as other menus to have consistent menu handling. This commit also simplifies the data->active handling when KEY_SPACE is pressed, and sizeof() parameter. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
8961e93e |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose append entry function Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use append_entry() and append_quit_entry() to construct the menu, so move them out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
a84040ab |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor file selection handling eficonfig_select_file_handler() is commonly used to select the file. eficonfig_display_select_file_option() adds an additional menu to clear the selected file. eficonfig_display_select_file_option() is not always necessary for the file selection process, so it must be outside of eficonfig_select_file_handler(). This commit also renames the following functions to avoid confusion. eficonfig_select_file_handler() -> eficonfig_process_select_file() eficonfig_select_file() -> eficonfig_show_file_selection() eficonfig_display_select_file_option() -> eficonfig_process_show_file_option() Finally, test_eficonfig.py need to be updated to get aligned with the above modification. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
1167e88a |
|
14-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix missing variable initialization The 'ret' variable must be initialized before use in eficonfig_delete_invalid_boot_option(). Fixes: c416f1c0bc ("bootmenu: add removable media entries") Addresses-Coverity: 376207 ("Uninitialized variables") Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
3d595ac5 |
|
09-Nov-2022 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: remove superfluous if in eficonfig_edit_boot_option Goto for an immediately succeeding label is superfluous. Fixes: 87d791423ac6 ("eficonfig: menu-driven addition of UEFI boot option") Addresses-Coverity: 376202 ("Identical code for different branches") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
f19171c9 |
|
08-Jan-2024 |
Ilias Apalodimas <ilias.apalodimas@linaro.org> |
efi_loader: Clean up efi_dp_append and efi_dp_concat Looking back at the initrd storing functionality, we introduced three functions, efi_dp_append_or_concatenate(), efi_dp_append/concat(). In hindsight we could have simplified that by a lot. First of all none of the functions append anything. They all allocate a new device path and concatenate the contents of two device paths in one. A boolean parameter controls the final device path -- if that's true an end node is injected between the two device paths. So let's rewrite this and make it a bit easier to read. Get rid of efi_dp_append(), efi_dp_concat() and rename efi_dp_append_or_concatenate() to efi_dp_concat(). This is far more intuitive and the only adjustment that is needed is an extra boolean argument on all callsites. Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
64658007 |
|
17-Nov-2023 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: eficonfig: create shortened boot options The boot options created by eficonfig should use shortened device-paths to avoid problems if drives are enumerated in a different sequence. Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
9945bc4f |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Fix incorrect return code of boot option update Correct the return code for out-of-memory and no boot option found Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
339b527b |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Move bootorder and bootoption apis to lib Rename and move bootorder and bootoption apis from cmd to lib for re-use between eficonfig and bootmgr Fix 'unexpected indentation' when 'make htmldocs' after functions are moved Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
2c0b0c31 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_SECURE_BOOT This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_SECURE_BOOT defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
83f3d121 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_MM_COMM_TEE This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_MM_COMM_TEE defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
88df3634 |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: CTRL+S to save the boot order 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>
|
#
45f5319f |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
menu: remove CTRL+C to quit On the sandbox called without "--terminal raw" CTRL+C leaves U-Boot, "ESC/CTRL+C to quit" is misleading. Let's remove CTRL+C to quit key handling from bootmenu and eficonfig menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
|
#
8dbd0a0f |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add vertical scroll support The current eficonfig menu does not support vertical scroll, so it can not display the menu entries greater than the console row size. This commit add the vertial scroll support. The console size is retrieved by SIMPLE_TEXT_OUTPUT_PROTOCOL.QueryMode() service, then calculates the row size for menu entry by subtracting menu header and description row size from the console row size. "start" and "end" are added in the efimenu structure. "start" keeps the menu entry index at the top, "end" keeps the bottom menu entry index. item_data_print() menu function only draws the menu entry between "start" and "end". This commit also fixes the issue that "Save" and "Quit" entries can be moved by BKEY_PLUS in change boot order menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
0d590852 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation This commit removes the change boot order specific menu implementation. The change boot order implementation calls eficonfig_process_common() same as other menus. The change boot order menu requires own item_data_print and item_choice implementation, but display_statusline function can be a same function as other menus. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
cd160b27 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor eficonfig_process_common function Current change boot order implementation does not call eficonfig_process_common() and call own menu functions for display_statusline, item_data_print and item_choice. Change boot order functionality should call eficonfig_process_common() to improve maintenanceability. This commit is a preparation to remove the change boot order specific implementation. The menu functions (display_statusline, item_data_print and item_choice) are added as argument of eficonfig_process_common(). The menu description string displayed at the bottom of the menu is also added as argument. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
32bab0ea |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Make use of CLI character processing Avoid duplicating some of the escape-sequence processing here and use the CLI function instead. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
d0ca98db |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Update bootmenu_loop() to return the code Use the return value to save having to pass around a pointer. This also resolves any ambiguity about what *key contains when the function is called. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
2da4a15e |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Rename KEY_... to BKEY_... This enum values conflict with linux/input.h so rename them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
64550274 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: avoid SetVariable between GetNextVariableName calls The current code calls efi_set_variable_int() to delete the invalid boot option between calls to efi_get_next_variable_name_int(), it may produce unpredictable results. This commit moves removal of the invalid boot option outside of the efi_get_next_variable_name_int() calls. EFI_NOT_FOUND returned from efi_get_next_variable_name_int() indicates we retrieved all EFI variables, it should be treated as EFI_SUCEESS. To address the checkpatch warning of too many leading tabs, combine two if statement into one. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
ce327084 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: carve out efi_get_next_variable_name_int calls To retrieve the EFI variable name by efi_get_next_variable_name_int(), the sequence of alloc -> efi_get_next_variable_name_int -> realloc -> efi_get_next_variable_name_int is required. In current code, this sequence repeatedly appears in the several functions. It should be curved out a common function. This commit also fixes the missing free() of var_name16 in eficonfig_delete_invalid_boot_option(). Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
140a8959 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use efi_get_next_variable_name_int() eficonfig command reads all possible UEFI load options from 0x0000 to 0xFFFF to construct the menu. This takes too much time in some environment. This commit uses efi_get_next_variable_name_int() to read all existing UEFI load options to significantlly reduce the count of efi_get_var() call. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
78b1ccc4 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use u16_strsize() to get u16 string buffer size Use u16_strsize() to simplify the u16 string buffer size calculation. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c67d3c9e |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix going one directory up issue The directory name in eficonfig menu entry contains the '\' separator. strcmp() argument ".." is wrong and one directory up handling does not work correctly. strcmp() argument must include '\' separator. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c3b5af63 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add UEFI Secure Boot Key enrollment interface This commit adds the menu-driven UEFI Secure Boot Key enrollment interface. User can enroll PK, KEK, db and dbx by selecting file. Only the signed EFI Signature List(s) with an authenticated header, typically '.auth' file, is accepted. To clear the PK, KEK, db and dbx, user needs to enroll the null key signed by PK or KEK. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
21faf4ef |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use protocol interface for file selection EFI_SIMPLE_FILE_SYSTEM_PROTOCOL is not always provided by U-Boot. Use protocol interface functions instead of U-Boot internal functions. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d6566113 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose eficonfig_create_device_path() Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use eficonfig_create_device_path() to construct the full device path from device path of the volume and file path, so move it out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d571f9b2 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation All the eficonfig menus other than "Change Boot Order" use 'eficonfig_entry' structure for each menu entry. This commit refactors change boot order implementation to use 'eficonfig_entry' structure same as other menus to have consistent menu handling. This commit also simplifies the data->active handling when KEY_SPACE is pressed, and sizeof() parameter. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
8961e93e |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose append entry function Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use append_entry() and append_quit_entry() to construct the menu, so move them out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
a84040ab |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor file selection handling eficonfig_select_file_handler() is commonly used to select the file. eficonfig_display_select_file_option() adds an additional menu to clear the selected file. eficonfig_display_select_file_option() is not always necessary for the file selection process, so it must be outside of eficonfig_select_file_handler(). This commit also renames the following functions to avoid confusion. eficonfig_select_file_handler() -> eficonfig_process_select_file() eficonfig_select_file() -> eficonfig_show_file_selection() eficonfig_display_select_file_option() -> eficonfig_process_show_file_option() Finally, test_eficonfig.py need to be updated to get aligned with the above modification. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
1167e88a |
|
14-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix missing variable initialization The 'ret' variable must be initialized before use in eficonfig_delete_invalid_boot_option(). Fixes: c416f1c0bc ("bootmenu: add removable media entries") Addresses-Coverity: 376207 ("Uninitialized variables") Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
3d595ac5 |
|
09-Nov-2022 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: remove superfluous if in eficonfig_edit_boot_option Goto for an immediately succeeding label is superfluous. Fixes: 87d791423ac6 ("eficonfig: menu-driven addition of UEFI boot option") Addresses-Coverity: 376202 ("Identical code for different branches") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
f19171c9 |
|
08-Jan-2024 |
Ilias Apalodimas <ilias.apalodimas@linaro.org> |
efi_loader: Clean up efi_dp_append and efi_dp_concat Looking back at the initrd storing functionality, we introduced three functions, efi_dp_append_or_concatenate(), efi_dp_append/concat(). In hindsight we could have simplified that by a lot. First of all none of the functions append anything. They all allocate a new device path and concatenate the contents of two device paths in one. A boolean parameter controls the final device path -- if that's true an end node is injected between the two device paths. So let's rewrite this and make it a bit easier to read. Get rid of efi_dp_append(), efi_dp_concat() and rename efi_dp_append_or_concatenate() to efi_dp_concat(). This is far more intuitive and the only adjustment that is needed is an extra boolean argument on all callsites. Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
64658007 |
|
17-Nov-2023 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: eficonfig: create shortened boot options The boot options created by eficonfig should use shortened device-paths to avoid problems if drives are enumerated in a different sequence. Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
9945bc4f |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Fix incorrect return code of boot option update Correct the return code for out-of-memory and no boot option found Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
339b527b |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Move bootorder and bootoption apis to lib Rename and move bootorder and bootoption apis from cmd to lib for re-use between eficonfig and bootmgr Fix 'unexpected indentation' when 'make htmldocs' after functions are moved Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
2c0b0c31 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_SECURE_BOOT This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_SECURE_BOOT defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
83f3d121 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_MM_COMM_TEE This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_MM_COMM_TEE defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
88df3634 |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: CTRL+S to save the boot order 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>
|
#
45f5319f |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
menu: remove CTRL+C to quit On the sandbox called without "--terminal raw" CTRL+C leaves U-Boot, "ESC/CTRL+C to quit" is misleading. Let's remove CTRL+C to quit key handling from bootmenu and eficonfig menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
|
#
8dbd0a0f |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add vertical scroll support The current eficonfig menu does not support vertical scroll, so it can not display the menu entries greater than the console row size. This commit add the vertial scroll support. The console size is retrieved by SIMPLE_TEXT_OUTPUT_PROTOCOL.QueryMode() service, then calculates the row size for menu entry by subtracting menu header and description row size from the console row size. "start" and "end" are added in the efimenu structure. "start" keeps the menu entry index at the top, "end" keeps the bottom menu entry index. item_data_print() menu function only draws the menu entry between "start" and "end". This commit also fixes the issue that "Save" and "Quit" entries can be moved by BKEY_PLUS in change boot order menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
0d590852 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation This commit removes the change boot order specific menu implementation. The change boot order implementation calls eficonfig_process_common() same as other menus. The change boot order menu requires own item_data_print and item_choice implementation, but display_statusline function can be a same function as other menus. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
cd160b27 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor eficonfig_process_common function Current change boot order implementation does not call eficonfig_process_common() and call own menu functions for display_statusline, item_data_print and item_choice. Change boot order functionality should call eficonfig_process_common() to improve maintenanceability. This commit is a preparation to remove the change boot order specific implementation. The menu functions (display_statusline, item_data_print and item_choice) are added as argument of eficonfig_process_common(). The menu description string displayed at the bottom of the menu is also added as argument. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
32bab0ea |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Make use of CLI character processing Avoid duplicating some of the escape-sequence processing here and use the CLI function instead. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
d0ca98db |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Update bootmenu_loop() to return the code Use the return value to save having to pass around a pointer. This also resolves any ambiguity about what *key contains when the function is called. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
2da4a15e |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Rename KEY_... to BKEY_... This enum values conflict with linux/input.h so rename them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
64550274 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: avoid SetVariable between GetNextVariableName calls The current code calls efi_set_variable_int() to delete the invalid boot option between calls to efi_get_next_variable_name_int(), it may produce unpredictable results. This commit moves removal of the invalid boot option outside of the efi_get_next_variable_name_int() calls. EFI_NOT_FOUND returned from efi_get_next_variable_name_int() indicates we retrieved all EFI variables, it should be treated as EFI_SUCEESS. To address the checkpatch warning of too many leading tabs, combine two if statement into one. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
ce327084 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: carve out efi_get_next_variable_name_int calls To retrieve the EFI variable name by efi_get_next_variable_name_int(), the sequence of alloc -> efi_get_next_variable_name_int -> realloc -> efi_get_next_variable_name_int is required. In current code, this sequence repeatedly appears in the several functions. It should be curved out a common function. This commit also fixes the missing free() of var_name16 in eficonfig_delete_invalid_boot_option(). Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
140a8959 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use efi_get_next_variable_name_int() eficonfig command reads all possible UEFI load options from 0x0000 to 0xFFFF to construct the menu. This takes too much time in some environment. This commit uses efi_get_next_variable_name_int() to read all existing UEFI load options to significantlly reduce the count of efi_get_var() call. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
78b1ccc4 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use u16_strsize() to get u16 string buffer size Use u16_strsize() to simplify the u16 string buffer size calculation. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c67d3c9e |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix going one directory up issue The directory name in eficonfig menu entry contains the '\' separator. strcmp() argument ".." is wrong and one directory up handling does not work correctly. strcmp() argument must include '\' separator. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c3b5af63 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add UEFI Secure Boot Key enrollment interface This commit adds the menu-driven UEFI Secure Boot Key enrollment interface. User can enroll PK, KEK, db and dbx by selecting file. Only the signed EFI Signature List(s) with an authenticated header, typically '.auth' file, is accepted. To clear the PK, KEK, db and dbx, user needs to enroll the null key signed by PK or KEK. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
21faf4ef |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use protocol interface for file selection EFI_SIMPLE_FILE_SYSTEM_PROTOCOL is not always provided by U-Boot. Use protocol interface functions instead of U-Boot internal functions. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d6566113 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose eficonfig_create_device_path() Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use eficonfig_create_device_path() to construct the full device path from device path of the volume and file path, so move it out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d571f9b2 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation All the eficonfig menus other than "Change Boot Order" use 'eficonfig_entry' structure for each menu entry. This commit refactors change boot order implementation to use 'eficonfig_entry' structure same as other menus to have consistent menu handling. This commit also simplifies the data->active handling when KEY_SPACE is pressed, and sizeof() parameter. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
8961e93e |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose append entry function Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use append_entry() and append_quit_entry() to construct the menu, so move them out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
a84040ab |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor file selection handling eficonfig_select_file_handler() is commonly used to select the file. eficonfig_display_select_file_option() adds an additional menu to clear the selected file. eficonfig_display_select_file_option() is not always necessary for the file selection process, so it must be outside of eficonfig_select_file_handler(). This commit also renames the following functions to avoid confusion. eficonfig_select_file_handler() -> eficonfig_process_select_file() eficonfig_select_file() -> eficonfig_show_file_selection() eficonfig_display_select_file_option() -> eficonfig_process_show_file_option() Finally, test_eficonfig.py need to be updated to get aligned with the above modification. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
1167e88a |
|
14-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix missing variable initialization The 'ret' variable must be initialized before use in eficonfig_delete_invalid_boot_option(). Fixes: c416f1c0bc ("bootmenu: add removable media entries") Addresses-Coverity: 376207 ("Uninitialized variables") Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
3d595ac5 |
|
09-Nov-2022 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: remove superfluous if in eficonfig_edit_boot_option Goto for an immediately succeeding label is superfluous. Fixes: 87d791423ac6 ("eficonfig: menu-driven addition of UEFI boot option") Addresses-Coverity: 376202 ("Identical code for different branches") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
f19171c9 |
|
08-Jan-2024 |
Ilias Apalodimas <ilias.apalodimas@linaro.org> |
efi_loader: Clean up efi_dp_append and efi_dp_concat Looking back at the initrd storing functionality, we introduced three functions, efi_dp_append_or_concatenate(), efi_dp_append/concat(). In hindsight we could have simplified that by a lot. First of all none of the functions append anything. They all allocate a new device path and concatenate the contents of two device paths in one. A boolean parameter controls the final device path -- if that's true an end node is injected between the two device paths. So let's rewrite this and make it a bit easier to read. Get rid of efi_dp_append(), efi_dp_concat() and rename efi_dp_append_or_concatenate() to efi_dp_concat(). This is far more intuitive and the only adjustment that is needed is an extra boolean argument on all callsites. Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
64658007 |
|
17-Nov-2023 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: eficonfig: create shortened boot options The boot options created by eficonfig should use shortened device-paths to avoid problems if drives are enumerated in a different sequence. Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
9945bc4f |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Fix incorrect return code of boot option update Correct the return code for out-of-memory and no boot option found Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
339b527b |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Move bootorder and bootoption apis to lib Rename and move bootorder and bootoption apis from cmd to lib for re-use between eficonfig and bootmgr Fix 'unexpected indentation' when 'make htmldocs' after functions are moved Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
2c0b0c31 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_SECURE_BOOT This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_SECURE_BOOT defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
83f3d121 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_MM_COMM_TEE This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_MM_COMM_TEE defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
88df3634 |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: CTRL+S to save the boot order 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>
|
#
45f5319f |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
menu: remove CTRL+C to quit On the sandbox called without "--terminal raw" CTRL+C leaves U-Boot, "ESC/CTRL+C to quit" is misleading. Let's remove CTRL+C to quit key handling from bootmenu and eficonfig menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
|
#
8dbd0a0f |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add vertical scroll support The current eficonfig menu does not support vertical scroll, so it can not display the menu entries greater than the console row size. This commit add the vertial scroll support. The console size is retrieved by SIMPLE_TEXT_OUTPUT_PROTOCOL.QueryMode() service, then calculates the row size for menu entry by subtracting menu header and description row size from the console row size. "start" and "end" are added in the efimenu structure. "start" keeps the menu entry index at the top, "end" keeps the bottom menu entry index. item_data_print() menu function only draws the menu entry between "start" and "end". This commit also fixes the issue that "Save" and "Quit" entries can be moved by BKEY_PLUS in change boot order menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
0d590852 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation This commit removes the change boot order specific menu implementation. The change boot order implementation calls eficonfig_process_common() same as other menus. The change boot order menu requires own item_data_print and item_choice implementation, but display_statusline function can be a same function as other menus. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
cd160b27 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor eficonfig_process_common function Current change boot order implementation does not call eficonfig_process_common() and call own menu functions for display_statusline, item_data_print and item_choice. Change boot order functionality should call eficonfig_process_common() to improve maintenanceability. This commit is a preparation to remove the change boot order specific implementation. The menu functions (display_statusline, item_data_print and item_choice) are added as argument of eficonfig_process_common(). The menu description string displayed at the bottom of the menu is also added as argument. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
32bab0ea |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Make use of CLI character processing Avoid duplicating some of the escape-sequence processing here and use the CLI function instead. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
d0ca98db |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Update bootmenu_loop() to return the code Use the return value to save having to pass around a pointer. This also resolves any ambiguity about what *key contains when the function is called. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
2da4a15e |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Rename KEY_... to BKEY_... This enum values conflict with linux/input.h so rename them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
64550274 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: avoid SetVariable between GetNextVariableName calls The current code calls efi_set_variable_int() to delete the invalid boot option between calls to efi_get_next_variable_name_int(), it may produce unpredictable results. This commit moves removal of the invalid boot option outside of the efi_get_next_variable_name_int() calls. EFI_NOT_FOUND returned from efi_get_next_variable_name_int() indicates we retrieved all EFI variables, it should be treated as EFI_SUCEESS. To address the checkpatch warning of too many leading tabs, combine two if statement into one. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
ce327084 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: carve out efi_get_next_variable_name_int calls To retrieve the EFI variable name by efi_get_next_variable_name_int(), the sequence of alloc -> efi_get_next_variable_name_int -> realloc -> efi_get_next_variable_name_int is required. In current code, this sequence repeatedly appears in the several functions. It should be curved out a common function. This commit also fixes the missing free() of var_name16 in eficonfig_delete_invalid_boot_option(). Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
140a8959 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use efi_get_next_variable_name_int() eficonfig command reads all possible UEFI load options from 0x0000 to 0xFFFF to construct the menu. This takes too much time in some environment. This commit uses efi_get_next_variable_name_int() to read all existing UEFI load options to significantlly reduce the count of efi_get_var() call. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
78b1ccc4 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use u16_strsize() to get u16 string buffer size Use u16_strsize() to simplify the u16 string buffer size calculation. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c67d3c9e |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix going one directory up issue The directory name in eficonfig menu entry contains the '\' separator. strcmp() argument ".." is wrong and one directory up handling does not work correctly. strcmp() argument must include '\' separator. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c3b5af63 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add UEFI Secure Boot Key enrollment interface This commit adds the menu-driven UEFI Secure Boot Key enrollment interface. User can enroll PK, KEK, db and dbx by selecting file. Only the signed EFI Signature List(s) with an authenticated header, typically '.auth' file, is accepted. To clear the PK, KEK, db and dbx, user needs to enroll the null key signed by PK or KEK. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
21faf4ef |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use protocol interface for file selection EFI_SIMPLE_FILE_SYSTEM_PROTOCOL is not always provided by U-Boot. Use protocol interface functions instead of U-Boot internal functions. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d6566113 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose eficonfig_create_device_path() Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use eficonfig_create_device_path() to construct the full device path from device path of the volume and file path, so move it out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d571f9b2 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation All the eficonfig menus other than "Change Boot Order" use 'eficonfig_entry' structure for each menu entry. This commit refactors change boot order implementation to use 'eficonfig_entry' structure same as other menus to have consistent menu handling. This commit also simplifies the data->active handling when KEY_SPACE is pressed, and sizeof() parameter. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
8961e93e |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose append entry function Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use append_entry() and append_quit_entry() to construct the menu, so move them out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
a84040ab |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor file selection handling eficonfig_select_file_handler() is commonly used to select the file. eficonfig_display_select_file_option() adds an additional menu to clear the selected file. eficonfig_display_select_file_option() is not always necessary for the file selection process, so it must be outside of eficonfig_select_file_handler(). This commit also renames the following functions to avoid confusion. eficonfig_select_file_handler() -> eficonfig_process_select_file() eficonfig_select_file() -> eficonfig_show_file_selection() eficonfig_display_select_file_option() -> eficonfig_process_show_file_option() Finally, test_eficonfig.py need to be updated to get aligned with the above modification. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
1167e88a |
|
14-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix missing variable initialization The 'ret' variable must be initialized before use in eficonfig_delete_invalid_boot_option(). Fixes: c416f1c0bc ("bootmenu: add removable media entries") Addresses-Coverity: 376207 ("Uninitialized variables") Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
3d595ac5 |
|
09-Nov-2022 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: remove superfluous if in eficonfig_edit_boot_option Goto for an immediately succeeding label is superfluous. Fixes: 87d791423ac6 ("eficonfig: menu-driven addition of UEFI boot option") Addresses-Coverity: 376202 ("Identical code for different branches") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
f19171c9 |
|
08-Jan-2024 |
Ilias Apalodimas <ilias.apalodimas@linaro.org> |
efi_loader: Clean up efi_dp_append and efi_dp_concat Looking back at the initrd storing functionality, we introduced three functions, efi_dp_append_or_concatenate(), efi_dp_append/concat(). In hindsight we could have simplified that by a lot. First of all none of the functions append anything. They all allocate a new device path and concatenate the contents of two device paths in one. A boolean parameter controls the final device path -- if that's true an end node is injected between the two device paths. So let's rewrite this and make it a bit easier to read. Get rid of efi_dp_append(), efi_dp_concat() and rename efi_dp_append_or_concatenate() to efi_dp_concat(). This is far more intuitive and the only adjustment that is needed is an extra boolean argument on all callsites. Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
64658007 |
|
17-Nov-2023 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: eficonfig: create shortened boot options The boot options created by eficonfig should use shortened device-paths to avoid problems if drives are enumerated in a different sequence. Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
9945bc4f |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Fix incorrect return code of boot option update Correct the return code for out-of-memory and no boot option found Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
339b527b |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Move bootorder and bootoption apis to lib Rename and move bootorder and bootoption apis from cmd to lib for re-use between eficonfig and bootmgr Fix 'unexpected indentation' when 'make htmldocs' after functions are moved Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
2c0b0c31 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_SECURE_BOOT This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_SECURE_BOOT defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
83f3d121 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_MM_COMM_TEE This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_MM_COMM_TEE defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
88df3634 |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: CTRL+S to save the boot order 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>
|
#
45f5319f |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
menu: remove CTRL+C to quit On the sandbox called without "--terminal raw" CTRL+C leaves U-Boot, "ESC/CTRL+C to quit" is misleading. Let's remove CTRL+C to quit key handling from bootmenu and eficonfig menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
|
#
8dbd0a0f |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add vertical scroll support The current eficonfig menu does not support vertical scroll, so it can not display the menu entries greater than the console row size. This commit add the vertial scroll support. The console size is retrieved by SIMPLE_TEXT_OUTPUT_PROTOCOL.QueryMode() service, then calculates the row size for menu entry by subtracting menu header and description row size from the console row size. "start" and "end" are added in the efimenu structure. "start" keeps the menu entry index at the top, "end" keeps the bottom menu entry index. item_data_print() menu function only draws the menu entry between "start" and "end". This commit also fixes the issue that "Save" and "Quit" entries can be moved by BKEY_PLUS in change boot order menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
0d590852 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation This commit removes the change boot order specific menu implementation. The change boot order implementation calls eficonfig_process_common() same as other menus. The change boot order menu requires own item_data_print and item_choice implementation, but display_statusline function can be a same function as other menus. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
cd160b27 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor eficonfig_process_common function Current change boot order implementation does not call eficonfig_process_common() and call own menu functions for display_statusline, item_data_print and item_choice. Change boot order functionality should call eficonfig_process_common() to improve maintenanceability. This commit is a preparation to remove the change boot order specific implementation. The menu functions (display_statusline, item_data_print and item_choice) are added as argument of eficonfig_process_common(). The menu description string displayed at the bottom of the menu is also added as argument. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
32bab0ea |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Make use of CLI character processing Avoid duplicating some of the escape-sequence processing here and use the CLI function instead. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
d0ca98db |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Update bootmenu_loop() to return the code Use the return value to save having to pass around a pointer. This also resolves any ambiguity about what *key contains when the function is called. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
2da4a15e |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Rename KEY_... to BKEY_... This enum values conflict with linux/input.h so rename them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
64550274 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: avoid SetVariable between GetNextVariableName calls The current code calls efi_set_variable_int() to delete the invalid boot option between calls to efi_get_next_variable_name_int(), it may produce unpredictable results. This commit moves removal of the invalid boot option outside of the efi_get_next_variable_name_int() calls. EFI_NOT_FOUND returned from efi_get_next_variable_name_int() indicates we retrieved all EFI variables, it should be treated as EFI_SUCEESS. To address the checkpatch warning of too many leading tabs, combine two if statement into one. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
ce327084 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: carve out efi_get_next_variable_name_int calls To retrieve the EFI variable name by efi_get_next_variable_name_int(), the sequence of alloc -> efi_get_next_variable_name_int -> realloc -> efi_get_next_variable_name_int is required. In current code, this sequence repeatedly appears in the several functions. It should be curved out a common function. This commit also fixes the missing free() of var_name16 in eficonfig_delete_invalid_boot_option(). Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
140a8959 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use efi_get_next_variable_name_int() eficonfig command reads all possible UEFI load options from 0x0000 to 0xFFFF to construct the menu. This takes too much time in some environment. This commit uses efi_get_next_variable_name_int() to read all existing UEFI load options to significantlly reduce the count of efi_get_var() call. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
78b1ccc4 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use u16_strsize() to get u16 string buffer size Use u16_strsize() to simplify the u16 string buffer size calculation. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c67d3c9e |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix going one directory up issue The directory name in eficonfig menu entry contains the '\' separator. strcmp() argument ".." is wrong and one directory up handling does not work correctly. strcmp() argument must include '\' separator. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c3b5af63 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add UEFI Secure Boot Key enrollment interface This commit adds the menu-driven UEFI Secure Boot Key enrollment interface. User can enroll PK, KEK, db and dbx by selecting file. Only the signed EFI Signature List(s) with an authenticated header, typically '.auth' file, is accepted. To clear the PK, KEK, db and dbx, user needs to enroll the null key signed by PK or KEK. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
21faf4ef |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use protocol interface for file selection EFI_SIMPLE_FILE_SYSTEM_PROTOCOL is not always provided by U-Boot. Use protocol interface functions instead of U-Boot internal functions. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d6566113 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose eficonfig_create_device_path() Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use eficonfig_create_device_path() to construct the full device path from device path of the volume and file path, so move it out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d571f9b2 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation All the eficonfig menus other than "Change Boot Order" use 'eficonfig_entry' structure for each menu entry. This commit refactors change boot order implementation to use 'eficonfig_entry' structure same as other menus to have consistent menu handling. This commit also simplifies the data->active handling when KEY_SPACE is pressed, and sizeof() parameter. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
8961e93e |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose append entry function Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use append_entry() and append_quit_entry() to construct the menu, so move them out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
a84040ab |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor file selection handling eficonfig_select_file_handler() is commonly used to select the file. eficonfig_display_select_file_option() adds an additional menu to clear the selected file. eficonfig_display_select_file_option() is not always necessary for the file selection process, so it must be outside of eficonfig_select_file_handler(). This commit also renames the following functions to avoid confusion. eficonfig_select_file_handler() -> eficonfig_process_select_file() eficonfig_select_file() -> eficonfig_show_file_selection() eficonfig_display_select_file_option() -> eficonfig_process_show_file_option() Finally, test_eficonfig.py need to be updated to get aligned with the above modification. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
1167e88a |
|
14-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix missing variable initialization The 'ret' variable must be initialized before use in eficonfig_delete_invalid_boot_option(). Fixes: c416f1c0bc ("bootmenu: add removable media entries") Addresses-Coverity: 376207 ("Uninitialized variables") Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
3d595ac5 |
|
09-Nov-2022 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: remove superfluous if in eficonfig_edit_boot_option Goto for an immediately succeeding label is superfluous. Fixes: 87d791423ac6 ("eficonfig: menu-driven addition of UEFI boot option") Addresses-Coverity: 376202 ("Identical code for different branches") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
f19171c9 |
|
08-Jan-2024 |
Ilias Apalodimas <ilias.apalodimas@linaro.org> |
efi_loader: Clean up efi_dp_append and efi_dp_concat Looking back at the initrd storing functionality, we introduced three functions, efi_dp_append_or_concatenate(), efi_dp_append/concat(). In hindsight we could have simplified that by a lot. First of all none of the functions append anything. They all allocate a new device path and concatenate the contents of two device paths in one. A boolean parameter controls the final device path -- if that's true an end node is injected between the two device paths. So let's rewrite this and make it a bit easier to read. Get rid of efi_dp_append(), efi_dp_concat() and rename efi_dp_append_or_concatenate() to efi_dp_concat(). This is far more intuitive and the only adjustment that is needed is an extra boolean argument on all callsites. Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
64658007 |
|
17-Nov-2023 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: eficonfig: create shortened boot options The boot options created by eficonfig should use shortened device-paths to avoid problems if drives are enumerated in a different sequence. Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
9945bc4f |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Fix incorrect return code of boot option update Correct the return code for out-of-memory and no boot option found Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
339b527b |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Move bootorder and bootoption apis to lib Rename and move bootorder and bootoption apis from cmd to lib for re-use between eficonfig and bootmgr Fix 'unexpected indentation' when 'make htmldocs' after functions are moved Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
2c0b0c31 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_SECURE_BOOT This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_SECURE_BOOT defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
83f3d121 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_MM_COMM_TEE This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_MM_COMM_TEE defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
88df3634 |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: CTRL+S to save the boot order 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>
|
#
45f5319f |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
menu: remove CTRL+C to quit On the sandbox called without "--terminal raw" CTRL+C leaves U-Boot, "ESC/CTRL+C to quit" is misleading. Let's remove CTRL+C to quit key handling from bootmenu and eficonfig menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
|
#
8dbd0a0f |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add vertical scroll support The current eficonfig menu does not support vertical scroll, so it can not display the menu entries greater than the console row size. This commit add the vertial scroll support. The console size is retrieved by SIMPLE_TEXT_OUTPUT_PROTOCOL.QueryMode() service, then calculates the row size for menu entry by subtracting menu header and description row size from the console row size. "start" and "end" are added in the efimenu structure. "start" keeps the menu entry index at the top, "end" keeps the bottom menu entry index. item_data_print() menu function only draws the menu entry between "start" and "end". This commit also fixes the issue that "Save" and "Quit" entries can be moved by BKEY_PLUS in change boot order menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
0d590852 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation This commit removes the change boot order specific menu implementation. The change boot order implementation calls eficonfig_process_common() same as other menus. The change boot order menu requires own item_data_print and item_choice implementation, but display_statusline function can be a same function as other menus. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
cd160b27 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor eficonfig_process_common function Current change boot order implementation does not call eficonfig_process_common() and call own menu functions for display_statusline, item_data_print and item_choice. Change boot order functionality should call eficonfig_process_common() to improve maintenanceability. This commit is a preparation to remove the change boot order specific implementation. The menu functions (display_statusline, item_data_print and item_choice) are added as argument of eficonfig_process_common(). The menu description string displayed at the bottom of the menu is also added as argument. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
32bab0ea |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Make use of CLI character processing Avoid duplicating some of the escape-sequence processing here and use the CLI function instead. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
d0ca98db |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Update bootmenu_loop() to return the code Use the return value to save having to pass around a pointer. This also resolves any ambiguity about what *key contains when the function is called. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
2da4a15e |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Rename KEY_... to BKEY_... This enum values conflict with linux/input.h so rename them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
64550274 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: avoid SetVariable between GetNextVariableName calls The current code calls efi_set_variable_int() to delete the invalid boot option between calls to efi_get_next_variable_name_int(), it may produce unpredictable results. This commit moves removal of the invalid boot option outside of the efi_get_next_variable_name_int() calls. EFI_NOT_FOUND returned from efi_get_next_variable_name_int() indicates we retrieved all EFI variables, it should be treated as EFI_SUCEESS. To address the checkpatch warning of too many leading tabs, combine two if statement into one. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
ce327084 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: carve out efi_get_next_variable_name_int calls To retrieve the EFI variable name by efi_get_next_variable_name_int(), the sequence of alloc -> efi_get_next_variable_name_int -> realloc -> efi_get_next_variable_name_int is required. In current code, this sequence repeatedly appears in the several functions. It should be curved out a common function. This commit also fixes the missing free() of var_name16 in eficonfig_delete_invalid_boot_option(). Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
140a8959 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use efi_get_next_variable_name_int() eficonfig command reads all possible UEFI load options from 0x0000 to 0xFFFF to construct the menu. This takes too much time in some environment. This commit uses efi_get_next_variable_name_int() to read all existing UEFI load options to significantlly reduce the count of efi_get_var() call. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
78b1ccc4 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use u16_strsize() to get u16 string buffer size Use u16_strsize() to simplify the u16 string buffer size calculation. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c67d3c9e |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix going one directory up issue The directory name in eficonfig menu entry contains the '\' separator. strcmp() argument ".." is wrong and one directory up handling does not work correctly. strcmp() argument must include '\' separator. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c3b5af63 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add UEFI Secure Boot Key enrollment interface This commit adds the menu-driven UEFI Secure Boot Key enrollment interface. User can enroll PK, KEK, db and dbx by selecting file. Only the signed EFI Signature List(s) with an authenticated header, typically '.auth' file, is accepted. To clear the PK, KEK, db and dbx, user needs to enroll the null key signed by PK or KEK. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
21faf4ef |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use protocol interface for file selection EFI_SIMPLE_FILE_SYSTEM_PROTOCOL is not always provided by U-Boot. Use protocol interface functions instead of U-Boot internal functions. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d6566113 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose eficonfig_create_device_path() Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use eficonfig_create_device_path() to construct the full device path from device path of the volume and file path, so move it out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d571f9b2 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation All the eficonfig menus other than "Change Boot Order" use 'eficonfig_entry' structure for each menu entry. This commit refactors change boot order implementation to use 'eficonfig_entry' structure same as other menus to have consistent menu handling. This commit also simplifies the data->active handling when KEY_SPACE is pressed, and sizeof() parameter. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
8961e93e |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose append entry function Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use append_entry() and append_quit_entry() to construct the menu, so move them out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
a84040ab |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor file selection handling eficonfig_select_file_handler() is commonly used to select the file. eficonfig_display_select_file_option() adds an additional menu to clear the selected file. eficonfig_display_select_file_option() is not always necessary for the file selection process, so it must be outside of eficonfig_select_file_handler(). This commit also renames the following functions to avoid confusion. eficonfig_select_file_handler() -> eficonfig_process_select_file() eficonfig_select_file() -> eficonfig_show_file_selection() eficonfig_display_select_file_option() -> eficonfig_process_show_file_option() Finally, test_eficonfig.py need to be updated to get aligned with the above modification. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
1167e88a |
|
14-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix missing variable initialization The 'ret' variable must be initialized before use in eficonfig_delete_invalid_boot_option(). Fixes: c416f1c0bc ("bootmenu: add removable media entries") Addresses-Coverity: 376207 ("Uninitialized variables") Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
3d595ac5 |
|
09-Nov-2022 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: remove superfluous if in eficonfig_edit_boot_option Goto for an immediately succeeding label is superfluous. Fixes: 87d791423ac6 ("eficonfig: menu-driven addition of UEFI boot option") Addresses-Coverity: 376202 ("Identical code for different branches") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
f19171c9 |
|
08-Jan-2024 |
Ilias Apalodimas <ilias.apalodimas@linaro.org> |
efi_loader: Clean up efi_dp_append and efi_dp_concat Looking back at the initrd storing functionality, we introduced three functions, efi_dp_append_or_concatenate(), efi_dp_append/concat(). In hindsight we could have simplified that by a lot. First of all none of the functions append anything. They all allocate a new device path and concatenate the contents of two device paths in one. A boolean parameter controls the final device path -- if that's true an end node is injected between the two device paths. So let's rewrite this and make it a bit easier to read. Get rid of efi_dp_append(), efi_dp_concat() and rename efi_dp_append_or_concatenate() to efi_dp_concat(). This is far more intuitive and the only adjustment that is needed is an extra boolean argument on all callsites. Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
64658007 |
|
17-Nov-2023 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: eficonfig: create shortened boot options The boot options created by eficonfig should use shortened device-paths to avoid problems if drives are enumerated in a different sequence. Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
9945bc4f |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Fix incorrect return code of boot option update Correct the return code for out-of-memory and no boot option found Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
339b527b |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Move bootorder and bootoption apis to lib Rename and move bootorder and bootoption apis from cmd to lib for re-use between eficonfig and bootmgr Fix 'unexpected indentation' when 'make htmldocs' after functions are moved Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
2c0b0c31 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_SECURE_BOOT This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_SECURE_BOOT defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
83f3d121 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_MM_COMM_TEE This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_MM_COMM_TEE defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
88df3634 |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: CTRL+S to save the boot order 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>
|
#
45f5319f |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
menu: remove CTRL+C to quit On the sandbox called without "--terminal raw" CTRL+C leaves U-Boot, "ESC/CTRL+C to quit" is misleading. Let's remove CTRL+C to quit key handling from bootmenu and eficonfig menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
|
#
8dbd0a0f |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add vertical scroll support The current eficonfig menu does not support vertical scroll, so it can not display the menu entries greater than the console row size. This commit add the vertial scroll support. The console size is retrieved by SIMPLE_TEXT_OUTPUT_PROTOCOL.QueryMode() service, then calculates the row size for menu entry by subtracting menu header and description row size from the console row size. "start" and "end" are added in the efimenu structure. "start" keeps the menu entry index at the top, "end" keeps the bottom menu entry index. item_data_print() menu function only draws the menu entry between "start" and "end". This commit also fixes the issue that "Save" and "Quit" entries can be moved by BKEY_PLUS in change boot order menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
0d590852 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation This commit removes the change boot order specific menu implementation. The change boot order implementation calls eficonfig_process_common() same as other menus. The change boot order menu requires own item_data_print and item_choice implementation, but display_statusline function can be a same function as other menus. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
cd160b27 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor eficonfig_process_common function Current change boot order implementation does not call eficonfig_process_common() and call own menu functions for display_statusline, item_data_print and item_choice. Change boot order functionality should call eficonfig_process_common() to improve maintenanceability. This commit is a preparation to remove the change boot order specific implementation. The menu functions (display_statusline, item_data_print and item_choice) are added as argument of eficonfig_process_common(). The menu description string displayed at the bottom of the menu is also added as argument. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
32bab0ea |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Make use of CLI character processing Avoid duplicating some of the escape-sequence processing here and use the CLI function instead. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
d0ca98db |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Update bootmenu_loop() to return the code Use the return value to save having to pass around a pointer. This also resolves any ambiguity about what *key contains when the function is called. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
2da4a15e |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Rename KEY_... to BKEY_... This enum values conflict with linux/input.h so rename them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
64550274 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: avoid SetVariable between GetNextVariableName calls The current code calls efi_set_variable_int() to delete the invalid boot option between calls to efi_get_next_variable_name_int(), it may produce unpredictable results. This commit moves removal of the invalid boot option outside of the efi_get_next_variable_name_int() calls. EFI_NOT_FOUND returned from efi_get_next_variable_name_int() indicates we retrieved all EFI variables, it should be treated as EFI_SUCEESS. To address the checkpatch warning of too many leading tabs, combine two if statement into one. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
ce327084 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: carve out efi_get_next_variable_name_int calls To retrieve the EFI variable name by efi_get_next_variable_name_int(), the sequence of alloc -> efi_get_next_variable_name_int -> realloc -> efi_get_next_variable_name_int is required. In current code, this sequence repeatedly appears in the several functions. It should be curved out a common function. This commit also fixes the missing free() of var_name16 in eficonfig_delete_invalid_boot_option(). Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
140a8959 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use efi_get_next_variable_name_int() eficonfig command reads all possible UEFI load options from 0x0000 to 0xFFFF to construct the menu. This takes too much time in some environment. This commit uses efi_get_next_variable_name_int() to read all existing UEFI load options to significantlly reduce the count of efi_get_var() call. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
78b1ccc4 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use u16_strsize() to get u16 string buffer size Use u16_strsize() to simplify the u16 string buffer size calculation. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c67d3c9e |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix going one directory up issue The directory name in eficonfig menu entry contains the '\' separator. strcmp() argument ".." is wrong and one directory up handling does not work correctly. strcmp() argument must include '\' separator. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c3b5af63 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add UEFI Secure Boot Key enrollment interface This commit adds the menu-driven UEFI Secure Boot Key enrollment interface. User can enroll PK, KEK, db and dbx by selecting file. Only the signed EFI Signature List(s) with an authenticated header, typically '.auth' file, is accepted. To clear the PK, KEK, db and dbx, user needs to enroll the null key signed by PK or KEK. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
21faf4ef |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use protocol interface for file selection EFI_SIMPLE_FILE_SYSTEM_PROTOCOL is not always provided by U-Boot. Use protocol interface functions instead of U-Boot internal functions. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d6566113 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose eficonfig_create_device_path() Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use eficonfig_create_device_path() to construct the full device path from device path of the volume and file path, so move it out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d571f9b2 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation All the eficonfig menus other than "Change Boot Order" use 'eficonfig_entry' structure for each menu entry. This commit refactors change boot order implementation to use 'eficonfig_entry' structure same as other menus to have consistent menu handling. This commit also simplifies the data->active handling when KEY_SPACE is pressed, and sizeof() parameter. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
8961e93e |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose append entry function Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use append_entry() and append_quit_entry() to construct the menu, so move them out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
a84040ab |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor file selection handling eficonfig_select_file_handler() is commonly used to select the file. eficonfig_display_select_file_option() adds an additional menu to clear the selected file. eficonfig_display_select_file_option() is not always necessary for the file selection process, so it must be outside of eficonfig_select_file_handler(). This commit also renames the following functions to avoid confusion. eficonfig_select_file_handler() -> eficonfig_process_select_file() eficonfig_select_file() -> eficonfig_show_file_selection() eficonfig_display_select_file_option() -> eficonfig_process_show_file_option() Finally, test_eficonfig.py need to be updated to get aligned with the above modification. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
1167e88a |
|
14-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix missing variable initialization The 'ret' variable must be initialized before use in eficonfig_delete_invalid_boot_option(). Fixes: c416f1c0bc ("bootmenu: add removable media entries") Addresses-Coverity: 376207 ("Uninitialized variables") Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
3d595ac5 |
|
09-Nov-2022 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: remove superfluous if in eficonfig_edit_boot_option Goto for an immediately succeeding label is superfluous. Fixes: 87d791423ac6 ("eficonfig: menu-driven addition of UEFI boot option") Addresses-Coverity: 376202 ("Identical code for different branches") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
f19171c9 |
|
08-Jan-2024 |
Ilias Apalodimas <ilias.apalodimas@linaro.org> |
efi_loader: Clean up efi_dp_append and efi_dp_concat Looking back at the initrd storing functionality, we introduced three functions, efi_dp_append_or_concatenate(), efi_dp_append/concat(). In hindsight we could have simplified that by a lot. First of all none of the functions append anything. They all allocate a new device path and concatenate the contents of two device paths in one. A boolean parameter controls the final device path -- if that's true an end node is injected between the two device paths. So let's rewrite this and make it a bit easier to read. Get rid of efi_dp_append(), efi_dp_concat() and rename efi_dp_append_or_concatenate() to efi_dp_concat(). This is far more intuitive and the only adjustment that is needed is an extra boolean argument on all callsites. Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
64658007 |
|
17-Nov-2023 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: eficonfig: create shortened boot options The boot options created by eficonfig should use shortened device-paths to avoid problems if drives are enumerated in a different sequence. Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
9945bc4f |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Fix incorrect return code of boot option update Correct the return code for out-of-memory and no boot option found Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
339b527b |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Move bootorder and bootoption apis to lib Rename and move bootorder and bootoption apis from cmd to lib for re-use between eficonfig and bootmgr Fix 'unexpected indentation' when 'make htmldocs' after functions are moved Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
2c0b0c31 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_SECURE_BOOT This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_SECURE_BOOT defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
83f3d121 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_MM_COMM_TEE This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_MM_COMM_TEE defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
88df3634 |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: CTRL+S to save the boot order 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>
|
#
45f5319f |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
menu: remove CTRL+C to quit On the sandbox called without "--terminal raw" CTRL+C leaves U-Boot, "ESC/CTRL+C to quit" is misleading. Let's remove CTRL+C to quit key handling from bootmenu and eficonfig menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
|
#
8dbd0a0f |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add vertical scroll support The current eficonfig menu does not support vertical scroll, so it can not display the menu entries greater than the console row size. This commit add the vertial scroll support. The console size is retrieved by SIMPLE_TEXT_OUTPUT_PROTOCOL.QueryMode() service, then calculates the row size for menu entry by subtracting menu header and description row size from the console row size. "start" and "end" are added in the efimenu structure. "start" keeps the menu entry index at the top, "end" keeps the bottom menu entry index. item_data_print() menu function only draws the menu entry between "start" and "end". This commit also fixes the issue that "Save" and "Quit" entries can be moved by BKEY_PLUS in change boot order menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
0d590852 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation This commit removes the change boot order specific menu implementation. The change boot order implementation calls eficonfig_process_common() same as other menus. The change boot order menu requires own item_data_print and item_choice implementation, but display_statusline function can be a same function as other menus. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
cd160b27 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor eficonfig_process_common function Current change boot order implementation does not call eficonfig_process_common() and call own menu functions for display_statusline, item_data_print and item_choice. Change boot order functionality should call eficonfig_process_common() to improve maintenanceability. This commit is a preparation to remove the change boot order specific implementation. The menu functions (display_statusline, item_data_print and item_choice) are added as argument of eficonfig_process_common(). The menu description string displayed at the bottom of the menu is also added as argument. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
32bab0ea |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Make use of CLI character processing Avoid duplicating some of the escape-sequence processing here and use the CLI function instead. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
d0ca98db |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Update bootmenu_loop() to return the code Use the return value to save having to pass around a pointer. This also resolves any ambiguity about what *key contains when the function is called. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
2da4a15e |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Rename KEY_... to BKEY_... This enum values conflict with linux/input.h so rename them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
64550274 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: avoid SetVariable between GetNextVariableName calls The current code calls efi_set_variable_int() to delete the invalid boot option between calls to efi_get_next_variable_name_int(), it may produce unpredictable results. This commit moves removal of the invalid boot option outside of the efi_get_next_variable_name_int() calls. EFI_NOT_FOUND returned from efi_get_next_variable_name_int() indicates we retrieved all EFI variables, it should be treated as EFI_SUCEESS. To address the checkpatch warning of too many leading tabs, combine two if statement into one. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
ce327084 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: carve out efi_get_next_variable_name_int calls To retrieve the EFI variable name by efi_get_next_variable_name_int(), the sequence of alloc -> efi_get_next_variable_name_int -> realloc -> efi_get_next_variable_name_int is required. In current code, this sequence repeatedly appears in the several functions. It should be curved out a common function. This commit also fixes the missing free() of var_name16 in eficonfig_delete_invalid_boot_option(). Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
140a8959 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use efi_get_next_variable_name_int() eficonfig command reads all possible UEFI load options from 0x0000 to 0xFFFF to construct the menu. This takes too much time in some environment. This commit uses efi_get_next_variable_name_int() to read all existing UEFI load options to significantlly reduce the count of efi_get_var() call. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
78b1ccc4 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use u16_strsize() to get u16 string buffer size Use u16_strsize() to simplify the u16 string buffer size calculation. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c67d3c9e |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix going one directory up issue The directory name in eficonfig menu entry contains the '\' separator. strcmp() argument ".." is wrong and one directory up handling does not work correctly. strcmp() argument must include '\' separator. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c3b5af63 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add UEFI Secure Boot Key enrollment interface This commit adds the menu-driven UEFI Secure Boot Key enrollment interface. User can enroll PK, KEK, db and dbx by selecting file. Only the signed EFI Signature List(s) with an authenticated header, typically '.auth' file, is accepted. To clear the PK, KEK, db and dbx, user needs to enroll the null key signed by PK or KEK. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
21faf4ef |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use protocol interface for file selection EFI_SIMPLE_FILE_SYSTEM_PROTOCOL is not always provided by U-Boot. Use protocol interface functions instead of U-Boot internal functions. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d6566113 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose eficonfig_create_device_path() Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use eficonfig_create_device_path() to construct the full device path from device path of the volume and file path, so move it out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d571f9b2 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation All the eficonfig menus other than "Change Boot Order" use 'eficonfig_entry' structure for each menu entry. This commit refactors change boot order implementation to use 'eficonfig_entry' structure same as other menus to have consistent menu handling. This commit also simplifies the data->active handling when KEY_SPACE is pressed, and sizeof() parameter. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
8961e93e |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose append entry function Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use append_entry() and append_quit_entry() to construct the menu, so move them out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
a84040ab |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor file selection handling eficonfig_select_file_handler() is commonly used to select the file. eficonfig_display_select_file_option() adds an additional menu to clear the selected file. eficonfig_display_select_file_option() is not always necessary for the file selection process, so it must be outside of eficonfig_select_file_handler(). This commit also renames the following functions to avoid confusion. eficonfig_select_file_handler() -> eficonfig_process_select_file() eficonfig_select_file() -> eficonfig_show_file_selection() eficonfig_display_select_file_option() -> eficonfig_process_show_file_option() Finally, test_eficonfig.py need to be updated to get aligned with the above modification. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
1167e88a |
|
14-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix missing variable initialization The 'ret' variable must be initialized before use in eficonfig_delete_invalid_boot_option(). Fixes: c416f1c0bc ("bootmenu: add removable media entries") Addresses-Coverity: 376207 ("Uninitialized variables") Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
3d595ac5 |
|
09-Nov-2022 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: remove superfluous if in eficonfig_edit_boot_option Goto for an immediately succeeding label is superfluous. Fixes: 87d791423ac6 ("eficonfig: menu-driven addition of UEFI boot option") Addresses-Coverity: 376202 ("Identical code for different branches") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
f19171c9 |
|
08-Jan-2024 |
Ilias Apalodimas <ilias.apalodimas@linaro.org> |
efi_loader: Clean up efi_dp_append and efi_dp_concat Looking back at the initrd storing functionality, we introduced three functions, efi_dp_append_or_concatenate(), efi_dp_append/concat(). In hindsight we could have simplified that by a lot. First of all none of the functions append anything. They all allocate a new device path and concatenate the contents of two device paths in one. A boolean parameter controls the final device path -- if that's true an end node is injected between the two device paths. So let's rewrite this and make it a bit easier to read. Get rid of efi_dp_append(), efi_dp_concat() and rename efi_dp_append_or_concatenate() to efi_dp_concat(). This is far more intuitive and the only adjustment that is needed is an extra boolean argument on all callsites. Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
64658007 |
|
17-Nov-2023 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: eficonfig: create shortened boot options The boot options created by eficonfig should use shortened device-paths to avoid problems if drives are enumerated in a different sequence. Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
9945bc4f |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Fix incorrect return code of boot option update Correct the return code for out-of-memory and no boot option found Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
339b527b |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Move bootorder and bootoption apis to lib Rename and move bootorder and bootoption apis from cmd to lib for re-use between eficonfig and bootmgr Fix 'unexpected indentation' when 'make htmldocs' after functions are moved Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
2c0b0c31 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_SECURE_BOOT This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_SECURE_BOOT defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
83f3d121 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_MM_COMM_TEE This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_MM_COMM_TEE defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
88df3634 |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: CTRL+S to save the boot order 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>
|
#
45f5319f |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
menu: remove CTRL+C to quit On the sandbox called without "--terminal raw" CTRL+C leaves U-Boot, "ESC/CTRL+C to quit" is misleading. Let's remove CTRL+C to quit key handling from bootmenu and eficonfig menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
|
#
8dbd0a0f |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add vertical scroll support The current eficonfig menu does not support vertical scroll, so it can not display the menu entries greater than the console row size. This commit add the vertial scroll support. The console size is retrieved by SIMPLE_TEXT_OUTPUT_PROTOCOL.QueryMode() service, then calculates the row size for menu entry by subtracting menu header and description row size from the console row size. "start" and "end" are added in the efimenu structure. "start" keeps the menu entry index at the top, "end" keeps the bottom menu entry index. item_data_print() menu function only draws the menu entry between "start" and "end". This commit also fixes the issue that "Save" and "Quit" entries can be moved by BKEY_PLUS in change boot order menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
0d590852 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation This commit removes the change boot order specific menu implementation. The change boot order implementation calls eficonfig_process_common() same as other menus. The change boot order menu requires own item_data_print and item_choice implementation, but display_statusline function can be a same function as other menus. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
cd160b27 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor eficonfig_process_common function Current change boot order implementation does not call eficonfig_process_common() and call own menu functions for display_statusline, item_data_print and item_choice. Change boot order functionality should call eficonfig_process_common() to improve maintenanceability. This commit is a preparation to remove the change boot order specific implementation. The menu functions (display_statusline, item_data_print and item_choice) are added as argument of eficonfig_process_common(). The menu description string displayed at the bottom of the menu is also added as argument. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
32bab0ea |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Make use of CLI character processing Avoid duplicating some of the escape-sequence processing here and use the CLI function instead. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
d0ca98db |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Update bootmenu_loop() to return the code Use the return value to save having to pass around a pointer. This also resolves any ambiguity about what *key contains when the function is called. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
2da4a15e |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Rename KEY_... to BKEY_... This enum values conflict with linux/input.h so rename them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
64550274 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: avoid SetVariable between GetNextVariableName calls The current code calls efi_set_variable_int() to delete the invalid boot option between calls to efi_get_next_variable_name_int(), it may produce unpredictable results. This commit moves removal of the invalid boot option outside of the efi_get_next_variable_name_int() calls. EFI_NOT_FOUND returned from efi_get_next_variable_name_int() indicates we retrieved all EFI variables, it should be treated as EFI_SUCEESS. To address the checkpatch warning of too many leading tabs, combine two if statement into one. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
ce327084 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: carve out efi_get_next_variable_name_int calls To retrieve the EFI variable name by efi_get_next_variable_name_int(), the sequence of alloc -> efi_get_next_variable_name_int -> realloc -> efi_get_next_variable_name_int is required. In current code, this sequence repeatedly appears in the several functions. It should be curved out a common function. This commit also fixes the missing free() of var_name16 in eficonfig_delete_invalid_boot_option(). Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
140a8959 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use efi_get_next_variable_name_int() eficonfig command reads all possible UEFI load options from 0x0000 to 0xFFFF to construct the menu. This takes too much time in some environment. This commit uses efi_get_next_variable_name_int() to read all existing UEFI load options to significantlly reduce the count of efi_get_var() call. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
78b1ccc4 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use u16_strsize() to get u16 string buffer size Use u16_strsize() to simplify the u16 string buffer size calculation. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c67d3c9e |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix going one directory up issue The directory name in eficonfig menu entry contains the '\' separator. strcmp() argument ".." is wrong and one directory up handling does not work correctly. strcmp() argument must include '\' separator. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c3b5af63 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add UEFI Secure Boot Key enrollment interface This commit adds the menu-driven UEFI Secure Boot Key enrollment interface. User can enroll PK, KEK, db and dbx by selecting file. Only the signed EFI Signature List(s) with an authenticated header, typically '.auth' file, is accepted. To clear the PK, KEK, db and dbx, user needs to enroll the null key signed by PK or KEK. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
21faf4ef |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use protocol interface for file selection EFI_SIMPLE_FILE_SYSTEM_PROTOCOL is not always provided by U-Boot. Use protocol interface functions instead of U-Boot internal functions. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d6566113 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose eficonfig_create_device_path() Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use eficonfig_create_device_path() to construct the full device path from device path of the volume and file path, so move it out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d571f9b2 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation All the eficonfig menus other than "Change Boot Order" use 'eficonfig_entry' structure for each menu entry. This commit refactors change boot order implementation to use 'eficonfig_entry' structure same as other menus to have consistent menu handling. This commit also simplifies the data->active handling when KEY_SPACE is pressed, and sizeof() parameter. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
8961e93e |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose append entry function Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use append_entry() and append_quit_entry() to construct the menu, so move them out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
a84040ab |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor file selection handling eficonfig_select_file_handler() is commonly used to select the file. eficonfig_display_select_file_option() adds an additional menu to clear the selected file. eficonfig_display_select_file_option() is not always necessary for the file selection process, so it must be outside of eficonfig_select_file_handler(). This commit also renames the following functions to avoid confusion. eficonfig_select_file_handler() -> eficonfig_process_select_file() eficonfig_select_file() -> eficonfig_show_file_selection() eficonfig_display_select_file_option() -> eficonfig_process_show_file_option() Finally, test_eficonfig.py need to be updated to get aligned with the above modification. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
1167e88a |
|
14-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix missing variable initialization The 'ret' variable must be initialized before use in eficonfig_delete_invalid_boot_option(). Fixes: c416f1c0bc ("bootmenu: add removable media entries") Addresses-Coverity: 376207 ("Uninitialized variables") Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
3d595ac5 |
|
09-Nov-2022 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: remove superfluous if in eficonfig_edit_boot_option Goto for an immediately succeeding label is superfluous. Fixes: 87d791423ac6 ("eficonfig: menu-driven addition of UEFI boot option") Addresses-Coverity: 376202 ("Identical code for different branches") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
f19171c9 |
|
08-Jan-2024 |
Ilias Apalodimas <ilias.apalodimas@linaro.org> |
efi_loader: Clean up efi_dp_append and efi_dp_concat Looking back at the initrd storing functionality, we introduced three functions, efi_dp_append_or_concatenate(), efi_dp_append/concat(). In hindsight we could have simplified that by a lot. First of all none of the functions append anything. They all allocate a new device path and concatenate the contents of two device paths in one. A boolean parameter controls the final device path -- if that's true an end node is injected between the two device paths. So let's rewrite this and make it a bit easier to read. Get rid of efi_dp_append(), efi_dp_concat() and rename efi_dp_append_or_concatenate() to efi_dp_concat(). This is far more intuitive and the only adjustment that is needed is an extra boolean argument on all callsites. Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
64658007 |
|
17-Nov-2023 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: eficonfig: create shortened boot options The boot options created by eficonfig should use shortened device-paths to avoid problems if drives are enumerated in a different sequence. Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
9945bc4f |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Fix incorrect return code of boot option update Correct the return code for out-of-memory and no boot option found Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
339b527b |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Move bootorder and bootoption apis to lib Rename and move bootorder and bootoption apis from cmd to lib for re-use between eficonfig and bootmgr Fix 'unexpected indentation' when 'make htmldocs' after functions are moved Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
2c0b0c31 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_SECURE_BOOT This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_SECURE_BOOT defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
83f3d121 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_MM_COMM_TEE This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_MM_COMM_TEE defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
88df3634 |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: CTRL+S to save the boot order 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>
|
#
45f5319f |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
menu: remove CTRL+C to quit On the sandbox called without "--terminal raw" CTRL+C leaves U-Boot, "ESC/CTRL+C to quit" is misleading. Let's remove CTRL+C to quit key handling from bootmenu and eficonfig menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
|
#
8dbd0a0f |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add vertical scroll support The current eficonfig menu does not support vertical scroll, so it can not display the menu entries greater than the console row size. This commit add the vertial scroll support. The console size is retrieved by SIMPLE_TEXT_OUTPUT_PROTOCOL.QueryMode() service, then calculates the row size for menu entry by subtracting menu header and description row size from the console row size. "start" and "end" are added in the efimenu structure. "start" keeps the menu entry index at the top, "end" keeps the bottom menu entry index. item_data_print() menu function only draws the menu entry between "start" and "end". This commit also fixes the issue that "Save" and "Quit" entries can be moved by BKEY_PLUS in change boot order menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
0d590852 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation This commit removes the change boot order specific menu implementation. The change boot order implementation calls eficonfig_process_common() same as other menus. The change boot order menu requires own item_data_print and item_choice implementation, but display_statusline function can be a same function as other menus. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
cd160b27 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor eficonfig_process_common function Current change boot order implementation does not call eficonfig_process_common() and call own menu functions for display_statusline, item_data_print and item_choice. Change boot order functionality should call eficonfig_process_common() to improve maintenanceability. This commit is a preparation to remove the change boot order specific implementation. The menu functions (display_statusline, item_data_print and item_choice) are added as argument of eficonfig_process_common(). The menu description string displayed at the bottom of the menu is also added as argument. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
32bab0ea |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Make use of CLI character processing Avoid duplicating some of the escape-sequence processing here and use the CLI function instead. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
d0ca98db |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Update bootmenu_loop() to return the code Use the return value to save having to pass around a pointer. This also resolves any ambiguity about what *key contains when the function is called. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
2da4a15e |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Rename KEY_... to BKEY_... This enum values conflict with linux/input.h so rename them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
64550274 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: avoid SetVariable between GetNextVariableName calls The current code calls efi_set_variable_int() to delete the invalid boot option between calls to efi_get_next_variable_name_int(), it may produce unpredictable results. This commit moves removal of the invalid boot option outside of the efi_get_next_variable_name_int() calls. EFI_NOT_FOUND returned from efi_get_next_variable_name_int() indicates we retrieved all EFI variables, it should be treated as EFI_SUCEESS. To address the checkpatch warning of too many leading tabs, combine two if statement into one. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
ce327084 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: carve out efi_get_next_variable_name_int calls To retrieve the EFI variable name by efi_get_next_variable_name_int(), the sequence of alloc -> efi_get_next_variable_name_int -> realloc -> efi_get_next_variable_name_int is required. In current code, this sequence repeatedly appears in the several functions. It should be curved out a common function. This commit also fixes the missing free() of var_name16 in eficonfig_delete_invalid_boot_option(). Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
140a8959 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use efi_get_next_variable_name_int() eficonfig command reads all possible UEFI load options from 0x0000 to 0xFFFF to construct the menu. This takes too much time in some environment. This commit uses efi_get_next_variable_name_int() to read all existing UEFI load options to significantlly reduce the count of efi_get_var() call. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
78b1ccc4 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use u16_strsize() to get u16 string buffer size Use u16_strsize() to simplify the u16 string buffer size calculation. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c67d3c9e |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix going one directory up issue The directory name in eficonfig menu entry contains the '\' separator. strcmp() argument ".." is wrong and one directory up handling does not work correctly. strcmp() argument must include '\' separator. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c3b5af63 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add UEFI Secure Boot Key enrollment interface This commit adds the menu-driven UEFI Secure Boot Key enrollment interface. User can enroll PK, KEK, db and dbx by selecting file. Only the signed EFI Signature List(s) with an authenticated header, typically '.auth' file, is accepted. To clear the PK, KEK, db and dbx, user needs to enroll the null key signed by PK or KEK. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
21faf4ef |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use protocol interface for file selection EFI_SIMPLE_FILE_SYSTEM_PROTOCOL is not always provided by U-Boot. Use protocol interface functions instead of U-Boot internal functions. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d6566113 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose eficonfig_create_device_path() Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use eficonfig_create_device_path() to construct the full device path from device path of the volume and file path, so move it out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d571f9b2 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation All the eficonfig menus other than "Change Boot Order" use 'eficonfig_entry' structure for each menu entry. This commit refactors change boot order implementation to use 'eficonfig_entry' structure same as other menus to have consistent menu handling. This commit also simplifies the data->active handling when KEY_SPACE is pressed, and sizeof() parameter. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
8961e93e |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose append entry function Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use append_entry() and append_quit_entry() to construct the menu, so move them out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
a84040ab |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor file selection handling eficonfig_select_file_handler() is commonly used to select the file. eficonfig_display_select_file_option() adds an additional menu to clear the selected file. eficonfig_display_select_file_option() is not always necessary for the file selection process, so it must be outside of eficonfig_select_file_handler(). This commit also renames the following functions to avoid confusion. eficonfig_select_file_handler() -> eficonfig_process_select_file() eficonfig_select_file() -> eficonfig_show_file_selection() eficonfig_display_select_file_option() -> eficonfig_process_show_file_option() Finally, test_eficonfig.py need to be updated to get aligned with the above modification. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
1167e88a |
|
14-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix missing variable initialization The 'ret' variable must be initialized before use in eficonfig_delete_invalid_boot_option(). Fixes: c416f1c0bc ("bootmenu: add removable media entries") Addresses-Coverity: 376207 ("Uninitialized variables") Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
3d595ac5 |
|
09-Nov-2022 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: remove superfluous if in eficonfig_edit_boot_option Goto for an immediately succeeding label is superfluous. Fixes: 87d791423ac6 ("eficonfig: menu-driven addition of UEFI boot option") Addresses-Coverity: 376202 ("Identical code for different branches") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
f19171c9 |
|
08-Jan-2024 |
Ilias Apalodimas <ilias.apalodimas@linaro.org> |
efi_loader: Clean up efi_dp_append and efi_dp_concat Looking back at the initrd storing functionality, we introduced three functions, efi_dp_append_or_concatenate(), efi_dp_append/concat(). In hindsight we could have simplified that by a lot. First of all none of the functions append anything. They all allocate a new device path and concatenate the contents of two device paths in one. A boolean parameter controls the final device path -- if that's true an end node is injected between the two device paths. So let's rewrite this and make it a bit easier to read. Get rid of efi_dp_append(), efi_dp_concat() and rename efi_dp_append_or_concatenate() to efi_dp_concat(). This is far more intuitive and the only adjustment that is needed is an extra boolean argument on all callsites. Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
64658007 |
|
17-Nov-2023 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: eficonfig: create shortened boot options The boot options created by eficonfig should use shortened device-paths to avoid problems if drives are enumerated in a different sequence. Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
9945bc4f |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Fix incorrect return code of boot option update Correct the return code for out-of-memory and no boot option found Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
339b527b |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Move bootorder and bootoption apis to lib Rename and move bootorder and bootoption apis from cmd to lib for re-use between eficonfig and bootmgr Fix 'unexpected indentation' when 'make htmldocs' after functions are moved Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
2c0b0c31 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_SECURE_BOOT This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_SECURE_BOOT defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
83f3d121 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_MM_COMM_TEE This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_MM_COMM_TEE defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
88df3634 |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: CTRL+S to save the boot order 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>
|
#
45f5319f |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
menu: remove CTRL+C to quit On the sandbox called without "--terminal raw" CTRL+C leaves U-Boot, "ESC/CTRL+C to quit" is misleading. Let's remove CTRL+C to quit key handling from bootmenu and eficonfig menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
|
#
8dbd0a0f |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add vertical scroll support The current eficonfig menu does not support vertical scroll, so it can not display the menu entries greater than the console row size. This commit add the vertial scroll support. The console size is retrieved by SIMPLE_TEXT_OUTPUT_PROTOCOL.QueryMode() service, then calculates the row size for menu entry by subtracting menu header and description row size from the console row size. "start" and "end" are added in the efimenu structure. "start" keeps the menu entry index at the top, "end" keeps the bottom menu entry index. item_data_print() menu function only draws the menu entry between "start" and "end". This commit also fixes the issue that "Save" and "Quit" entries can be moved by BKEY_PLUS in change boot order menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
0d590852 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation This commit removes the change boot order specific menu implementation. The change boot order implementation calls eficonfig_process_common() same as other menus. The change boot order menu requires own item_data_print and item_choice implementation, but display_statusline function can be a same function as other menus. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
cd160b27 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor eficonfig_process_common function Current change boot order implementation does not call eficonfig_process_common() and call own menu functions for display_statusline, item_data_print and item_choice. Change boot order functionality should call eficonfig_process_common() to improve maintenanceability. This commit is a preparation to remove the change boot order specific implementation. The menu functions (display_statusline, item_data_print and item_choice) are added as argument of eficonfig_process_common(). The menu description string displayed at the bottom of the menu is also added as argument. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
32bab0ea |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Make use of CLI character processing Avoid duplicating some of the escape-sequence processing here and use the CLI function instead. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
d0ca98db |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Update bootmenu_loop() to return the code Use the return value to save having to pass around a pointer. This also resolves any ambiguity about what *key contains when the function is called. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
2da4a15e |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Rename KEY_... to BKEY_... This enum values conflict with linux/input.h so rename them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
64550274 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: avoid SetVariable between GetNextVariableName calls The current code calls efi_set_variable_int() to delete the invalid boot option between calls to efi_get_next_variable_name_int(), it may produce unpredictable results. This commit moves removal of the invalid boot option outside of the efi_get_next_variable_name_int() calls. EFI_NOT_FOUND returned from efi_get_next_variable_name_int() indicates we retrieved all EFI variables, it should be treated as EFI_SUCEESS. To address the checkpatch warning of too many leading tabs, combine two if statement into one. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
ce327084 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: carve out efi_get_next_variable_name_int calls To retrieve the EFI variable name by efi_get_next_variable_name_int(), the sequence of alloc -> efi_get_next_variable_name_int -> realloc -> efi_get_next_variable_name_int is required. In current code, this sequence repeatedly appears in the several functions. It should be curved out a common function. This commit also fixes the missing free() of var_name16 in eficonfig_delete_invalid_boot_option(). Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
140a8959 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use efi_get_next_variable_name_int() eficonfig command reads all possible UEFI load options from 0x0000 to 0xFFFF to construct the menu. This takes too much time in some environment. This commit uses efi_get_next_variable_name_int() to read all existing UEFI load options to significantlly reduce the count of efi_get_var() call. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
78b1ccc4 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use u16_strsize() to get u16 string buffer size Use u16_strsize() to simplify the u16 string buffer size calculation. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c67d3c9e |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix going one directory up issue The directory name in eficonfig menu entry contains the '\' separator. strcmp() argument ".." is wrong and one directory up handling does not work correctly. strcmp() argument must include '\' separator. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c3b5af63 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add UEFI Secure Boot Key enrollment interface This commit adds the menu-driven UEFI Secure Boot Key enrollment interface. User can enroll PK, KEK, db and dbx by selecting file. Only the signed EFI Signature List(s) with an authenticated header, typically '.auth' file, is accepted. To clear the PK, KEK, db and dbx, user needs to enroll the null key signed by PK or KEK. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
21faf4ef |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use protocol interface for file selection EFI_SIMPLE_FILE_SYSTEM_PROTOCOL is not always provided by U-Boot. Use protocol interface functions instead of U-Boot internal functions. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d6566113 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose eficonfig_create_device_path() Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use eficonfig_create_device_path() to construct the full device path from device path of the volume and file path, so move it out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d571f9b2 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation All the eficonfig menus other than "Change Boot Order" use 'eficonfig_entry' structure for each menu entry. This commit refactors change boot order implementation to use 'eficonfig_entry' structure same as other menus to have consistent menu handling. This commit also simplifies the data->active handling when KEY_SPACE is pressed, and sizeof() parameter. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
8961e93e |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose append entry function Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use append_entry() and append_quit_entry() to construct the menu, so move them out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
a84040ab |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor file selection handling eficonfig_select_file_handler() is commonly used to select the file. eficonfig_display_select_file_option() adds an additional menu to clear the selected file. eficonfig_display_select_file_option() is not always necessary for the file selection process, so it must be outside of eficonfig_select_file_handler(). This commit also renames the following functions to avoid confusion. eficonfig_select_file_handler() -> eficonfig_process_select_file() eficonfig_select_file() -> eficonfig_show_file_selection() eficonfig_display_select_file_option() -> eficonfig_process_show_file_option() Finally, test_eficonfig.py need to be updated to get aligned with the above modification. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
1167e88a |
|
14-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix missing variable initialization The 'ret' variable must be initialized before use in eficonfig_delete_invalid_boot_option(). Fixes: c416f1c0bc ("bootmenu: add removable media entries") Addresses-Coverity: 376207 ("Uninitialized variables") Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
3d595ac5 |
|
09-Nov-2022 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: remove superfluous if in eficonfig_edit_boot_option Goto for an immediately succeeding label is superfluous. Fixes: 87d791423ac6 ("eficonfig: menu-driven addition of UEFI boot option") Addresses-Coverity: 376202 ("Identical code for different branches") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
f19171c9 |
|
08-Jan-2024 |
Ilias Apalodimas <ilias.apalodimas@linaro.org> |
efi_loader: Clean up efi_dp_append and efi_dp_concat Looking back at the initrd storing functionality, we introduced three functions, efi_dp_append_or_concatenate(), efi_dp_append/concat(). In hindsight we could have simplified that by a lot. First of all none of the functions append anything. They all allocate a new device path and concatenate the contents of two device paths in one. A boolean parameter controls the final device path -- if that's true an end node is injected between the two device paths. So let's rewrite this and make it a bit easier to read. Get rid of efi_dp_append(), efi_dp_concat() and rename efi_dp_append_or_concatenate() to efi_dp_concat(). This is far more intuitive and the only adjustment that is needed is an extra boolean argument on all callsites. Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
64658007 |
|
17-Nov-2023 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: eficonfig: create shortened boot options The boot options created by eficonfig should use shortened device-paths to avoid problems if drives are enumerated in a different sequence. Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
9945bc4f |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Fix incorrect return code of boot option update Correct the return code for out-of-memory and no boot option found Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
339b527b |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Move bootorder and bootoption apis to lib Rename and move bootorder and bootoption apis from cmd to lib for re-use between eficonfig and bootmgr Fix 'unexpected indentation' when 'make htmldocs' after functions are moved Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
2c0b0c31 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_SECURE_BOOT This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_SECURE_BOOT defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
83f3d121 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_MM_COMM_TEE This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_MM_COMM_TEE defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
88df3634 |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: CTRL+S to save the boot order 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>
|
#
45f5319f |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
menu: remove CTRL+C to quit On the sandbox called without "--terminal raw" CTRL+C leaves U-Boot, "ESC/CTRL+C to quit" is misleading. Let's remove CTRL+C to quit key handling from bootmenu and eficonfig menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
|
#
8dbd0a0f |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add vertical scroll support The current eficonfig menu does not support vertical scroll, so it can not display the menu entries greater than the console row size. This commit add the vertial scroll support. The console size is retrieved by SIMPLE_TEXT_OUTPUT_PROTOCOL.QueryMode() service, then calculates the row size for menu entry by subtracting menu header and description row size from the console row size. "start" and "end" are added in the efimenu structure. "start" keeps the menu entry index at the top, "end" keeps the bottom menu entry index. item_data_print() menu function only draws the menu entry between "start" and "end". This commit also fixes the issue that "Save" and "Quit" entries can be moved by BKEY_PLUS in change boot order menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
0d590852 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation This commit removes the change boot order specific menu implementation. The change boot order implementation calls eficonfig_process_common() same as other menus. The change boot order menu requires own item_data_print and item_choice implementation, but display_statusline function can be a same function as other menus. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
cd160b27 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor eficonfig_process_common function Current change boot order implementation does not call eficonfig_process_common() and call own menu functions for display_statusline, item_data_print and item_choice. Change boot order functionality should call eficonfig_process_common() to improve maintenanceability. This commit is a preparation to remove the change boot order specific implementation. The menu functions (display_statusline, item_data_print and item_choice) are added as argument of eficonfig_process_common(). The menu description string displayed at the bottom of the menu is also added as argument. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
32bab0ea |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Make use of CLI character processing Avoid duplicating some of the escape-sequence processing here and use the CLI function instead. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
d0ca98db |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Update bootmenu_loop() to return the code Use the return value to save having to pass around a pointer. This also resolves any ambiguity about what *key contains when the function is called. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
2da4a15e |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Rename KEY_... to BKEY_... This enum values conflict with linux/input.h so rename them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
64550274 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: avoid SetVariable between GetNextVariableName calls The current code calls efi_set_variable_int() to delete the invalid boot option between calls to efi_get_next_variable_name_int(), it may produce unpredictable results. This commit moves removal of the invalid boot option outside of the efi_get_next_variable_name_int() calls. EFI_NOT_FOUND returned from efi_get_next_variable_name_int() indicates we retrieved all EFI variables, it should be treated as EFI_SUCEESS. To address the checkpatch warning of too many leading tabs, combine two if statement into one. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
ce327084 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: carve out efi_get_next_variable_name_int calls To retrieve the EFI variable name by efi_get_next_variable_name_int(), the sequence of alloc -> efi_get_next_variable_name_int -> realloc -> efi_get_next_variable_name_int is required. In current code, this sequence repeatedly appears in the several functions. It should be curved out a common function. This commit also fixes the missing free() of var_name16 in eficonfig_delete_invalid_boot_option(). Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
140a8959 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use efi_get_next_variable_name_int() eficonfig command reads all possible UEFI load options from 0x0000 to 0xFFFF to construct the menu. This takes too much time in some environment. This commit uses efi_get_next_variable_name_int() to read all existing UEFI load options to significantlly reduce the count of efi_get_var() call. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
78b1ccc4 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use u16_strsize() to get u16 string buffer size Use u16_strsize() to simplify the u16 string buffer size calculation. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c67d3c9e |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix going one directory up issue The directory name in eficonfig menu entry contains the '\' separator. strcmp() argument ".." is wrong and one directory up handling does not work correctly. strcmp() argument must include '\' separator. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c3b5af63 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add UEFI Secure Boot Key enrollment interface This commit adds the menu-driven UEFI Secure Boot Key enrollment interface. User can enroll PK, KEK, db and dbx by selecting file. Only the signed EFI Signature List(s) with an authenticated header, typically '.auth' file, is accepted. To clear the PK, KEK, db and dbx, user needs to enroll the null key signed by PK or KEK. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
21faf4ef |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use protocol interface for file selection EFI_SIMPLE_FILE_SYSTEM_PROTOCOL is not always provided by U-Boot. Use protocol interface functions instead of U-Boot internal functions. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d6566113 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose eficonfig_create_device_path() Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use eficonfig_create_device_path() to construct the full device path from device path of the volume and file path, so move it out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d571f9b2 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation All the eficonfig menus other than "Change Boot Order" use 'eficonfig_entry' structure for each menu entry. This commit refactors change boot order implementation to use 'eficonfig_entry' structure same as other menus to have consistent menu handling. This commit also simplifies the data->active handling when KEY_SPACE is pressed, and sizeof() parameter. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
8961e93e |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose append entry function Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use append_entry() and append_quit_entry() to construct the menu, so move them out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
a84040ab |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor file selection handling eficonfig_select_file_handler() is commonly used to select the file. eficonfig_display_select_file_option() adds an additional menu to clear the selected file. eficonfig_display_select_file_option() is not always necessary for the file selection process, so it must be outside of eficonfig_select_file_handler(). This commit also renames the following functions to avoid confusion. eficonfig_select_file_handler() -> eficonfig_process_select_file() eficonfig_select_file() -> eficonfig_show_file_selection() eficonfig_display_select_file_option() -> eficonfig_process_show_file_option() Finally, test_eficonfig.py need to be updated to get aligned with the above modification. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
1167e88a |
|
14-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix missing variable initialization The 'ret' variable must be initialized before use in eficonfig_delete_invalid_boot_option(). Fixes: c416f1c0bc ("bootmenu: add removable media entries") Addresses-Coverity: 376207 ("Uninitialized variables") Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
3d595ac5 |
|
09-Nov-2022 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: remove superfluous if in eficonfig_edit_boot_option Goto for an immediately succeeding label is superfluous. Fixes: 87d791423ac6 ("eficonfig: menu-driven addition of UEFI boot option") Addresses-Coverity: 376202 ("Identical code for different branches") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
f19171c9 |
|
08-Jan-2024 |
Ilias Apalodimas <ilias.apalodimas@linaro.org> |
efi_loader: Clean up efi_dp_append and efi_dp_concat Looking back at the initrd storing functionality, we introduced three functions, efi_dp_append_or_concatenate(), efi_dp_append/concat(). In hindsight we could have simplified that by a lot. First of all none of the functions append anything. They all allocate a new device path and concatenate the contents of two device paths in one. A boolean parameter controls the final device path -- if that's true an end node is injected between the two device paths. So let's rewrite this and make it a bit easier to read. Get rid of efi_dp_append(), efi_dp_concat() and rename efi_dp_append_or_concatenate() to efi_dp_concat(). This is far more intuitive and the only adjustment that is needed is an extra boolean argument on all callsites. Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
64658007 |
|
17-Nov-2023 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: eficonfig: create shortened boot options The boot options created by eficonfig should use shortened device-paths to avoid problems if drives are enumerated in a different sequence. Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
9945bc4f |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Fix incorrect return code of boot option update Correct the return code for out-of-memory and no boot option found Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
339b527b |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Move bootorder and bootoption apis to lib Rename and move bootorder and bootoption apis from cmd to lib for re-use between eficonfig and bootmgr Fix 'unexpected indentation' when 'make htmldocs' after functions are moved Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
2c0b0c31 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_SECURE_BOOT This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_SECURE_BOOT defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
83f3d121 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_MM_COMM_TEE This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_MM_COMM_TEE defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
88df3634 |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: CTRL+S to save the boot order 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>
|
#
45f5319f |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
menu: remove CTRL+C to quit On the sandbox called without "--terminal raw" CTRL+C leaves U-Boot, "ESC/CTRL+C to quit" is misleading. Let's remove CTRL+C to quit key handling from bootmenu and eficonfig menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
|
#
8dbd0a0f |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add vertical scroll support The current eficonfig menu does not support vertical scroll, so it can not display the menu entries greater than the console row size. This commit add the vertial scroll support. The console size is retrieved by SIMPLE_TEXT_OUTPUT_PROTOCOL.QueryMode() service, then calculates the row size for menu entry by subtracting menu header and description row size from the console row size. "start" and "end" are added in the efimenu structure. "start" keeps the menu entry index at the top, "end" keeps the bottom menu entry index. item_data_print() menu function only draws the menu entry between "start" and "end". This commit also fixes the issue that "Save" and "Quit" entries can be moved by BKEY_PLUS in change boot order menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
0d590852 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation This commit removes the change boot order specific menu implementation. The change boot order implementation calls eficonfig_process_common() same as other menus. The change boot order menu requires own item_data_print and item_choice implementation, but display_statusline function can be a same function as other menus. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
cd160b27 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor eficonfig_process_common function Current change boot order implementation does not call eficonfig_process_common() and call own menu functions for display_statusline, item_data_print and item_choice. Change boot order functionality should call eficonfig_process_common() to improve maintenanceability. This commit is a preparation to remove the change boot order specific implementation. The menu functions (display_statusline, item_data_print and item_choice) are added as argument of eficonfig_process_common(). The menu description string displayed at the bottom of the menu is also added as argument. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
32bab0ea |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Make use of CLI character processing Avoid duplicating some of the escape-sequence processing here and use the CLI function instead. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
d0ca98db |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Update bootmenu_loop() to return the code Use the return value to save having to pass around a pointer. This also resolves any ambiguity about what *key contains when the function is called. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
2da4a15e |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Rename KEY_... to BKEY_... This enum values conflict with linux/input.h so rename them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
64550274 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: avoid SetVariable between GetNextVariableName calls The current code calls efi_set_variable_int() to delete the invalid boot option between calls to efi_get_next_variable_name_int(), it may produce unpredictable results. This commit moves removal of the invalid boot option outside of the efi_get_next_variable_name_int() calls. EFI_NOT_FOUND returned from efi_get_next_variable_name_int() indicates we retrieved all EFI variables, it should be treated as EFI_SUCEESS. To address the checkpatch warning of too many leading tabs, combine two if statement into one. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
ce327084 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: carve out efi_get_next_variable_name_int calls To retrieve the EFI variable name by efi_get_next_variable_name_int(), the sequence of alloc -> efi_get_next_variable_name_int -> realloc -> efi_get_next_variable_name_int is required. In current code, this sequence repeatedly appears in the several functions. It should be curved out a common function. This commit also fixes the missing free() of var_name16 in eficonfig_delete_invalid_boot_option(). Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
140a8959 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use efi_get_next_variable_name_int() eficonfig command reads all possible UEFI load options from 0x0000 to 0xFFFF to construct the menu. This takes too much time in some environment. This commit uses efi_get_next_variable_name_int() to read all existing UEFI load options to significantlly reduce the count of efi_get_var() call. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
78b1ccc4 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use u16_strsize() to get u16 string buffer size Use u16_strsize() to simplify the u16 string buffer size calculation. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c67d3c9e |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix going one directory up issue The directory name in eficonfig menu entry contains the '\' separator. strcmp() argument ".." is wrong and one directory up handling does not work correctly. strcmp() argument must include '\' separator. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c3b5af63 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add UEFI Secure Boot Key enrollment interface This commit adds the menu-driven UEFI Secure Boot Key enrollment interface. User can enroll PK, KEK, db and dbx by selecting file. Only the signed EFI Signature List(s) with an authenticated header, typically '.auth' file, is accepted. To clear the PK, KEK, db and dbx, user needs to enroll the null key signed by PK or KEK. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
21faf4ef |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use protocol interface for file selection EFI_SIMPLE_FILE_SYSTEM_PROTOCOL is not always provided by U-Boot. Use protocol interface functions instead of U-Boot internal functions. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d6566113 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose eficonfig_create_device_path() Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use eficonfig_create_device_path() to construct the full device path from device path of the volume and file path, so move it out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d571f9b2 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation All the eficonfig menus other than "Change Boot Order" use 'eficonfig_entry' structure for each menu entry. This commit refactors change boot order implementation to use 'eficonfig_entry' structure same as other menus to have consistent menu handling. This commit also simplifies the data->active handling when KEY_SPACE is pressed, and sizeof() parameter. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
8961e93e |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose append entry function Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use append_entry() and append_quit_entry() to construct the menu, so move them out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
a84040ab |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor file selection handling eficonfig_select_file_handler() is commonly used to select the file. eficonfig_display_select_file_option() adds an additional menu to clear the selected file. eficonfig_display_select_file_option() is not always necessary for the file selection process, so it must be outside of eficonfig_select_file_handler(). This commit also renames the following functions to avoid confusion. eficonfig_select_file_handler() -> eficonfig_process_select_file() eficonfig_select_file() -> eficonfig_show_file_selection() eficonfig_display_select_file_option() -> eficonfig_process_show_file_option() Finally, test_eficonfig.py need to be updated to get aligned with the above modification. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
1167e88a |
|
14-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix missing variable initialization The 'ret' variable must be initialized before use in eficonfig_delete_invalid_boot_option(). Fixes: c416f1c0bc ("bootmenu: add removable media entries") Addresses-Coverity: 376207 ("Uninitialized variables") Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
3d595ac5 |
|
09-Nov-2022 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: remove superfluous if in eficonfig_edit_boot_option Goto for an immediately succeeding label is superfluous. Fixes: 87d791423ac6 ("eficonfig: menu-driven addition of UEFI boot option") Addresses-Coverity: 376202 ("Identical code for different branches") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
f19171c9 |
|
08-Jan-2024 |
Ilias Apalodimas <ilias.apalodimas@linaro.org> |
efi_loader: Clean up efi_dp_append and efi_dp_concat Looking back at the initrd storing functionality, we introduced three functions, efi_dp_append_or_concatenate(), efi_dp_append/concat(). In hindsight we could have simplified that by a lot. First of all none of the functions append anything. They all allocate a new device path and concatenate the contents of two device paths in one. A boolean parameter controls the final device path -- if that's true an end node is injected between the two device paths. So let's rewrite this and make it a bit easier to read. Get rid of efi_dp_append(), efi_dp_concat() and rename efi_dp_append_or_concatenate() to efi_dp_concat(). This is far more intuitive and the only adjustment that is needed is an extra boolean argument on all callsites. Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
64658007 |
|
17-Nov-2023 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: eficonfig: create shortened boot options The boot options created by eficonfig should use shortened device-paths to avoid problems if drives are enumerated in a different sequence. Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
9945bc4f |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Fix incorrect return code of boot option update Correct the return code for out-of-memory and no boot option found Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
339b527b |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Move bootorder and bootoption apis to lib Rename and move bootorder and bootoption apis from cmd to lib for re-use between eficonfig and bootmgr Fix 'unexpected indentation' when 'make htmldocs' after functions are moved Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
2c0b0c31 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_SECURE_BOOT This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_SECURE_BOOT defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
83f3d121 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_MM_COMM_TEE This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_MM_COMM_TEE defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
88df3634 |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: CTRL+S to save the boot order 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>
|
#
45f5319f |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
menu: remove CTRL+C to quit On the sandbox called without "--terminal raw" CTRL+C leaves U-Boot, "ESC/CTRL+C to quit" is misleading. Let's remove CTRL+C to quit key handling from bootmenu and eficonfig menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
|
#
8dbd0a0f |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add vertical scroll support The current eficonfig menu does not support vertical scroll, so it can not display the menu entries greater than the console row size. This commit add the vertial scroll support. The console size is retrieved by SIMPLE_TEXT_OUTPUT_PROTOCOL.QueryMode() service, then calculates the row size for menu entry by subtracting menu header and description row size from the console row size. "start" and "end" are added in the efimenu structure. "start" keeps the menu entry index at the top, "end" keeps the bottom menu entry index. item_data_print() menu function only draws the menu entry between "start" and "end". This commit also fixes the issue that "Save" and "Quit" entries can be moved by BKEY_PLUS in change boot order menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
0d590852 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation This commit removes the change boot order specific menu implementation. The change boot order implementation calls eficonfig_process_common() same as other menus. The change boot order menu requires own item_data_print and item_choice implementation, but display_statusline function can be a same function as other menus. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
cd160b27 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor eficonfig_process_common function Current change boot order implementation does not call eficonfig_process_common() and call own menu functions for display_statusline, item_data_print and item_choice. Change boot order functionality should call eficonfig_process_common() to improve maintenanceability. This commit is a preparation to remove the change boot order specific implementation. The menu functions (display_statusline, item_data_print and item_choice) are added as argument of eficonfig_process_common(). The menu description string displayed at the bottom of the menu is also added as argument. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
32bab0ea |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Make use of CLI character processing Avoid duplicating some of the escape-sequence processing here and use the CLI function instead. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
d0ca98db |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Update bootmenu_loop() to return the code Use the return value to save having to pass around a pointer. This also resolves any ambiguity about what *key contains when the function is called. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
2da4a15e |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Rename KEY_... to BKEY_... This enum values conflict with linux/input.h so rename them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
64550274 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: avoid SetVariable between GetNextVariableName calls The current code calls efi_set_variable_int() to delete the invalid boot option between calls to efi_get_next_variable_name_int(), it may produce unpredictable results. This commit moves removal of the invalid boot option outside of the efi_get_next_variable_name_int() calls. EFI_NOT_FOUND returned from efi_get_next_variable_name_int() indicates we retrieved all EFI variables, it should be treated as EFI_SUCEESS. To address the checkpatch warning of too many leading tabs, combine two if statement into one. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
ce327084 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: carve out efi_get_next_variable_name_int calls To retrieve the EFI variable name by efi_get_next_variable_name_int(), the sequence of alloc -> efi_get_next_variable_name_int -> realloc -> efi_get_next_variable_name_int is required. In current code, this sequence repeatedly appears in the several functions. It should be curved out a common function. This commit also fixes the missing free() of var_name16 in eficonfig_delete_invalid_boot_option(). Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
140a8959 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use efi_get_next_variable_name_int() eficonfig command reads all possible UEFI load options from 0x0000 to 0xFFFF to construct the menu. This takes too much time in some environment. This commit uses efi_get_next_variable_name_int() to read all existing UEFI load options to significantlly reduce the count of efi_get_var() call. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
78b1ccc4 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use u16_strsize() to get u16 string buffer size Use u16_strsize() to simplify the u16 string buffer size calculation. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c67d3c9e |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix going one directory up issue The directory name in eficonfig menu entry contains the '\' separator. strcmp() argument ".." is wrong and one directory up handling does not work correctly. strcmp() argument must include '\' separator. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c3b5af63 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add UEFI Secure Boot Key enrollment interface This commit adds the menu-driven UEFI Secure Boot Key enrollment interface. User can enroll PK, KEK, db and dbx by selecting file. Only the signed EFI Signature List(s) with an authenticated header, typically '.auth' file, is accepted. To clear the PK, KEK, db and dbx, user needs to enroll the null key signed by PK or KEK. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
21faf4ef |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use protocol interface for file selection EFI_SIMPLE_FILE_SYSTEM_PROTOCOL is not always provided by U-Boot. Use protocol interface functions instead of U-Boot internal functions. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d6566113 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose eficonfig_create_device_path() Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use eficonfig_create_device_path() to construct the full device path from device path of the volume and file path, so move it out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d571f9b2 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation All the eficonfig menus other than "Change Boot Order" use 'eficonfig_entry' structure for each menu entry. This commit refactors change boot order implementation to use 'eficonfig_entry' structure same as other menus to have consistent menu handling. This commit also simplifies the data->active handling when KEY_SPACE is pressed, and sizeof() parameter. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
8961e93e |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose append entry function Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use append_entry() and append_quit_entry() to construct the menu, so move them out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
a84040ab |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor file selection handling eficonfig_select_file_handler() is commonly used to select the file. eficonfig_display_select_file_option() adds an additional menu to clear the selected file. eficonfig_display_select_file_option() is not always necessary for the file selection process, so it must be outside of eficonfig_select_file_handler(). This commit also renames the following functions to avoid confusion. eficonfig_select_file_handler() -> eficonfig_process_select_file() eficonfig_select_file() -> eficonfig_show_file_selection() eficonfig_display_select_file_option() -> eficonfig_process_show_file_option() Finally, test_eficonfig.py need to be updated to get aligned with the above modification. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
1167e88a |
|
14-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix missing variable initialization The 'ret' variable must be initialized before use in eficonfig_delete_invalid_boot_option(). Fixes: c416f1c0bc ("bootmenu: add removable media entries") Addresses-Coverity: 376207 ("Uninitialized variables") Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
3d595ac5 |
|
09-Nov-2022 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: remove superfluous if in eficonfig_edit_boot_option Goto for an immediately succeeding label is superfluous. Fixes: 87d791423ac6 ("eficonfig: menu-driven addition of UEFI boot option") Addresses-Coverity: 376202 ("Identical code for different branches") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
f19171c9 |
|
08-Jan-2024 |
Ilias Apalodimas <ilias.apalodimas@linaro.org> |
efi_loader: Clean up efi_dp_append and efi_dp_concat Looking back at the initrd storing functionality, we introduced three functions, efi_dp_append_or_concatenate(), efi_dp_append/concat(). In hindsight we could have simplified that by a lot. First of all none of the functions append anything. They all allocate a new device path and concatenate the contents of two device paths in one. A boolean parameter controls the final device path -- if that's true an end node is injected between the two device paths. So let's rewrite this and make it a bit easier to read. Get rid of efi_dp_append(), efi_dp_concat() and rename efi_dp_append_or_concatenate() to efi_dp_concat(). This is far more intuitive and the only adjustment that is needed is an extra boolean argument on all callsites. Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
64658007 |
|
17-Nov-2023 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: eficonfig: create shortened boot options The boot options created by eficonfig should use shortened device-paths to avoid problems if drives are enumerated in a different sequence. Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
9945bc4f |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Fix incorrect return code of boot option update Correct the return code for out-of-memory and no boot option found Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
339b527b |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Move bootorder and bootoption apis to lib Rename and move bootorder and bootoption apis from cmd to lib for re-use between eficonfig and bootmgr Fix 'unexpected indentation' when 'make htmldocs' after functions are moved Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
2c0b0c31 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_SECURE_BOOT This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_SECURE_BOOT defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
83f3d121 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_MM_COMM_TEE This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_MM_COMM_TEE defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
88df3634 |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: CTRL+S to save the boot order 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>
|
#
45f5319f |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
menu: remove CTRL+C to quit On the sandbox called without "--terminal raw" CTRL+C leaves U-Boot, "ESC/CTRL+C to quit" is misleading. Let's remove CTRL+C to quit key handling from bootmenu and eficonfig menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
|
#
8dbd0a0f |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add vertical scroll support The current eficonfig menu does not support vertical scroll, so it can not display the menu entries greater than the console row size. This commit add the vertial scroll support. The console size is retrieved by SIMPLE_TEXT_OUTPUT_PROTOCOL.QueryMode() service, then calculates the row size for menu entry by subtracting menu header and description row size from the console row size. "start" and "end" are added in the efimenu structure. "start" keeps the menu entry index at the top, "end" keeps the bottom menu entry index. item_data_print() menu function only draws the menu entry between "start" and "end". This commit also fixes the issue that "Save" and "Quit" entries can be moved by BKEY_PLUS in change boot order menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
0d590852 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation This commit removes the change boot order specific menu implementation. The change boot order implementation calls eficonfig_process_common() same as other menus. The change boot order menu requires own item_data_print and item_choice implementation, but display_statusline function can be a same function as other menus. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
cd160b27 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor eficonfig_process_common function Current change boot order implementation does not call eficonfig_process_common() and call own menu functions for display_statusline, item_data_print and item_choice. Change boot order functionality should call eficonfig_process_common() to improve maintenanceability. This commit is a preparation to remove the change boot order specific implementation. The menu functions (display_statusline, item_data_print and item_choice) are added as argument of eficonfig_process_common(). The menu description string displayed at the bottom of the menu is also added as argument. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
32bab0ea |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Make use of CLI character processing Avoid duplicating some of the escape-sequence processing here and use the CLI function instead. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
d0ca98db |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Update bootmenu_loop() to return the code Use the return value to save having to pass around a pointer. This also resolves any ambiguity about what *key contains when the function is called. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
2da4a15e |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Rename KEY_... to BKEY_... This enum values conflict with linux/input.h so rename them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
64550274 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: avoid SetVariable between GetNextVariableName calls The current code calls efi_set_variable_int() to delete the invalid boot option between calls to efi_get_next_variable_name_int(), it may produce unpredictable results. This commit moves removal of the invalid boot option outside of the efi_get_next_variable_name_int() calls. EFI_NOT_FOUND returned from efi_get_next_variable_name_int() indicates we retrieved all EFI variables, it should be treated as EFI_SUCEESS. To address the checkpatch warning of too many leading tabs, combine two if statement into one. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
ce327084 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: carve out efi_get_next_variable_name_int calls To retrieve the EFI variable name by efi_get_next_variable_name_int(), the sequence of alloc -> efi_get_next_variable_name_int -> realloc -> efi_get_next_variable_name_int is required. In current code, this sequence repeatedly appears in the several functions. It should be curved out a common function. This commit also fixes the missing free() of var_name16 in eficonfig_delete_invalid_boot_option(). Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
140a8959 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use efi_get_next_variable_name_int() eficonfig command reads all possible UEFI load options from 0x0000 to 0xFFFF to construct the menu. This takes too much time in some environment. This commit uses efi_get_next_variable_name_int() to read all existing UEFI load options to significantlly reduce the count of efi_get_var() call. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
78b1ccc4 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use u16_strsize() to get u16 string buffer size Use u16_strsize() to simplify the u16 string buffer size calculation. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c67d3c9e |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix going one directory up issue The directory name in eficonfig menu entry contains the '\' separator. strcmp() argument ".." is wrong and one directory up handling does not work correctly. strcmp() argument must include '\' separator. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c3b5af63 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add UEFI Secure Boot Key enrollment interface This commit adds the menu-driven UEFI Secure Boot Key enrollment interface. User can enroll PK, KEK, db and dbx by selecting file. Only the signed EFI Signature List(s) with an authenticated header, typically '.auth' file, is accepted. To clear the PK, KEK, db and dbx, user needs to enroll the null key signed by PK or KEK. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
21faf4ef |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use protocol interface for file selection EFI_SIMPLE_FILE_SYSTEM_PROTOCOL is not always provided by U-Boot. Use protocol interface functions instead of U-Boot internal functions. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d6566113 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose eficonfig_create_device_path() Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use eficonfig_create_device_path() to construct the full device path from device path of the volume and file path, so move it out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d571f9b2 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation All the eficonfig menus other than "Change Boot Order" use 'eficonfig_entry' structure for each menu entry. This commit refactors change boot order implementation to use 'eficonfig_entry' structure same as other menus to have consistent menu handling. This commit also simplifies the data->active handling when KEY_SPACE is pressed, and sizeof() parameter. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
8961e93e |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose append entry function Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use append_entry() and append_quit_entry() to construct the menu, so move them out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
a84040ab |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor file selection handling eficonfig_select_file_handler() is commonly used to select the file. eficonfig_display_select_file_option() adds an additional menu to clear the selected file. eficonfig_display_select_file_option() is not always necessary for the file selection process, so it must be outside of eficonfig_select_file_handler(). This commit also renames the following functions to avoid confusion. eficonfig_select_file_handler() -> eficonfig_process_select_file() eficonfig_select_file() -> eficonfig_show_file_selection() eficonfig_display_select_file_option() -> eficonfig_process_show_file_option() Finally, test_eficonfig.py need to be updated to get aligned with the above modification. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
1167e88a |
|
14-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix missing variable initialization The 'ret' variable must be initialized before use in eficonfig_delete_invalid_boot_option(). Fixes: c416f1c0bc ("bootmenu: add removable media entries") Addresses-Coverity: 376207 ("Uninitialized variables") Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
3d595ac5 |
|
09-Nov-2022 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: remove superfluous if in eficonfig_edit_boot_option Goto for an immediately succeeding label is superfluous. Fixes: 87d791423ac6 ("eficonfig: menu-driven addition of UEFI boot option") Addresses-Coverity: 376202 ("Identical code for different branches") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
f19171c9 |
|
08-Jan-2024 |
Ilias Apalodimas <ilias.apalodimas@linaro.org> |
efi_loader: Clean up efi_dp_append and efi_dp_concat Looking back at the initrd storing functionality, we introduced three functions, efi_dp_append_or_concatenate(), efi_dp_append/concat(). In hindsight we could have simplified that by a lot. First of all none of the functions append anything. They all allocate a new device path and concatenate the contents of two device paths in one. A boolean parameter controls the final device path -- if that's true an end node is injected between the two device paths. So let's rewrite this and make it a bit easier to read. Get rid of efi_dp_append(), efi_dp_concat() and rename efi_dp_append_or_concatenate() to efi_dp_concat(). This is far more intuitive and the only adjustment that is needed is an extra boolean argument on all callsites. Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
64658007 |
|
17-Nov-2023 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: eficonfig: create shortened boot options The boot options created by eficonfig should use shortened device-paths to avoid problems if drives are enumerated in a different sequence. Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
9945bc4f |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Fix incorrect return code of boot option update Correct the return code for out-of-memory and no boot option found Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
339b527b |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Move bootorder and bootoption apis to lib Rename and move bootorder and bootoption apis from cmd to lib for re-use between eficonfig and bootmgr Fix 'unexpected indentation' when 'make htmldocs' after functions are moved Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
2c0b0c31 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_SECURE_BOOT This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_SECURE_BOOT defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
83f3d121 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_MM_COMM_TEE This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_MM_COMM_TEE defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
88df3634 |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: CTRL+S to save the boot order 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>
|
#
45f5319f |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
menu: remove CTRL+C to quit On the sandbox called without "--terminal raw" CTRL+C leaves U-Boot, "ESC/CTRL+C to quit" is misleading. Let's remove CTRL+C to quit key handling from bootmenu and eficonfig menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
|
#
8dbd0a0f |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add vertical scroll support The current eficonfig menu does not support vertical scroll, so it can not display the menu entries greater than the console row size. This commit add the vertial scroll support. The console size is retrieved by SIMPLE_TEXT_OUTPUT_PROTOCOL.QueryMode() service, then calculates the row size for menu entry by subtracting menu header and description row size from the console row size. "start" and "end" are added in the efimenu structure. "start" keeps the menu entry index at the top, "end" keeps the bottom menu entry index. item_data_print() menu function only draws the menu entry between "start" and "end". This commit also fixes the issue that "Save" and "Quit" entries can be moved by BKEY_PLUS in change boot order menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
0d590852 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation This commit removes the change boot order specific menu implementation. The change boot order implementation calls eficonfig_process_common() same as other menus. The change boot order menu requires own item_data_print and item_choice implementation, but display_statusline function can be a same function as other menus. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
cd160b27 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor eficonfig_process_common function Current change boot order implementation does not call eficonfig_process_common() and call own menu functions for display_statusline, item_data_print and item_choice. Change boot order functionality should call eficonfig_process_common() to improve maintenanceability. This commit is a preparation to remove the change boot order specific implementation. The menu functions (display_statusline, item_data_print and item_choice) are added as argument of eficonfig_process_common(). The menu description string displayed at the bottom of the menu is also added as argument. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
32bab0ea |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Make use of CLI character processing Avoid duplicating some of the escape-sequence processing here and use the CLI function instead. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
d0ca98db |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Update bootmenu_loop() to return the code Use the return value to save having to pass around a pointer. This also resolves any ambiguity about what *key contains when the function is called. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
2da4a15e |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Rename KEY_... to BKEY_... This enum values conflict with linux/input.h so rename them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
64550274 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: avoid SetVariable between GetNextVariableName calls The current code calls efi_set_variable_int() to delete the invalid boot option between calls to efi_get_next_variable_name_int(), it may produce unpredictable results. This commit moves removal of the invalid boot option outside of the efi_get_next_variable_name_int() calls. EFI_NOT_FOUND returned from efi_get_next_variable_name_int() indicates we retrieved all EFI variables, it should be treated as EFI_SUCEESS. To address the checkpatch warning of too many leading tabs, combine two if statement into one. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
ce327084 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: carve out efi_get_next_variable_name_int calls To retrieve the EFI variable name by efi_get_next_variable_name_int(), the sequence of alloc -> efi_get_next_variable_name_int -> realloc -> efi_get_next_variable_name_int is required. In current code, this sequence repeatedly appears in the several functions. It should be curved out a common function. This commit also fixes the missing free() of var_name16 in eficonfig_delete_invalid_boot_option(). Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
140a8959 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use efi_get_next_variable_name_int() eficonfig command reads all possible UEFI load options from 0x0000 to 0xFFFF to construct the menu. This takes too much time in some environment. This commit uses efi_get_next_variable_name_int() to read all existing UEFI load options to significantlly reduce the count of efi_get_var() call. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
78b1ccc4 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use u16_strsize() to get u16 string buffer size Use u16_strsize() to simplify the u16 string buffer size calculation. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c67d3c9e |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix going one directory up issue The directory name in eficonfig menu entry contains the '\' separator. strcmp() argument ".." is wrong and one directory up handling does not work correctly. strcmp() argument must include '\' separator. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c3b5af63 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add UEFI Secure Boot Key enrollment interface This commit adds the menu-driven UEFI Secure Boot Key enrollment interface. User can enroll PK, KEK, db and dbx by selecting file. Only the signed EFI Signature List(s) with an authenticated header, typically '.auth' file, is accepted. To clear the PK, KEK, db and dbx, user needs to enroll the null key signed by PK or KEK. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
21faf4ef |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use protocol interface for file selection EFI_SIMPLE_FILE_SYSTEM_PROTOCOL is not always provided by U-Boot. Use protocol interface functions instead of U-Boot internal functions. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d6566113 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose eficonfig_create_device_path() Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use eficonfig_create_device_path() to construct the full device path from device path of the volume and file path, so move it out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d571f9b2 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation All the eficonfig menus other than "Change Boot Order" use 'eficonfig_entry' structure for each menu entry. This commit refactors change boot order implementation to use 'eficonfig_entry' structure same as other menus to have consistent menu handling. This commit also simplifies the data->active handling when KEY_SPACE is pressed, and sizeof() parameter. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
8961e93e |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose append entry function Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use append_entry() and append_quit_entry() to construct the menu, so move them out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
a84040ab |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor file selection handling eficonfig_select_file_handler() is commonly used to select the file. eficonfig_display_select_file_option() adds an additional menu to clear the selected file. eficonfig_display_select_file_option() is not always necessary for the file selection process, so it must be outside of eficonfig_select_file_handler(). This commit also renames the following functions to avoid confusion. eficonfig_select_file_handler() -> eficonfig_process_select_file() eficonfig_select_file() -> eficonfig_show_file_selection() eficonfig_display_select_file_option() -> eficonfig_process_show_file_option() Finally, test_eficonfig.py need to be updated to get aligned with the above modification. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
1167e88a |
|
14-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix missing variable initialization The 'ret' variable must be initialized before use in eficonfig_delete_invalid_boot_option(). Fixes: c416f1c0bc ("bootmenu: add removable media entries") Addresses-Coverity: 376207 ("Uninitialized variables") Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
3d595ac5 |
|
09-Nov-2022 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: remove superfluous if in eficonfig_edit_boot_option Goto for an immediately succeeding label is superfluous. Fixes: 87d791423ac6 ("eficonfig: menu-driven addition of UEFI boot option") Addresses-Coverity: 376202 ("Identical code for different branches") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
f19171c9 |
|
08-Jan-2024 |
Ilias Apalodimas <ilias.apalodimas@linaro.org> |
efi_loader: Clean up efi_dp_append and efi_dp_concat Looking back at the initrd storing functionality, we introduced three functions, efi_dp_append_or_concatenate(), efi_dp_append/concat(). In hindsight we could have simplified that by a lot. First of all none of the functions append anything. They all allocate a new device path and concatenate the contents of two device paths in one. A boolean parameter controls the final device path -- if that's true an end node is injected between the two device paths. So let's rewrite this and make it a bit easier to read. Get rid of efi_dp_append(), efi_dp_concat() and rename efi_dp_append_or_concatenate() to efi_dp_concat(). This is far more intuitive and the only adjustment that is needed is an extra boolean argument on all callsites. Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
64658007 |
|
17-Nov-2023 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: eficonfig: create shortened boot options The boot options created by eficonfig should use shortened device-paths to avoid problems if drives are enumerated in a different sequence. Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
9945bc4f |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Fix incorrect return code of boot option update Correct the return code for out-of-memory and no boot option found Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
339b527b |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Move bootorder and bootoption apis to lib Rename and move bootorder and bootoption apis from cmd to lib for re-use between eficonfig and bootmgr Fix 'unexpected indentation' when 'make htmldocs' after functions are moved Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
2c0b0c31 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_SECURE_BOOT This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_SECURE_BOOT defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
83f3d121 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_MM_COMM_TEE This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_MM_COMM_TEE defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
88df3634 |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: CTRL+S to save the boot order 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>
|
#
45f5319f |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
menu: remove CTRL+C to quit On the sandbox called without "--terminal raw" CTRL+C leaves U-Boot, "ESC/CTRL+C to quit" is misleading. Let's remove CTRL+C to quit key handling from bootmenu and eficonfig menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
|
#
8dbd0a0f |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add vertical scroll support The current eficonfig menu does not support vertical scroll, so it can not display the menu entries greater than the console row size. This commit add the vertial scroll support. The console size is retrieved by SIMPLE_TEXT_OUTPUT_PROTOCOL.QueryMode() service, then calculates the row size for menu entry by subtracting menu header and description row size from the console row size. "start" and "end" are added in the efimenu structure. "start" keeps the menu entry index at the top, "end" keeps the bottom menu entry index. item_data_print() menu function only draws the menu entry between "start" and "end". This commit also fixes the issue that "Save" and "Quit" entries can be moved by BKEY_PLUS in change boot order menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
0d590852 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation This commit removes the change boot order specific menu implementation. The change boot order implementation calls eficonfig_process_common() same as other menus. The change boot order menu requires own item_data_print and item_choice implementation, but display_statusline function can be a same function as other menus. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
cd160b27 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor eficonfig_process_common function Current change boot order implementation does not call eficonfig_process_common() and call own menu functions for display_statusline, item_data_print and item_choice. Change boot order functionality should call eficonfig_process_common() to improve maintenanceability. This commit is a preparation to remove the change boot order specific implementation. The menu functions (display_statusline, item_data_print and item_choice) are added as argument of eficonfig_process_common(). The menu description string displayed at the bottom of the menu is also added as argument. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
32bab0ea |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Make use of CLI character processing Avoid duplicating some of the escape-sequence processing here and use the CLI function instead. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
d0ca98db |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Update bootmenu_loop() to return the code Use the return value to save having to pass around a pointer. This also resolves any ambiguity about what *key contains when the function is called. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
2da4a15e |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Rename KEY_... to BKEY_... This enum values conflict with linux/input.h so rename them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
64550274 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: avoid SetVariable between GetNextVariableName calls The current code calls efi_set_variable_int() to delete the invalid boot option between calls to efi_get_next_variable_name_int(), it may produce unpredictable results. This commit moves removal of the invalid boot option outside of the efi_get_next_variable_name_int() calls. EFI_NOT_FOUND returned from efi_get_next_variable_name_int() indicates we retrieved all EFI variables, it should be treated as EFI_SUCEESS. To address the checkpatch warning of too many leading tabs, combine two if statement into one. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
ce327084 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: carve out efi_get_next_variable_name_int calls To retrieve the EFI variable name by efi_get_next_variable_name_int(), the sequence of alloc -> efi_get_next_variable_name_int -> realloc -> efi_get_next_variable_name_int is required. In current code, this sequence repeatedly appears in the several functions. It should be curved out a common function. This commit also fixes the missing free() of var_name16 in eficonfig_delete_invalid_boot_option(). Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
140a8959 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use efi_get_next_variable_name_int() eficonfig command reads all possible UEFI load options from 0x0000 to 0xFFFF to construct the menu. This takes too much time in some environment. This commit uses efi_get_next_variable_name_int() to read all existing UEFI load options to significantlly reduce the count of efi_get_var() call. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
78b1ccc4 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use u16_strsize() to get u16 string buffer size Use u16_strsize() to simplify the u16 string buffer size calculation. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c67d3c9e |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix going one directory up issue The directory name in eficonfig menu entry contains the '\' separator. strcmp() argument ".." is wrong and one directory up handling does not work correctly. strcmp() argument must include '\' separator. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c3b5af63 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add UEFI Secure Boot Key enrollment interface This commit adds the menu-driven UEFI Secure Boot Key enrollment interface. User can enroll PK, KEK, db and dbx by selecting file. Only the signed EFI Signature List(s) with an authenticated header, typically '.auth' file, is accepted. To clear the PK, KEK, db and dbx, user needs to enroll the null key signed by PK or KEK. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
21faf4ef |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use protocol interface for file selection EFI_SIMPLE_FILE_SYSTEM_PROTOCOL is not always provided by U-Boot. Use protocol interface functions instead of U-Boot internal functions. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d6566113 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose eficonfig_create_device_path() Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use eficonfig_create_device_path() to construct the full device path from device path of the volume and file path, so move it out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d571f9b2 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation All the eficonfig menus other than "Change Boot Order" use 'eficonfig_entry' structure for each menu entry. This commit refactors change boot order implementation to use 'eficonfig_entry' structure same as other menus to have consistent menu handling. This commit also simplifies the data->active handling when KEY_SPACE is pressed, and sizeof() parameter. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
8961e93e |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose append entry function Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use append_entry() and append_quit_entry() to construct the menu, so move them out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
a84040ab |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor file selection handling eficonfig_select_file_handler() is commonly used to select the file. eficonfig_display_select_file_option() adds an additional menu to clear the selected file. eficonfig_display_select_file_option() is not always necessary for the file selection process, so it must be outside of eficonfig_select_file_handler(). This commit also renames the following functions to avoid confusion. eficonfig_select_file_handler() -> eficonfig_process_select_file() eficonfig_select_file() -> eficonfig_show_file_selection() eficonfig_display_select_file_option() -> eficonfig_process_show_file_option() Finally, test_eficonfig.py need to be updated to get aligned with the above modification. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
1167e88a |
|
14-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix missing variable initialization The 'ret' variable must be initialized before use in eficonfig_delete_invalid_boot_option(). Fixes: c416f1c0bc ("bootmenu: add removable media entries") Addresses-Coverity: 376207 ("Uninitialized variables") Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
3d595ac5 |
|
09-Nov-2022 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: remove superfluous if in eficonfig_edit_boot_option Goto for an immediately succeeding label is superfluous. Fixes: 87d791423ac6 ("eficonfig: menu-driven addition of UEFI boot option") Addresses-Coverity: 376202 ("Identical code for different branches") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
f19171c9 |
|
08-Jan-2024 |
Ilias Apalodimas <ilias.apalodimas@linaro.org> |
efi_loader: Clean up efi_dp_append and efi_dp_concat Looking back at the initrd storing functionality, we introduced three functions, efi_dp_append_or_concatenate(), efi_dp_append/concat(). In hindsight we could have simplified that by a lot. First of all none of the functions append anything. They all allocate a new device path and concatenate the contents of two device paths in one. A boolean parameter controls the final device path -- if that's true an end node is injected between the two device paths. So let's rewrite this and make it a bit easier to read. Get rid of efi_dp_append(), efi_dp_concat() and rename efi_dp_append_or_concatenate() to efi_dp_concat(). This is far more intuitive and the only adjustment that is needed is an extra boolean argument on all callsites. Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
64658007 |
|
17-Nov-2023 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: eficonfig: create shortened boot options The boot options created by eficonfig should use shortened device-paths to avoid problems if drives are enumerated in a different sequence. Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
9945bc4f |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Fix incorrect return code of boot option update Correct the return code for out-of-memory and no boot option found Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
339b527b |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Move bootorder and bootoption apis to lib Rename and move bootorder and bootoption apis from cmd to lib for re-use between eficonfig and bootmgr Fix 'unexpected indentation' when 'make htmldocs' after functions are moved Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
2c0b0c31 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_SECURE_BOOT This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_SECURE_BOOT defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
83f3d121 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_MM_COMM_TEE This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_MM_COMM_TEE defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
88df3634 |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: CTRL+S to save the boot order 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>
|
#
45f5319f |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
menu: remove CTRL+C to quit On the sandbox called without "--terminal raw" CTRL+C leaves U-Boot, "ESC/CTRL+C to quit" is misleading. Let's remove CTRL+C to quit key handling from bootmenu and eficonfig menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
|
#
8dbd0a0f |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add vertical scroll support The current eficonfig menu does not support vertical scroll, so it can not display the menu entries greater than the console row size. This commit add the vertial scroll support. The console size is retrieved by SIMPLE_TEXT_OUTPUT_PROTOCOL.QueryMode() service, then calculates the row size for menu entry by subtracting menu header and description row size from the console row size. "start" and "end" are added in the efimenu structure. "start" keeps the menu entry index at the top, "end" keeps the bottom menu entry index. item_data_print() menu function only draws the menu entry between "start" and "end". This commit also fixes the issue that "Save" and "Quit" entries can be moved by BKEY_PLUS in change boot order menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
0d590852 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation This commit removes the change boot order specific menu implementation. The change boot order implementation calls eficonfig_process_common() same as other menus. The change boot order menu requires own item_data_print and item_choice implementation, but display_statusline function can be a same function as other menus. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
cd160b27 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor eficonfig_process_common function Current change boot order implementation does not call eficonfig_process_common() and call own menu functions for display_statusline, item_data_print and item_choice. Change boot order functionality should call eficonfig_process_common() to improve maintenanceability. This commit is a preparation to remove the change boot order specific implementation. The menu functions (display_statusline, item_data_print and item_choice) are added as argument of eficonfig_process_common(). The menu description string displayed at the bottom of the menu is also added as argument. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
32bab0ea |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Make use of CLI character processing Avoid duplicating some of the escape-sequence processing here and use the CLI function instead. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
d0ca98db |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Update bootmenu_loop() to return the code Use the return value to save having to pass around a pointer. This also resolves any ambiguity about what *key contains when the function is called. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
2da4a15e |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Rename KEY_... to BKEY_... This enum values conflict with linux/input.h so rename them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
64550274 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: avoid SetVariable between GetNextVariableName calls The current code calls efi_set_variable_int() to delete the invalid boot option between calls to efi_get_next_variable_name_int(), it may produce unpredictable results. This commit moves removal of the invalid boot option outside of the efi_get_next_variable_name_int() calls. EFI_NOT_FOUND returned from efi_get_next_variable_name_int() indicates we retrieved all EFI variables, it should be treated as EFI_SUCEESS. To address the checkpatch warning of too many leading tabs, combine two if statement into one. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
ce327084 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: carve out efi_get_next_variable_name_int calls To retrieve the EFI variable name by efi_get_next_variable_name_int(), the sequence of alloc -> efi_get_next_variable_name_int -> realloc -> efi_get_next_variable_name_int is required. In current code, this sequence repeatedly appears in the several functions. It should be curved out a common function. This commit also fixes the missing free() of var_name16 in eficonfig_delete_invalid_boot_option(). Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
140a8959 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use efi_get_next_variable_name_int() eficonfig command reads all possible UEFI load options from 0x0000 to 0xFFFF to construct the menu. This takes too much time in some environment. This commit uses efi_get_next_variable_name_int() to read all existing UEFI load options to significantlly reduce the count of efi_get_var() call. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
78b1ccc4 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use u16_strsize() to get u16 string buffer size Use u16_strsize() to simplify the u16 string buffer size calculation. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c67d3c9e |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix going one directory up issue The directory name in eficonfig menu entry contains the '\' separator. strcmp() argument ".." is wrong and one directory up handling does not work correctly. strcmp() argument must include '\' separator. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c3b5af63 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add UEFI Secure Boot Key enrollment interface This commit adds the menu-driven UEFI Secure Boot Key enrollment interface. User can enroll PK, KEK, db and dbx by selecting file. Only the signed EFI Signature List(s) with an authenticated header, typically '.auth' file, is accepted. To clear the PK, KEK, db and dbx, user needs to enroll the null key signed by PK or KEK. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
21faf4ef |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use protocol interface for file selection EFI_SIMPLE_FILE_SYSTEM_PROTOCOL is not always provided by U-Boot. Use protocol interface functions instead of U-Boot internal functions. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d6566113 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose eficonfig_create_device_path() Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use eficonfig_create_device_path() to construct the full device path from device path of the volume and file path, so move it out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d571f9b2 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation All the eficonfig menus other than "Change Boot Order" use 'eficonfig_entry' structure for each menu entry. This commit refactors change boot order implementation to use 'eficonfig_entry' structure same as other menus to have consistent menu handling. This commit also simplifies the data->active handling when KEY_SPACE is pressed, and sizeof() parameter. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
8961e93e |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose append entry function Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use append_entry() and append_quit_entry() to construct the menu, so move them out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
a84040ab |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor file selection handling eficonfig_select_file_handler() is commonly used to select the file. eficonfig_display_select_file_option() adds an additional menu to clear the selected file. eficonfig_display_select_file_option() is not always necessary for the file selection process, so it must be outside of eficonfig_select_file_handler(). This commit also renames the following functions to avoid confusion. eficonfig_select_file_handler() -> eficonfig_process_select_file() eficonfig_select_file() -> eficonfig_show_file_selection() eficonfig_display_select_file_option() -> eficonfig_process_show_file_option() Finally, test_eficonfig.py need to be updated to get aligned with the above modification. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
1167e88a |
|
14-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix missing variable initialization The 'ret' variable must be initialized before use in eficonfig_delete_invalid_boot_option(). Fixes: c416f1c0bc ("bootmenu: add removable media entries") Addresses-Coverity: 376207 ("Uninitialized variables") Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
3d595ac5 |
|
09-Nov-2022 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: remove superfluous if in eficonfig_edit_boot_option Goto for an immediately succeeding label is superfluous. Fixes: 87d791423ac6 ("eficonfig: menu-driven addition of UEFI boot option") Addresses-Coverity: 376202 ("Identical code for different branches") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
f19171c9 |
|
08-Jan-2024 |
Ilias Apalodimas <ilias.apalodimas@linaro.org> |
efi_loader: Clean up efi_dp_append and efi_dp_concat Looking back at the initrd storing functionality, we introduced three functions, efi_dp_append_or_concatenate(), efi_dp_append/concat(). In hindsight we could have simplified that by a lot. First of all none of the functions append anything. They all allocate a new device path and concatenate the contents of two device paths in one. A boolean parameter controls the final device path -- if that's true an end node is injected between the two device paths. So let's rewrite this and make it a bit easier to read. Get rid of efi_dp_append(), efi_dp_concat() and rename efi_dp_append_or_concatenate() to efi_dp_concat(). This is far more intuitive and the only adjustment that is needed is an extra boolean argument on all callsites. Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
64658007 |
|
17-Nov-2023 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: eficonfig: create shortened boot options The boot options created by eficonfig should use shortened device-paths to avoid problems if drives are enumerated in a different sequence. Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
9945bc4f |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Fix incorrect return code of boot option update Correct the return code for out-of-memory and no boot option found Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
339b527b |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Move bootorder and bootoption apis to lib Rename and move bootorder and bootoption apis from cmd to lib for re-use between eficonfig and bootmgr Fix 'unexpected indentation' when 'make htmldocs' after functions are moved Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
2c0b0c31 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_SECURE_BOOT This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_SECURE_BOOT defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
83f3d121 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_MM_COMM_TEE This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_MM_COMM_TEE defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
88df3634 |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: CTRL+S to save the boot order 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>
|
#
45f5319f |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
menu: remove CTRL+C to quit On the sandbox called without "--terminal raw" CTRL+C leaves U-Boot, "ESC/CTRL+C to quit" is misleading. Let's remove CTRL+C to quit key handling from bootmenu and eficonfig menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
|
#
8dbd0a0f |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add vertical scroll support The current eficonfig menu does not support vertical scroll, so it can not display the menu entries greater than the console row size. This commit add the vertial scroll support. The console size is retrieved by SIMPLE_TEXT_OUTPUT_PROTOCOL.QueryMode() service, then calculates the row size for menu entry by subtracting menu header and description row size from the console row size. "start" and "end" are added in the efimenu structure. "start" keeps the menu entry index at the top, "end" keeps the bottom menu entry index. item_data_print() menu function only draws the menu entry between "start" and "end". This commit also fixes the issue that "Save" and "Quit" entries can be moved by BKEY_PLUS in change boot order menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
0d590852 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation This commit removes the change boot order specific menu implementation. The change boot order implementation calls eficonfig_process_common() same as other menus. The change boot order menu requires own item_data_print and item_choice implementation, but display_statusline function can be a same function as other menus. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
cd160b27 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor eficonfig_process_common function Current change boot order implementation does not call eficonfig_process_common() and call own menu functions for display_statusline, item_data_print and item_choice. Change boot order functionality should call eficonfig_process_common() to improve maintenanceability. This commit is a preparation to remove the change boot order specific implementation. The menu functions (display_statusline, item_data_print and item_choice) are added as argument of eficonfig_process_common(). The menu description string displayed at the bottom of the menu is also added as argument. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
32bab0ea |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Make use of CLI character processing Avoid duplicating some of the escape-sequence processing here and use the CLI function instead. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
d0ca98db |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Update bootmenu_loop() to return the code Use the return value to save having to pass around a pointer. This also resolves any ambiguity about what *key contains when the function is called. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
2da4a15e |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Rename KEY_... to BKEY_... This enum values conflict with linux/input.h so rename them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
64550274 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: avoid SetVariable between GetNextVariableName calls The current code calls efi_set_variable_int() to delete the invalid boot option between calls to efi_get_next_variable_name_int(), it may produce unpredictable results. This commit moves removal of the invalid boot option outside of the efi_get_next_variable_name_int() calls. EFI_NOT_FOUND returned from efi_get_next_variable_name_int() indicates we retrieved all EFI variables, it should be treated as EFI_SUCEESS. To address the checkpatch warning of too many leading tabs, combine two if statement into one. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
ce327084 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: carve out efi_get_next_variable_name_int calls To retrieve the EFI variable name by efi_get_next_variable_name_int(), the sequence of alloc -> efi_get_next_variable_name_int -> realloc -> efi_get_next_variable_name_int is required. In current code, this sequence repeatedly appears in the several functions. It should be curved out a common function. This commit also fixes the missing free() of var_name16 in eficonfig_delete_invalid_boot_option(). Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
140a8959 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use efi_get_next_variable_name_int() eficonfig command reads all possible UEFI load options from 0x0000 to 0xFFFF to construct the menu. This takes too much time in some environment. This commit uses efi_get_next_variable_name_int() to read all existing UEFI load options to significantlly reduce the count of efi_get_var() call. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
78b1ccc4 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use u16_strsize() to get u16 string buffer size Use u16_strsize() to simplify the u16 string buffer size calculation. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c67d3c9e |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix going one directory up issue The directory name in eficonfig menu entry contains the '\' separator. strcmp() argument ".." is wrong and one directory up handling does not work correctly. strcmp() argument must include '\' separator. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c3b5af63 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add UEFI Secure Boot Key enrollment interface This commit adds the menu-driven UEFI Secure Boot Key enrollment interface. User can enroll PK, KEK, db and dbx by selecting file. Only the signed EFI Signature List(s) with an authenticated header, typically '.auth' file, is accepted. To clear the PK, KEK, db and dbx, user needs to enroll the null key signed by PK or KEK. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
21faf4ef |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use protocol interface for file selection EFI_SIMPLE_FILE_SYSTEM_PROTOCOL is not always provided by U-Boot. Use protocol interface functions instead of U-Boot internal functions. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d6566113 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose eficonfig_create_device_path() Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use eficonfig_create_device_path() to construct the full device path from device path of the volume and file path, so move it out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d571f9b2 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation All the eficonfig menus other than "Change Boot Order" use 'eficonfig_entry' structure for each menu entry. This commit refactors change boot order implementation to use 'eficonfig_entry' structure same as other menus to have consistent menu handling. This commit also simplifies the data->active handling when KEY_SPACE is pressed, and sizeof() parameter. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
8961e93e |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose append entry function Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use append_entry() and append_quit_entry() to construct the menu, so move them out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
a84040ab |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor file selection handling eficonfig_select_file_handler() is commonly used to select the file. eficonfig_display_select_file_option() adds an additional menu to clear the selected file. eficonfig_display_select_file_option() is not always necessary for the file selection process, so it must be outside of eficonfig_select_file_handler(). This commit also renames the following functions to avoid confusion. eficonfig_select_file_handler() -> eficonfig_process_select_file() eficonfig_select_file() -> eficonfig_show_file_selection() eficonfig_display_select_file_option() -> eficonfig_process_show_file_option() Finally, test_eficonfig.py need to be updated to get aligned with the above modification. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
1167e88a |
|
14-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix missing variable initialization The 'ret' variable must be initialized before use in eficonfig_delete_invalid_boot_option(). Fixes: c416f1c0bc ("bootmenu: add removable media entries") Addresses-Coverity: 376207 ("Uninitialized variables") Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
3d595ac5 |
|
09-Nov-2022 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: remove superfluous if in eficonfig_edit_boot_option Goto for an immediately succeeding label is superfluous. Fixes: 87d791423ac6 ("eficonfig: menu-driven addition of UEFI boot option") Addresses-Coverity: 376202 ("Identical code for different branches") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
f19171c9 |
|
08-Jan-2024 |
Ilias Apalodimas <ilias.apalodimas@linaro.org> |
efi_loader: Clean up efi_dp_append and efi_dp_concat Looking back at the initrd storing functionality, we introduced three functions, efi_dp_append_or_concatenate(), efi_dp_append/concat(). In hindsight we could have simplified that by a lot. First of all none of the functions append anything. They all allocate a new device path and concatenate the contents of two device paths in one. A boolean parameter controls the final device path -- if that's true an end node is injected between the two device paths. So let's rewrite this and make it a bit easier to read. Get rid of efi_dp_append(), efi_dp_concat() and rename efi_dp_append_or_concatenate() to efi_dp_concat(). This is far more intuitive and the only adjustment that is needed is an extra boolean argument on all callsites. Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
64658007 |
|
17-Nov-2023 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: eficonfig: create shortened boot options The boot options created by eficonfig should use shortened device-paths to avoid problems if drives are enumerated in a different sequence. Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
9945bc4f |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Fix incorrect return code of boot option update Correct the return code for out-of-memory and no boot option found Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
339b527b |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Move bootorder and bootoption apis to lib Rename and move bootorder and bootoption apis from cmd to lib for re-use between eficonfig and bootmgr Fix 'unexpected indentation' when 'make htmldocs' after functions are moved Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
2c0b0c31 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_SECURE_BOOT This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_SECURE_BOOT defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
83f3d121 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_MM_COMM_TEE This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_MM_COMM_TEE defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
88df3634 |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: CTRL+S to save the boot order 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>
|
#
45f5319f |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
menu: remove CTRL+C to quit On the sandbox called without "--terminal raw" CTRL+C leaves U-Boot, "ESC/CTRL+C to quit" is misleading. Let's remove CTRL+C to quit key handling from bootmenu and eficonfig menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
|
#
8dbd0a0f |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add vertical scroll support The current eficonfig menu does not support vertical scroll, so it can not display the menu entries greater than the console row size. This commit add the vertial scroll support. The console size is retrieved by SIMPLE_TEXT_OUTPUT_PROTOCOL.QueryMode() service, then calculates the row size for menu entry by subtracting menu header and description row size from the console row size. "start" and "end" are added in the efimenu structure. "start" keeps the menu entry index at the top, "end" keeps the bottom menu entry index. item_data_print() menu function only draws the menu entry between "start" and "end". This commit also fixes the issue that "Save" and "Quit" entries can be moved by BKEY_PLUS in change boot order menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
0d590852 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation This commit removes the change boot order specific menu implementation. The change boot order implementation calls eficonfig_process_common() same as other menus. The change boot order menu requires own item_data_print and item_choice implementation, but display_statusline function can be a same function as other menus. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
cd160b27 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor eficonfig_process_common function Current change boot order implementation does not call eficonfig_process_common() and call own menu functions for display_statusline, item_data_print and item_choice. Change boot order functionality should call eficonfig_process_common() to improve maintenanceability. This commit is a preparation to remove the change boot order specific implementation. The menu functions (display_statusline, item_data_print and item_choice) are added as argument of eficonfig_process_common(). The menu description string displayed at the bottom of the menu is also added as argument. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
32bab0ea |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Make use of CLI character processing Avoid duplicating some of the escape-sequence processing here and use the CLI function instead. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
d0ca98db |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Update bootmenu_loop() to return the code Use the return value to save having to pass around a pointer. This also resolves any ambiguity about what *key contains when the function is called. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
2da4a15e |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Rename KEY_... to BKEY_... This enum values conflict with linux/input.h so rename them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
64550274 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: avoid SetVariable between GetNextVariableName calls The current code calls efi_set_variable_int() to delete the invalid boot option between calls to efi_get_next_variable_name_int(), it may produce unpredictable results. This commit moves removal of the invalid boot option outside of the efi_get_next_variable_name_int() calls. EFI_NOT_FOUND returned from efi_get_next_variable_name_int() indicates we retrieved all EFI variables, it should be treated as EFI_SUCEESS. To address the checkpatch warning of too many leading tabs, combine two if statement into one. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
ce327084 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: carve out efi_get_next_variable_name_int calls To retrieve the EFI variable name by efi_get_next_variable_name_int(), the sequence of alloc -> efi_get_next_variable_name_int -> realloc -> efi_get_next_variable_name_int is required. In current code, this sequence repeatedly appears in the several functions. It should be curved out a common function. This commit also fixes the missing free() of var_name16 in eficonfig_delete_invalid_boot_option(). Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
140a8959 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use efi_get_next_variable_name_int() eficonfig command reads all possible UEFI load options from 0x0000 to 0xFFFF to construct the menu. This takes too much time in some environment. This commit uses efi_get_next_variable_name_int() to read all existing UEFI load options to significantlly reduce the count of efi_get_var() call. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
78b1ccc4 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use u16_strsize() to get u16 string buffer size Use u16_strsize() to simplify the u16 string buffer size calculation. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c67d3c9e |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix going one directory up issue The directory name in eficonfig menu entry contains the '\' separator. strcmp() argument ".." is wrong and one directory up handling does not work correctly. strcmp() argument must include '\' separator. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c3b5af63 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add UEFI Secure Boot Key enrollment interface This commit adds the menu-driven UEFI Secure Boot Key enrollment interface. User can enroll PK, KEK, db and dbx by selecting file. Only the signed EFI Signature List(s) with an authenticated header, typically '.auth' file, is accepted. To clear the PK, KEK, db and dbx, user needs to enroll the null key signed by PK or KEK. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
21faf4ef |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use protocol interface for file selection EFI_SIMPLE_FILE_SYSTEM_PROTOCOL is not always provided by U-Boot. Use protocol interface functions instead of U-Boot internal functions. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d6566113 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose eficonfig_create_device_path() Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use eficonfig_create_device_path() to construct the full device path from device path of the volume and file path, so move it out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d571f9b2 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation All the eficonfig menus other than "Change Boot Order" use 'eficonfig_entry' structure for each menu entry. This commit refactors change boot order implementation to use 'eficonfig_entry' structure same as other menus to have consistent menu handling. This commit also simplifies the data->active handling when KEY_SPACE is pressed, and sizeof() parameter. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
8961e93e |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose append entry function Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use append_entry() and append_quit_entry() to construct the menu, so move them out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
a84040ab |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor file selection handling eficonfig_select_file_handler() is commonly used to select the file. eficonfig_display_select_file_option() adds an additional menu to clear the selected file. eficonfig_display_select_file_option() is not always necessary for the file selection process, so it must be outside of eficonfig_select_file_handler(). This commit also renames the following functions to avoid confusion. eficonfig_select_file_handler() -> eficonfig_process_select_file() eficonfig_select_file() -> eficonfig_show_file_selection() eficonfig_display_select_file_option() -> eficonfig_process_show_file_option() Finally, test_eficonfig.py need to be updated to get aligned with the above modification. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
1167e88a |
|
14-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix missing variable initialization The 'ret' variable must be initialized before use in eficonfig_delete_invalid_boot_option(). Fixes: c416f1c0bc ("bootmenu: add removable media entries") Addresses-Coverity: 376207 ("Uninitialized variables") Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
3d595ac5 |
|
09-Nov-2022 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: remove superfluous if in eficonfig_edit_boot_option Goto for an immediately succeeding label is superfluous. Fixes: 87d791423ac6 ("eficonfig: menu-driven addition of UEFI boot option") Addresses-Coverity: 376202 ("Identical code for different branches") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
f19171c9 |
|
08-Jan-2024 |
Ilias Apalodimas <ilias.apalodimas@linaro.org> |
efi_loader: Clean up efi_dp_append and efi_dp_concat Looking back at the initrd storing functionality, we introduced three functions, efi_dp_append_or_concatenate(), efi_dp_append/concat(). In hindsight we could have simplified that by a lot. First of all none of the functions append anything. They all allocate a new device path and concatenate the contents of two device paths in one. A boolean parameter controls the final device path -- if that's true an end node is injected between the two device paths. So let's rewrite this and make it a bit easier to read. Get rid of efi_dp_append(), efi_dp_concat() and rename efi_dp_append_or_concatenate() to efi_dp_concat(). This is far more intuitive and the only adjustment that is needed is an extra boolean argument on all callsites. Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
64658007 |
|
17-Nov-2023 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: eficonfig: create shortened boot options The boot options created by eficonfig should use shortened device-paths to avoid problems if drives are enumerated in a different sequence. Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
9945bc4f |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Fix incorrect return code of boot option update Correct the return code for out-of-memory and no boot option found Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
339b527b |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Move bootorder and bootoption apis to lib Rename and move bootorder and bootoption apis from cmd to lib for re-use between eficonfig and bootmgr Fix 'unexpected indentation' when 'make htmldocs' after functions are moved Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
2c0b0c31 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_SECURE_BOOT This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_SECURE_BOOT defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
83f3d121 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_MM_COMM_TEE This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_MM_COMM_TEE defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
88df3634 |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: CTRL+S to save the boot order 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>
|
#
45f5319f |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
menu: remove CTRL+C to quit On the sandbox called without "--terminal raw" CTRL+C leaves U-Boot, "ESC/CTRL+C to quit" is misleading. Let's remove CTRL+C to quit key handling from bootmenu and eficonfig menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
|
#
8dbd0a0f |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add vertical scroll support The current eficonfig menu does not support vertical scroll, so it can not display the menu entries greater than the console row size. This commit add the vertial scroll support. The console size is retrieved by SIMPLE_TEXT_OUTPUT_PROTOCOL.QueryMode() service, then calculates the row size for menu entry by subtracting menu header and description row size from the console row size. "start" and "end" are added in the efimenu structure. "start" keeps the menu entry index at the top, "end" keeps the bottom menu entry index. item_data_print() menu function only draws the menu entry between "start" and "end". This commit also fixes the issue that "Save" and "Quit" entries can be moved by BKEY_PLUS in change boot order menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
0d590852 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation This commit removes the change boot order specific menu implementation. The change boot order implementation calls eficonfig_process_common() same as other menus. The change boot order menu requires own item_data_print and item_choice implementation, but display_statusline function can be a same function as other menus. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
cd160b27 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor eficonfig_process_common function Current change boot order implementation does not call eficonfig_process_common() and call own menu functions for display_statusline, item_data_print and item_choice. Change boot order functionality should call eficonfig_process_common() to improve maintenanceability. This commit is a preparation to remove the change boot order specific implementation. The menu functions (display_statusline, item_data_print and item_choice) are added as argument of eficonfig_process_common(). The menu description string displayed at the bottom of the menu is also added as argument. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
32bab0ea |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Make use of CLI character processing Avoid duplicating some of the escape-sequence processing here and use the CLI function instead. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
d0ca98db |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Update bootmenu_loop() to return the code Use the return value to save having to pass around a pointer. This also resolves any ambiguity about what *key contains when the function is called. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
2da4a15e |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Rename KEY_... to BKEY_... This enum values conflict with linux/input.h so rename them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
64550274 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: avoid SetVariable between GetNextVariableName calls The current code calls efi_set_variable_int() to delete the invalid boot option between calls to efi_get_next_variable_name_int(), it may produce unpredictable results. This commit moves removal of the invalid boot option outside of the efi_get_next_variable_name_int() calls. EFI_NOT_FOUND returned from efi_get_next_variable_name_int() indicates we retrieved all EFI variables, it should be treated as EFI_SUCEESS. To address the checkpatch warning of too many leading tabs, combine two if statement into one. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
ce327084 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: carve out efi_get_next_variable_name_int calls To retrieve the EFI variable name by efi_get_next_variable_name_int(), the sequence of alloc -> efi_get_next_variable_name_int -> realloc -> efi_get_next_variable_name_int is required. In current code, this sequence repeatedly appears in the several functions. It should be curved out a common function. This commit also fixes the missing free() of var_name16 in eficonfig_delete_invalid_boot_option(). Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
140a8959 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use efi_get_next_variable_name_int() eficonfig command reads all possible UEFI load options from 0x0000 to 0xFFFF to construct the menu. This takes too much time in some environment. This commit uses efi_get_next_variable_name_int() to read all existing UEFI load options to significantlly reduce the count of efi_get_var() call. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
78b1ccc4 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use u16_strsize() to get u16 string buffer size Use u16_strsize() to simplify the u16 string buffer size calculation. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c67d3c9e |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix going one directory up issue The directory name in eficonfig menu entry contains the '\' separator. strcmp() argument ".." is wrong and one directory up handling does not work correctly. strcmp() argument must include '\' separator. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c3b5af63 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add UEFI Secure Boot Key enrollment interface This commit adds the menu-driven UEFI Secure Boot Key enrollment interface. User can enroll PK, KEK, db and dbx by selecting file. Only the signed EFI Signature List(s) with an authenticated header, typically '.auth' file, is accepted. To clear the PK, KEK, db and dbx, user needs to enroll the null key signed by PK or KEK. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
21faf4ef |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use protocol interface for file selection EFI_SIMPLE_FILE_SYSTEM_PROTOCOL is not always provided by U-Boot. Use protocol interface functions instead of U-Boot internal functions. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d6566113 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose eficonfig_create_device_path() Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use eficonfig_create_device_path() to construct the full device path from device path of the volume and file path, so move it out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d571f9b2 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation All the eficonfig menus other than "Change Boot Order" use 'eficonfig_entry' structure for each menu entry. This commit refactors change boot order implementation to use 'eficonfig_entry' structure same as other menus to have consistent menu handling. This commit also simplifies the data->active handling when KEY_SPACE is pressed, and sizeof() parameter. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
8961e93e |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose append entry function Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use append_entry() and append_quit_entry() to construct the menu, so move them out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
a84040ab |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor file selection handling eficonfig_select_file_handler() is commonly used to select the file. eficonfig_display_select_file_option() adds an additional menu to clear the selected file. eficonfig_display_select_file_option() is not always necessary for the file selection process, so it must be outside of eficonfig_select_file_handler(). This commit also renames the following functions to avoid confusion. eficonfig_select_file_handler() -> eficonfig_process_select_file() eficonfig_select_file() -> eficonfig_show_file_selection() eficonfig_display_select_file_option() -> eficonfig_process_show_file_option() Finally, test_eficonfig.py need to be updated to get aligned with the above modification. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
1167e88a |
|
14-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix missing variable initialization The 'ret' variable must be initialized before use in eficonfig_delete_invalid_boot_option(). Fixes: c416f1c0bc ("bootmenu: add removable media entries") Addresses-Coverity: 376207 ("Uninitialized variables") Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
3d595ac5 |
|
09-Nov-2022 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: remove superfluous if in eficonfig_edit_boot_option Goto for an immediately succeeding label is superfluous. Fixes: 87d791423ac6 ("eficonfig: menu-driven addition of UEFI boot option") Addresses-Coverity: 376202 ("Identical code for different branches") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
f19171c9 |
|
08-Jan-2024 |
Ilias Apalodimas <ilias.apalodimas@linaro.org> |
efi_loader: Clean up efi_dp_append and efi_dp_concat Looking back at the initrd storing functionality, we introduced three functions, efi_dp_append_or_concatenate(), efi_dp_append/concat(). In hindsight we could have simplified that by a lot. First of all none of the functions append anything. They all allocate a new device path and concatenate the contents of two device paths in one. A boolean parameter controls the final device path -- if that's true an end node is injected between the two device paths. So let's rewrite this and make it a bit easier to read. Get rid of efi_dp_append(), efi_dp_concat() and rename efi_dp_append_or_concatenate() to efi_dp_concat(). This is far more intuitive and the only adjustment that is needed is an extra boolean argument on all callsites. Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
64658007 |
|
17-Nov-2023 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: eficonfig: create shortened boot options The boot options created by eficonfig should use shortened device-paths to avoid problems if drives are enumerated in a different sequence. Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
9945bc4f |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Fix incorrect return code of boot option update Correct the return code for out-of-memory and no boot option found Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
339b527b |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Move bootorder and bootoption apis to lib Rename and move bootorder and bootoption apis from cmd to lib for re-use between eficonfig and bootmgr Fix 'unexpected indentation' when 'make htmldocs' after functions are moved Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
2c0b0c31 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_SECURE_BOOT This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_SECURE_BOOT defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
83f3d121 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_MM_COMM_TEE This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_MM_COMM_TEE defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
88df3634 |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: CTRL+S to save the boot order 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>
|
#
45f5319f |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
menu: remove CTRL+C to quit On the sandbox called without "--terminal raw" CTRL+C leaves U-Boot, "ESC/CTRL+C to quit" is misleading. Let's remove CTRL+C to quit key handling from bootmenu and eficonfig menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
|
#
8dbd0a0f |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add vertical scroll support The current eficonfig menu does not support vertical scroll, so it can not display the menu entries greater than the console row size. This commit add the vertial scroll support. The console size is retrieved by SIMPLE_TEXT_OUTPUT_PROTOCOL.QueryMode() service, then calculates the row size for menu entry by subtracting menu header and description row size from the console row size. "start" and "end" are added in the efimenu structure. "start" keeps the menu entry index at the top, "end" keeps the bottom menu entry index. item_data_print() menu function only draws the menu entry between "start" and "end". This commit also fixes the issue that "Save" and "Quit" entries can be moved by BKEY_PLUS in change boot order menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
0d590852 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation This commit removes the change boot order specific menu implementation. The change boot order implementation calls eficonfig_process_common() same as other menus. The change boot order menu requires own item_data_print and item_choice implementation, but display_statusline function can be a same function as other menus. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
cd160b27 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor eficonfig_process_common function Current change boot order implementation does not call eficonfig_process_common() and call own menu functions for display_statusline, item_data_print and item_choice. Change boot order functionality should call eficonfig_process_common() to improve maintenanceability. This commit is a preparation to remove the change boot order specific implementation. The menu functions (display_statusline, item_data_print and item_choice) are added as argument of eficonfig_process_common(). The menu description string displayed at the bottom of the menu is also added as argument. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
32bab0ea |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Make use of CLI character processing Avoid duplicating some of the escape-sequence processing here and use the CLI function instead. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
d0ca98db |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Update bootmenu_loop() to return the code Use the return value to save having to pass around a pointer. This also resolves any ambiguity about what *key contains when the function is called. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
2da4a15e |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Rename KEY_... to BKEY_... This enum values conflict with linux/input.h so rename them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
64550274 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: avoid SetVariable between GetNextVariableName calls The current code calls efi_set_variable_int() to delete the invalid boot option between calls to efi_get_next_variable_name_int(), it may produce unpredictable results. This commit moves removal of the invalid boot option outside of the efi_get_next_variable_name_int() calls. EFI_NOT_FOUND returned from efi_get_next_variable_name_int() indicates we retrieved all EFI variables, it should be treated as EFI_SUCEESS. To address the checkpatch warning of too many leading tabs, combine two if statement into one. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
ce327084 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: carve out efi_get_next_variable_name_int calls To retrieve the EFI variable name by efi_get_next_variable_name_int(), the sequence of alloc -> efi_get_next_variable_name_int -> realloc -> efi_get_next_variable_name_int is required. In current code, this sequence repeatedly appears in the several functions. It should be curved out a common function. This commit also fixes the missing free() of var_name16 in eficonfig_delete_invalid_boot_option(). Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
140a8959 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use efi_get_next_variable_name_int() eficonfig command reads all possible UEFI load options from 0x0000 to 0xFFFF to construct the menu. This takes too much time in some environment. This commit uses efi_get_next_variable_name_int() to read all existing UEFI load options to significantlly reduce the count of efi_get_var() call. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
78b1ccc4 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use u16_strsize() to get u16 string buffer size Use u16_strsize() to simplify the u16 string buffer size calculation. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c67d3c9e |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix going one directory up issue The directory name in eficonfig menu entry contains the '\' separator. strcmp() argument ".." is wrong and one directory up handling does not work correctly. strcmp() argument must include '\' separator. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c3b5af63 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add UEFI Secure Boot Key enrollment interface This commit adds the menu-driven UEFI Secure Boot Key enrollment interface. User can enroll PK, KEK, db and dbx by selecting file. Only the signed EFI Signature List(s) with an authenticated header, typically '.auth' file, is accepted. To clear the PK, KEK, db and dbx, user needs to enroll the null key signed by PK or KEK. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
21faf4ef |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use protocol interface for file selection EFI_SIMPLE_FILE_SYSTEM_PROTOCOL is not always provided by U-Boot. Use protocol interface functions instead of U-Boot internal functions. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d6566113 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose eficonfig_create_device_path() Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use eficonfig_create_device_path() to construct the full device path from device path of the volume and file path, so move it out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d571f9b2 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation All the eficonfig menus other than "Change Boot Order" use 'eficonfig_entry' structure for each menu entry. This commit refactors change boot order implementation to use 'eficonfig_entry' structure same as other menus to have consistent menu handling. This commit also simplifies the data->active handling when KEY_SPACE is pressed, and sizeof() parameter. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
8961e93e |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose append entry function Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use append_entry() and append_quit_entry() to construct the menu, so move them out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
a84040ab |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor file selection handling eficonfig_select_file_handler() is commonly used to select the file. eficonfig_display_select_file_option() adds an additional menu to clear the selected file. eficonfig_display_select_file_option() is not always necessary for the file selection process, so it must be outside of eficonfig_select_file_handler(). This commit also renames the following functions to avoid confusion. eficonfig_select_file_handler() -> eficonfig_process_select_file() eficonfig_select_file() -> eficonfig_show_file_selection() eficonfig_display_select_file_option() -> eficonfig_process_show_file_option() Finally, test_eficonfig.py need to be updated to get aligned with the above modification. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
1167e88a |
|
14-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix missing variable initialization The 'ret' variable must be initialized before use in eficonfig_delete_invalid_boot_option(). Fixes: c416f1c0bc ("bootmenu: add removable media entries") Addresses-Coverity: 376207 ("Uninitialized variables") Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
3d595ac5 |
|
09-Nov-2022 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: remove superfluous if in eficonfig_edit_boot_option Goto for an immediately succeeding label is superfluous. Fixes: 87d791423ac6 ("eficonfig: menu-driven addition of UEFI boot option") Addresses-Coverity: 376202 ("Identical code for different branches") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
f19171c9 |
|
08-Jan-2024 |
Ilias Apalodimas <ilias.apalodimas@linaro.org> |
efi_loader: Clean up efi_dp_append and efi_dp_concat Looking back at the initrd storing functionality, we introduced three functions, efi_dp_append_or_concatenate(), efi_dp_append/concat(). In hindsight we could have simplified that by a lot. First of all none of the functions append anything. They all allocate a new device path and concatenate the contents of two device paths in one. A boolean parameter controls the final device path -- if that's true an end node is injected between the two device paths. So let's rewrite this and make it a bit easier to read. Get rid of efi_dp_append(), efi_dp_concat() and rename efi_dp_append_or_concatenate() to efi_dp_concat(). This is far more intuitive and the only adjustment that is needed is an extra boolean argument on all callsites. Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
64658007 |
|
17-Nov-2023 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: eficonfig: create shortened boot options The boot options created by eficonfig should use shortened device-paths to avoid problems if drives are enumerated in a different sequence. Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
9945bc4f |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Fix incorrect return code of boot option update Correct the return code for out-of-memory and no boot option found Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
339b527b |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Move bootorder and bootoption apis to lib Rename and move bootorder and bootoption apis from cmd to lib for re-use between eficonfig and bootmgr Fix 'unexpected indentation' when 'make htmldocs' after functions are moved Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
2c0b0c31 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_SECURE_BOOT This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_SECURE_BOOT defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
83f3d121 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_MM_COMM_TEE This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_MM_COMM_TEE defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
88df3634 |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: CTRL+S to save the boot order 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>
|
#
45f5319f |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
menu: remove CTRL+C to quit On the sandbox called without "--terminal raw" CTRL+C leaves U-Boot, "ESC/CTRL+C to quit" is misleading. Let's remove CTRL+C to quit key handling from bootmenu and eficonfig menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
|
#
8dbd0a0f |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add vertical scroll support The current eficonfig menu does not support vertical scroll, so it can not display the menu entries greater than the console row size. This commit add the vertial scroll support. The console size is retrieved by SIMPLE_TEXT_OUTPUT_PROTOCOL.QueryMode() service, then calculates the row size for menu entry by subtracting menu header and description row size from the console row size. "start" and "end" are added in the efimenu structure. "start" keeps the menu entry index at the top, "end" keeps the bottom menu entry index. item_data_print() menu function only draws the menu entry between "start" and "end". This commit also fixes the issue that "Save" and "Quit" entries can be moved by BKEY_PLUS in change boot order menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
0d590852 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation This commit removes the change boot order specific menu implementation. The change boot order implementation calls eficonfig_process_common() same as other menus. The change boot order menu requires own item_data_print and item_choice implementation, but display_statusline function can be a same function as other menus. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
cd160b27 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor eficonfig_process_common function Current change boot order implementation does not call eficonfig_process_common() and call own menu functions for display_statusline, item_data_print and item_choice. Change boot order functionality should call eficonfig_process_common() to improve maintenanceability. This commit is a preparation to remove the change boot order specific implementation. The menu functions (display_statusline, item_data_print and item_choice) are added as argument of eficonfig_process_common(). The menu description string displayed at the bottom of the menu is also added as argument. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
32bab0ea |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Make use of CLI character processing Avoid duplicating some of the escape-sequence processing here and use the CLI function instead. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
d0ca98db |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Update bootmenu_loop() to return the code Use the return value to save having to pass around a pointer. This also resolves any ambiguity about what *key contains when the function is called. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
2da4a15e |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Rename KEY_... to BKEY_... This enum values conflict with linux/input.h so rename them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
64550274 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: avoid SetVariable between GetNextVariableName calls The current code calls efi_set_variable_int() to delete the invalid boot option between calls to efi_get_next_variable_name_int(), it may produce unpredictable results. This commit moves removal of the invalid boot option outside of the efi_get_next_variable_name_int() calls. EFI_NOT_FOUND returned from efi_get_next_variable_name_int() indicates we retrieved all EFI variables, it should be treated as EFI_SUCEESS. To address the checkpatch warning of too many leading tabs, combine two if statement into one. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
ce327084 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: carve out efi_get_next_variable_name_int calls To retrieve the EFI variable name by efi_get_next_variable_name_int(), the sequence of alloc -> efi_get_next_variable_name_int -> realloc -> efi_get_next_variable_name_int is required. In current code, this sequence repeatedly appears in the several functions. It should be curved out a common function. This commit also fixes the missing free() of var_name16 in eficonfig_delete_invalid_boot_option(). Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
140a8959 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use efi_get_next_variable_name_int() eficonfig command reads all possible UEFI load options from 0x0000 to 0xFFFF to construct the menu. This takes too much time in some environment. This commit uses efi_get_next_variable_name_int() to read all existing UEFI load options to significantlly reduce the count of efi_get_var() call. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
78b1ccc4 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use u16_strsize() to get u16 string buffer size Use u16_strsize() to simplify the u16 string buffer size calculation. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c67d3c9e |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix going one directory up issue The directory name in eficonfig menu entry contains the '\' separator. strcmp() argument ".." is wrong and one directory up handling does not work correctly. strcmp() argument must include '\' separator. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c3b5af63 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add UEFI Secure Boot Key enrollment interface This commit adds the menu-driven UEFI Secure Boot Key enrollment interface. User can enroll PK, KEK, db and dbx by selecting file. Only the signed EFI Signature List(s) with an authenticated header, typically '.auth' file, is accepted. To clear the PK, KEK, db and dbx, user needs to enroll the null key signed by PK or KEK. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
21faf4ef |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use protocol interface for file selection EFI_SIMPLE_FILE_SYSTEM_PROTOCOL is not always provided by U-Boot. Use protocol interface functions instead of U-Boot internal functions. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d6566113 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose eficonfig_create_device_path() Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use eficonfig_create_device_path() to construct the full device path from device path of the volume and file path, so move it out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d571f9b2 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation All the eficonfig menus other than "Change Boot Order" use 'eficonfig_entry' structure for each menu entry. This commit refactors change boot order implementation to use 'eficonfig_entry' structure same as other menus to have consistent menu handling. This commit also simplifies the data->active handling when KEY_SPACE is pressed, and sizeof() parameter. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
8961e93e |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose append entry function Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use append_entry() and append_quit_entry() to construct the menu, so move them out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
a84040ab |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor file selection handling eficonfig_select_file_handler() is commonly used to select the file. eficonfig_display_select_file_option() adds an additional menu to clear the selected file. eficonfig_display_select_file_option() is not always necessary for the file selection process, so it must be outside of eficonfig_select_file_handler(). This commit also renames the following functions to avoid confusion. eficonfig_select_file_handler() -> eficonfig_process_select_file() eficonfig_select_file() -> eficonfig_show_file_selection() eficonfig_display_select_file_option() -> eficonfig_process_show_file_option() Finally, test_eficonfig.py need to be updated to get aligned with the above modification. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
1167e88a |
|
14-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix missing variable initialization The 'ret' variable must be initialized before use in eficonfig_delete_invalid_boot_option(). Fixes: c416f1c0bc ("bootmenu: add removable media entries") Addresses-Coverity: 376207 ("Uninitialized variables") Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
3d595ac5 |
|
09-Nov-2022 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: remove superfluous if in eficonfig_edit_boot_option Goto for an immediately succeeding label is superfluous. Fixes: 87d791423ac6 ("eficonfig: menu-driven addition of UEFI boot option") Addresses-Coverity: 376202 ("Identical code for different branches") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
f19171c9 |
|
08-Jan-2024 |
Ilias Apalodimas <ilias.apalodimas@linaro.org> |
efi_loader: Clean up efi_dp_append and efi_dp_concat Looking back at the initrd storing functionality, we introduced three functions, efi_dp_append_or_concatenate(), efi_dp_append/concat(). In hindsight we could have simplified that by a lot. First of all none of the functions append anything. They all allocate a new device path and concatenate the contents of two device paths in one. A boolean parameter controls the final device path -- if that's true an end node is injected between the two device paths. So let's rewrite this and make it a bit easier to read. Get rid of efi_dp_append(), efi_dp_concat() and rename efi_dp_append_or_concatenate() to efi_dp_concat(). This is far more intuitive and the only adjustment that is needed is an extra boolean argument on all callsites. Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
64658007 |
|
17-Nov-2023 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: eficonfig: create shortened boot options The boot options created by eficonfig should use shortened device-paths to avoid problems if drives are enumerated in a different sequence. Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
9945bc4f |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Fix incorrect return code of boot option update Correct the return code for out-of-memory and no boot option found Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
339b527b |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Move bootorder and bootoption apis to lib Rename and move bootorder and bootoption apis from cmd to lib for re-use between eficonfig and bootmgr Fix 'unexpected indentation' when 'make htmldocs' after functions are moved Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
2c0b0c31 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_SECURE_BOOT This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_SECURE_BOOT defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
83f3d121 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_MM_COMM_TEE This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_MM_COMM_TEE defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
88df3634 |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: CTRL+S to save the boot order 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>
|
#
45f5319f |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
menu: remove CTRL+C to quit On the sandbox called without "--terminal raw" CTRL+C leaves U-Boot, "ESC/CTRL+C to quit" is misleading. Let's remove CTRL+C to quit key handling from bootmenu and eficonfig menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
|
#
8dbd0a0f |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add vertical scroll support The current eficonfig menu does not support vertical scroll, so it can not display the menu entries greater than the console row size. This commit add the vertial scroll support. The console size is retrieved by SIMPLE_TEXT_OUTPUT_PROTOCOL.QueryMode() service, then calculates the row size for menu entry by subtracting menu header and description row size from the console row size. "start" and "end" are added in the efimenu structure. "start" keeps the menu entry index at the top, "end" keeps the bottom menu entry index. item_data_print() menu function only draws the menu entry between "start" and "end". This commit also fixes the issue that "Save" and "Quit" entries can be moved by BKEY_PLUS in change boot order menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
0d590852 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation This commit removes the change boot order specific menu implementation. The change boot order implementation calls eficonfig_process_common() same as other menus. The change boot order menu requires own item_data_print and item_choice implementation, but display_statusline function can be a same function as other menus. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
cd160b27 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor eficonfig_process_common function Current change boot order implementation does not call eficonfig_process_common() and call own menu functions for display_statusline, item_data_print and item_choice. Change boot order functionality should call eficonfig_process_common() to improve maintenanceability. This commit is a preparation to remove the change boot order specific implementation. The menu functions (display_statusline, item_data_print and item_choice) are added as argument of eficonfig_process_common(). The menu description string displayed at the bottom of the menu is also added as argument. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
32bab0ea |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Make use of CLI character processing Avoid duplicating some of the escape-sequence processing here and use the CLI function instead. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
d0ca98db |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Update bootmenu_loop() to return the code Use the return value to save having to pass around a pointer. This also resolves any ambiguity about what *key contains when the function is called. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
2da4a15e |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Rename KEY_... to BKEY_... This enum values conflict with linux/input.h so rename them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
64550274 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: avoid SetVariable between GetNextVariableName calls The current code calls efi_set_variable_int() to delete the invalid boot option between calls to efi_get_next_variable_name_int(), it may produce unpredictable results. This commit moves removal of the invalid boot option outside of the efi_get_next_variable_name_int() calls. EFI_NOT_FOUND returned from efi_get_next_variable_name_int() indicates we retrieved all EFI variables, it should be treated as EFI_SUCEESS. To address the checkpatch warning of too many leading tabs, combine two if statement into one. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
ce327084 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: carve out efi_get_next_variable_name_int calls To retrieve the EFI variable name by efi_get_next_variable_name_int(), the sequence of alloc -> efi_get_next_variable_name_int -> realloc -> efi_get_next_variable_name_int is required. In current code, this sequence repeatedly appears in the several functions. It should be curved out a common function. This commit also fixes the missing free() of var_name16 in eficonfig_delete_invalid_boot_option(). Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
140a8959 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use efi_get_next_variable_name_int() eficonfig command reads all possible UEFI load options from 0x0000 to 0xFFFF to construct the menu. This takes too much time in some environment. This commit uses efi_get_next_variable_name_int() to read all existing UEFI load options to significantlly reduce the count of efi_get_var() call. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
78b1ccc4 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use u16_strsize() to get u16 string buffer size Use u16_strsize() to simplify the u16 string buffer size calculation. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c67d3c9e |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix going one directory up issue The directory name in eficonfig menu entry contains the '\' separator. strcmp() argument ".." is wrong and one directory up handling does not work correctly. strcmp() argument must include '\' separator. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c3b5af63 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add UEFI Secure Boot Key enrollment interface This commit adds the menu-driven UEFI Secure Boot Key enrollment interface. User can enroll PK, KEK, db and dbx by selecting file. Only the signed EFI Signature List(s) with an authenticated header, typically '.auth' file, is accepted. To clear the PK, KEK, db and dbx, user needs to enroll the null key signed by PK or KEK. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
21faf4ef |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use protocol interface for file selection EFI_SIMPLE_FILE_SYSTEM_PROTOCOL is not always provided by U-Boot. Use protocol interface functions instead of U-Boot internal functions. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d6566113 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose eficonfig_create_device_path() Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use eficonfig_create_device_path() to construct the full device path from device path of the volume and file path, so move it out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d571f9b2 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation All the eficonfig menus other than "Change Boot Order" use 'eficonfig_entry' structure for each menu entry. This commit refactors change boot order implementation to use 'eficonfig_entry' structure same as other menus to have consistent menu handling. This commit also simplifies the data->active handling when KEY_SPACE is pressed, and sizeof() parameter. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
8961e93e |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose append entry function Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use append_entry() and append_quit_entry() to construct the menu, so move them out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
a84040ab |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor file selection handling eficonfig_select_file_handler() is commonly used to select the file. eficonfig_display_select_file_option() adds an additional menu to clear the selected file. eficonfig_display_select_file_option() is not always necessary for the file selection process, so it must be outside of eficonfig_select_file_handler(). This commit also renames the following functions to avoid confusion. eficonfig_select_file_handler() -> eficonfig_process_select_file() eficonfig_select_file() -> eficonfig_show_file_selection() eficonfig_display_select_file_option() -> eficonfig_process_show_file_option() Finally, test_eficonfig.py need to be updated to get aligned with the above modification. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
1167e88a |
|
14-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix missing variable initialization The 'ret' variable must be initialized before use in eficonfig_delete_invalid_boot_option(). Fixes: c416f1c0bc ("bootmenu: add removable media entries") Addresses-Coverity: 376207 ("Uninitialized variables") Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
3d595ac5 |
|
09-Nov-2022 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: remove superfluous if in eficonfig_edit_boot_option Goto for an immediately succeeding label is superfluous. Fixes: 87d791423ac6 ("eficonfig: menu-driven addition of UEFI boot option") Addresses-Coverity: 376202 ("Identical code for different branches") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
f19171c9 |
|
08-Jan-2024 |
Ilias Apalodimas <ilias.apalodimas@linaro.org> |
efi_loader: Clean up efi_dp_append and efi_dp_concat Looking back at the initrd storing functionality, we introduced three functions, efi_dp_append_or_concatenate(), efi_dp_append/concat(). In hindsight we could have simplified that by a lot. First of all none of the functions append anything. They all allocate a new device path and concatenate the contents of two device paths in one. A boolean parameter controls the final device path -- if that's true an end node is injected between the two device paths. So let's rewrite this and make it a bit easier to read. Get rid of efi_dp_append(), efi_dp_concat() and rename efi_dp_append_or_concatenate() to efi_dp_concat(). This is far more intuitive and the only adjustment that is needed is an extra boolean argument on all callsites. Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
64658007 |
|
17-Nov-2023 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: eficonfig: create shortened boot options The boot options created by eficonfig should use shortened device-paths to avoid problems if drives are enumerated in a different sequence. Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
9945bc4f |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Fix incorrect return code of boot option update Correct the return code for out-of-memory and no boot option found Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
339b527b |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Move bootorder and bootoption apis to lib Rename and move bootorder and bootoption apis from cmd to lib for re-use between eficonfig and bootmgr Fix 'unexpected indentation' when 'make htmldocs' after functions are moved Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
2c0b0c31 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_SECURE_BOOT This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_SECURE_BOOT defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
83f3d121 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_MM_COMM_TEE This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_MM_COMM_TEE defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
88df3634 |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: CTRL+S to save the boot order 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>
|
#
45f5319f |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
menu: remove CTRL+C to quit On the sandbox called without "--terminal raw" CTRL+C leaves U-Boot, "ESC/CTRL+C to quit" is misleading. Let's remove CTRL+C to quit key handling from bootmenu and eficonfig menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
|
#
8dbd0a0f |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add vertical scroll support The current eficonfig menu does not support vertical scroll, so it can not display the menu entries greater than the console row size. This commit add the vertial scroll support. The console size is retrieved by SIMPLE_TEXT_OUTPUT_PROTOCOL.QueryMode() service, then calculates the row size for menu entry by subtracting menu header and description row size from the console row size. "start" and "end" are added in the efimenu structure. "start" keeps the menu entry index at the top, "end" keeps the bottom menu entry index. item_data_print() menu function only draws the menu entry between "start" and "end". This commit also fixes the issue that "Save" and "Quit" entries can be moved by BKEY_PLUS in change boot order menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
0d590852 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation This commit removes the change boot order specific menu implementation. The change boot order implementation calls eficonfig_process_common() same as other menus. The change boot order menu requires own item_data_print and item_choice implementation, but display_statusline function can be a same function as other menus. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
cd160b27 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor eficonfig_process_common function Current change boot order implementation does not call eficonfig_process_common() and call own menu functions for display_statusline, item_data_print and item_choice. Change boot order functionality should call eficonfig_process_common() to improve maintenanceability. This commit is a preparation to remove the change boot order specific implementation. The menu functions (display_statusline, item_data_print and item_choice) are added as argument of eficonfig_process_common(). The menu description string displayed at the bottom of the menu is also added as argument. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
32bab0ea |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Make use of CLI character processing Avoid duplicating some of the escape-sequence processing here and use the CLI function instead. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
d0ca98db |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Update bootmenu_loop() to return the code Use the return value to save having to pass around a pointer. This also resolves any ambiguity about what *key contains when the function is called. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
2da4a15e |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Rename KEY_... to BKEY_... This enum values conflict with linux/input.h so rename them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
64550274 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: avoid SetVariable between GetNextVariableName calls The current code calls efi_set_variable_int() to delete the invalid boot option between calls to efi_get_next_variable_name_int(), it may produce unpredictable results. This commit moves removal of the invalid boot option outside of the efi_get_next_variable_name_int() calls. EFI_NOT_FOUND returned from efi_get_next_variable_name_int() indicates we retrieved all EFI variables, it should be treated as EFI_SUCEESS. To address the checkpatch warning of too many leading tabs, combine two if statement into one. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
ce327084 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: carve out efi_get_next_variable_name_int calls To retrieve the EFI variable name by efi_get_next_variable_name_int(), the sequence of alloc -> efi_get_next_variable_name_int -> realloc -> efi_get_next_variable_name_int is required. In current code, this sequence repeatedly appears in the several functions. It should be curved out a common function. This commit also fixes the missing free() of var_name16 in eficonfig_delete_invalid_boot_option(). Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
140a8959 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use efi_get_next_variable_name_int() eficonfig command reads all possible UEFI load options from 0x0000 to 0xFFFF to construct the menu. This takes too much time in some environment. This commit uses efi_get_next_variable_name_int() to read all existing UEFI load options to significantlly reduce the count of efi_get_var() call. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
78b1ccc4 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use u16_strsize() to get u16 string buffer size Use u16_strsize() to simplify the u16 string buffer size calculation. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c67d3c9e |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix going one directory up issue The directory name in eficonfig menu entry contains the '\' separator. strcmp() argument ".." is wrong and one directory up handling does not work correctly. strcmp() argument must include '\' separator. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c3b5af63 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add UEFI Secure Boot Key enrollment interface This commit adds the menu-driven UEFI Secure Boot Key enrollment interface. User can enroll PK, KEK, db and dbx by selecting file. Only the signed EFI Signature List(s) with an authenticated header, typically '.auth' file, is accepted. To clear the PK, KEK, db and dbx, user needs to enroll the null key signed by PK or KEK. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
21faf4ef |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use protocol interface for file selection EFI_SIMPLE_FILE_SYSTEM_PROTOCOL is not always provided by U-Boot. Use protocol interface functions instead of U-Boot internal functions. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d6566113 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose eficonfig_create_device_path() Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use eficonfig_create_device_path() to construct the full device path from device path of the volume and file path, so move it out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d571f9b2 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation All the eficonfig menus other than "Change Boot Order" use 'eficonfig_entry' structure for each menu entry. This commit refactors change boot order implementation to use 'eficonfig_entry' structure same as other menus to have consistent menu handling. This commit also simplifies the data->active handling when KEY_SPACE is pressed, and sizeof() parameter. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
8961e93e |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose append entry function Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use append_entry() and append_quit_entry() to construct the menu, so move them out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
a84040ab |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor file selection handling eficonfig_select_file_handler() is commonly used to select the file. eficonfig_display_select_file_option() adds an additional menu to clear the selected file. eficonfig_display_select_file_option() is not always necessary for the file selection process, so it must be outside of eficonfig_select_file_handler(). This commit also renames the following functions to avoid confusion. eficonfig_select_file_handler() -> eficonfig_process_select_file() eficonfig_select_file() -> eficonfig_show_file_selection() eficonfig_display_select_file_option() -> eficonfig_process_show_file_option() Finally, test_eficonfig.py need to be updated to get aligned with the above modification. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
1167e88a |
|
14-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix missing variable initialization The 'ret' variable must be initialized before use in eficonfig_delete_invalid_boot_option(). Fixes: c416f1c0bc ("bootmenu: add removable media entries") Addresses-Coverity: 376207 ("Uninitialized variables") Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
3d595ac5 |
|
09-Nov-2022 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: remove superfluous if in eficonfig_edit_boot_option Goto for an immediately succeeding label is superfluous. Fixes: 87d791423ac6 ("eficonfig: menu-driven addition of UEFI boot option") Addresses-Coverity: 376202 ("Identical code for different branches") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
f19171c9 |
|
08-Jan-2024 |
Ilias Apalodimas <ilias.apalodimas@linaro.org> |
efi_loader: Clean up efi_dp_append and efi_dp_concat Looking back at the initrd storing functionality, we introduced three functions, efi_dp_append_or_concatenate(), efi_dp_append/concat(). In hindsight we could have simplified that by a lot. First of all none of the functions append anything. They all allocate a new device path and concatenate the contents of two device paths in one. A boolean parameter controls the final device path -- if that's true an end node is injected between the two device paths. So let's rewrite this and make it a bit easier to read. Get rid of efi_dp_append(), efi_dp_concat() and rename efi_dp_append_or_concatenate() to efi_dp_concat(). This is far more intuitive and the only adjustment that is needed is an extra boolean argument on all callsites. Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
64658007 |
|
17-Nov-2023 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: eficonfig: create shortened boot options The boot options created by eficonfig should use shortened device-paths to avoid problems if drives are enumerated in a different sequence. Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
9945bc4f |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Fix incorrect return code of boot option update Correct the return code for out-of-memory and no boot option found Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
339b527b |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Move bootorder and bootoption apis to lib Rename and move bootorder and bootoption apis from cmd to lib for re-use between eficonfig and bootmgr Fix 'unexpected indentation' when 'make htmldocs' after functions are moved Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
2c0b0c31 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_SECURE_BOOT This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_SECURE_BOOT defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
83f3d121 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_MM_COMM_TEE This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_MM_COMM_TEE defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
88df3634 |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: CTRL+S to save the boot order 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>
|
#
45f5319f |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
menu: remove CTRL+C to quit On the sandbox called without "--terminal raw" CTRL+C leaves U-Boot, "ESC/CTRL+C to quit" is misleading. Let's remove CTRL+C to quit key handling from bootmenu and eficonfig menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
|
#
8dbd0a0f |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add vertical scroll support The current eficonfig menu does not support vertical scroll, so it can not display the menu entries greater than the console row size. This commit add the vertial scroll support. The console size is retrieved by SIMPLE_TEXT_OUTPUT_PROTOCOL.QueryMode() service, then calculates the row size for menu entry by subtracting menu header and description row size from the console row size. "start" and "end" are added in the efimenu structure. "start" keeps the menu entry index at the top, "end" keeps the bottom menu entry index. item_data_print() menu function only draws the menu entry between "start" and "end". This commit also fixes the issue that "Save" and "Quit" entries can be moved by BKEY_PLUS in change boot order menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
0d590852 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation This commit removes the change boot order specific menu implementation. The change boot order implementation calls eficonfig_process_common() same as other menus. The change boot order menu requires own item_data_print and item_choice implementation, but display_statusline function can be a same function as other menus. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
cd160b27 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor eficonfig_process_common function Current change boot order implementation does not call eficonfig_process_common() and call own menu functions for display_statusline, item_data_print and item_choice. Change boot order functionality should call eficonfig_process_common() to improve maintenanceability. This commit is a preparation to remove the change boot order specific implementation. The menu functions (display_statusline, item_data_print and item_choice) are added as argument of eficonfig_process_common(). The menu description string displayed at the bottom of the menu is also added as argument. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
32bab0ea |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Make use of CLI character processing Avoid duplicating some of the escape-sequence processing here and use the CLI function instead. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
d0ca98db |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Update bootmenu_loop() to return the code Use the return value to save having to pass around a pointer. This also resolves any ambiguity about what *key contains when the function is called. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
2da4a15e |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Rename KEY_... to BKEY_... This enum values conflict with linux/input.h so rename them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
64550274 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: avoid SetVariable between GetNextVariableName calls The current code calls efi_set_variable_int() to delete the invalid boot option between calls to efi_get_next_variable_name_int(), it may produce unpredictable results. This commit moves removal of the invalid boot option outside of the efi_get_next_variable_name_int() calls. EFI_NOT_FOUND returned from efi_get_next_variable_name_int() indicates we retrieved all EFI variables, it should be treated as EFI_SUCEESS. To address the checkpatch warning of too many leading tabs, combine two if statement into one. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
ce327084 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: carve out efi_get_next_variable_name_int calls To retrieve the EFI variable name by efi_get_next_variable_name_int(), the sequence of alloc -> efi_get_next_variable_name_int -> realloc -> efi_get_next_variable_name_int is required. In current code, this sequence repeatedly appears in the several functions. It should be curved out a common function. This commit also fixes the missing free() of var_name16 in eficonfig_delete_invalid_boot_option(). Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
140a8959 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use efi_get_next_variable_name_int() eficonfig command reads all possible UEFI load options from 0x0000 to 0xFFFF to construct the menu. This takes too much time in some environment. This commit uses efi_get_next_variable_name_int() to read all existing UEFI load options to significantlly reduce the count of efi_get_var() call. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
78b1ccc4 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use u16_strsize() to get u16 string buffer size Use u16_strsize() to simplify the u16 string buffer size calculation. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c67d3c9e |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix going one directory up issue The directory name in eficonfig menu entry contains the '\' separator. strcmp() argument ".." is wrong and one directory up handling does not work correctly. strcmp() argument must include '\' separator. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c3b5af63 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add UEFI Secure Boot Key enrollment interface This commit adds the menu-driven UEFI Secure Boot Key enrollment interface. User can enroll PK, KEK, db and dbx by selecting file. Only the signed EFI Signature List(s) with an authenticated header, typically '.auth' file, is accepted. To clear the PK, KEK, db and dbx, user needs to enroll the null key signed by PK or KEK. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
21faf4ef |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use protocol interface for file selection EFI_SIMPLE_FILE_SYSTEM_PROTOCOL is not always provided by U-Boot. Use protocol interface functions instead of U-Boot internal functions. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d6566113 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose eficonfig_create_device_path() Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use eficonfig_create_device_path() to construct the full device path from device path of the volume and file path, so move it out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d571f9b2 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation All the eficonfig menus other than "Change Boot Order" use 'eficonfig_entry' structure for each menu entry. This commit refactors change boot order implementation to use 'eficonfig_entry' structure same as other menus to have consistent menu handling. This commit also simplifies the data->active handling when KEY_SPACE is pressed, and sizeof() parameter. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
8961e93e |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose append entry function Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use append_entry() and append_quit_entry() to construct the menu, so move them out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
a84040ab |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor file selection handling eficonfig_select_file_handler() is commonly used to select the file. eficonfig_display_select_file_option() adds an additional menu to clear the selected file. eficonfig_display_select_file_option() is not always necessary for the file selection process, so it must be outside of eficonfig_select_file_handler(). This commit also renames the following functions to avoid confusion. eficonfig_select_file_handler() -> eficonfig_process_select_file() eficonfig_select_file() -> eficonfig_show_file_selection() eficonfig_display_select_file_option() -> eficonfig_process_show_file_option() Finally, test_eficonfig.py need to be updated to get aligned with the above modification. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
1167e88a |
|
14-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix missing variable initialization The 'ret' variable must be initialized before use in eficonfig_delete_invalid_boot_option(). Fixes: c416f1c0bc ("bootmenu: add removable media entries") Addresses-Coverity: 376207 ("Uninitialized variables") Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
3d595ac5 |
|
09-Nov-2022 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: remove superfluous if in eficonfig_edit_boot_option Goto for an immediately succeeding label is superfluous. Fixes: 87d791423ac6 ("eficonfig: menu-driven addition of UEFI boot option") Addresses-Coverity: 376202 ("Identical code for different branches") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
f19171c9 |
|
08-Jan-2024 |
Ilias Apalodimas <ilias.apalodimas@linaro.org> |
efi_loader: Clean up efi_dp_append and efi_dp_concat Looking back at the initrd storing functionality, we introduced three functions, efi_dp_append_or_concatenate(), efi_dp_append/concat(). In hindsight we could have simplified that by a lot. First of all none of the functions append anything. They all allocate a new device path and concatenate the contents of two device paths in one. A boolean parameter controls the final device path -- if that's true an end node is injected between the two device paths. So let's rewrite this and make it a bit easier to read. Get rid of efi_dp_append(), efi_dp_concat() and rename efi_dp_append_or_concatenate() to efi_dp_concat(). This is far more intuitive and the only adjustment that is needed is an extra boolean argument on all callsites. Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
64658007 |
|
17-Nov-2023 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: eficonfig: create shortened boot options The boot options created by eficonfig should use shortened device-paths to avoid problems if drives are enumerated in a different sequence. Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
9945bc4f |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Fix incorrect return code of boot option update Correct the return code for out-of-memory and no boot option found Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
339b527b |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Move bootorder and bootoption apis to lib Rename and move bootorder and bootoption apis from cmd to lib for re-use between eficonfig and bootmgr Fix 'unexpected indentation' when 'make htmldocs' after functions are moved Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
2c0b0c31 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_SECURE_BOOT This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_SECURE_BOOT defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
83f3d121 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_MM_COMM_TEE This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_MM_COMM_TEE defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
88df3634 |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: CTRL+S to save the boot order 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>
|
#
45f5319f |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
menu: remove CTRL+C to quit On the sandbox called without "--terminal raw" CTRL+C leaves U-Boot, "ESC/CTRL+C to quit" is misleading. Let's remove CTRL+C to quit key handling from bootmenu and eficonfig menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
|
#
8dbd0a0f |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add vertical scroll support The current eficonfig menu does not support vertical scroll, so it can not display the menu entries greater than the console row size. This commit add the vertial scroll support. The console size is retrieved by SIMPLE_TEXT_OUTPUT_PROTOCOL.QueryMode() service, then calculates the row size for menu entry by subtracting menu header and description row size from the console row size. "start" and "end" are added in the efimenu structure. "start" keeps the menu entry index at the top, "end" keeps the bottom menu entry index. item_data_print() menu function only draws the menu entry between "start" and "end". This commit also fixes the issue that "Save" and "Quit" entries can be moved by BKEY_PLUS in change boot order menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
0d590852 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation This commit removes the change boot order specific menu implementation. The change boot order implementation calls eficonfig_process_common() same as other menus. The change boot order menu requires own item_data_print and item_choice implementation, but display_statusline function can be a same function as other menus. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
cd160b27 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor eficonfig_process_common function Current change boot order implementation does not call eficonfig_process_common() and call own menu functions for display_statusline, item_data_print and item_choice. Change boot order functionality should call eficonfig_process_common() to improve maintenanceability. This commit is a preparation to remove the change boot order specific implementation. The menu functions (display_statusline, item_data_print and item_choice) are added as argument of eficonfig_process_common(). The menu description string displayed at the bottom of the menu is also added as argument. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
32bab0ea |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Make use of CLI character processing Avoid duplicating some of the escape-sequence processing here and use the CLI function instead. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
d0ca98db |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Update bootmenu_loop() to return the code Use the return value to save having to pass around a pointer. This also resolves any ambiguity about what *key contains when the function is called. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
2da4a15e |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Rename KEY_... to BKEY_... This enum values conflict with linux/input.h so rename them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
64550274 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: avoid SetVariable between GetNextVariableName calls The current code calls efi_set_variable_int() to delete the invalid boot option between calls to efi_get_next_variable_name_int(), it may produce unpredictable results. This commit moves removal of the invalid boot option outside of the efi_get_next_variable_name_int() calls. EFI_NOT_FOUND returned from efi_get_next_variable_name_int() indicates we retrieved all EFI variables, it should be treated as EFI_SUCEESS. To address the checkpatch warning of too many leading tabs, combine two if statement into one. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
ce327084 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: carve out efi_get_next_variable_name_int calls To retrieve the EFI variable name by efi_get_next_variable_name_int(), the sequence of alloc -> efi_get_next_variable_name_int -> realloc -> efi_get_next_variable_name_int is required. In current code, this sequence repeatedly appears in the several functions. It should be curved out a common function. This commit also fixes the missing free() of var_name16 in eficonfig_delete_invalid_boot_option(). Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
140a8959 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use efi_get_next_variable_name_int() eficonfig command reads all possible UEFI load options from 0x0000 to 0xFFFF to construct the menu. This takes too much time in some environment. This commit uses efi_get_next_variable_name_int() to read all existing UEFI load options to significantlly reduce the count of efi_get_var() call. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
78b1ccc4 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use u16_strsize() to get u16 string buffer size Use u16_strsize() to simplify the u16 string buffer size calculation. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c67d3c9e |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix going one directory up issue The directory name in eficonfig menu entry contains the '\' separator. strcmp() argument ".." is wrong and one directory up handling does not work correctly. strcmp() argument must include '\' separator. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c3b5af63 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add UEFI Secure Boot Key enrollment interface This commit adds the menu-driven UEFI Secure Boot Key enrollment interface. User can enroll PK, KEK, db and dbx by selecting file. Only the signed EFI Signature List(s) with an authenticated header, typically '.auth' file, is accepted. To clear the PK, KEK, db and dbx, user needs to enroll the null key signed by PK or KEK. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
21faf4ef |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use protocol interface for file selection EFI_SIMPLE_FILE_SYSTEM_PROTOCOL is not always provided by U-Boot. Use protocol interface functions instead of U-Boot internal functions. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d6566113 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose eficonfig_create_device_path() Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use eficonfig_create_device_path() to construct the full device path from device path of the volume and file path, so move it out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d571f9b2 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation All the eficonfig menus other than "Change Boot Order" use 'eficonfig_entry' structure for each menu entry. This commit refactors change boot order implementation to use 'eficonfig_entry' structure same as other menus to have consistent menu handling. This commit also simplifies the data->active handling when KEY_SPACE is pressed, and sizeof() parameter. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
8961e93e |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose append entry function Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use append_entry() and append_quit_entry() to construct the menu, so move them out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
a84040ab |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor file selection handling eficonfig_select_file_handler() is commonly used to select the file. eficonfig_display_select_file_option() adds an additional menu to clear the selected file. eficonfig_display_select_file_option() is not always necessary for the file selection process, so it must be outside of eficonfig_select_file_handler(). This commit also renames the following functions to avoid confusion. eficonfig_select_file_handler() -> eficonfig_process_select_file() eficonfig_select_file() -> eficonfig_show_file_selection() eficonfig_display_select_file_option() -> eficonfig_process_show_file_option() Finally, test_eficonfig.py need to be updated to get aligned with the above modification. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
1167e88a |
|
14-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix missing variable initialization The 'ret' variable must be initialized before use in eficonfig_delete_invalid_boot_option(). Fixes: c416f1c0bc ("bootmenu: add removable media entries") Addresses-Coverity: 376207 ("Uninitialized variables") Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
3d595ac5 |
|
09-Nov-2022 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: remove superfluous if in eficonfig_edit_boot_option Goto for an immediately succeeding label is superfluous. Fixes: 87d791423ac6 ("eficonfig: menu-driven addition of UEFI boot option") Addresses-Coverity: 376202 ("Identical code for different branches") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
f19171c9 |
|
08-Jan-2024 |
Ilias Apalodimas <ilias.apalodimas@linaro.org> |
efi_loader: Clean up efi_dp_append and efi_dp_concat Looking back at the initrd storing functionality, we introduced three functions, efi_dp_append_or_concatenate(), efi_dp_append/concat(). In hindsight we could have simplified that by a lot. First of all none of the functions append anything. They all allocate a new device path and concatenate the contents of two device paths in one. A boolean parameter controls the final device path -- if that's true an end node is injected between the two device paths. So let's rewrite this and make it a bit easier to read. Get rid of efi_dp_append(), efi_dp_concat() and rename efi_dp_append_or_concatenate() to efi_dp_concat(). This is far more intuitive and the only adjustment that is needed is an extra boolean argument on all callsites. Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
64658007 |
|
17-Nov-2023 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: eficonfig: create shortened boot options The boot options created by eficonfig should use shortened device-paths to avoid problems if drives are enumerated in a different sequence. Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
9945bc4f |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Fix incorrect return code of boot option update Correct the return code for out-of-memory and no boot option found Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
339b527b |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Move bootorder and bootoption apis to lib Rename and move bootorder and bootoption apis from cmd to lib for re-use between eficonfig and bootmgr Fix 'unexpected indentation' when 'make htmldocs' after functions are moved Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
2c0b0c31 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_SECURE_BOOT This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_SECURE_BOOT defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
83f3d121 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_MM_COMM_TEE This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_MM_COMM_TEE defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
88df3634 |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: CTRL+S to save the boot order 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>
|
#
45f5319f |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
menu: remove CTRL+C to quit On the sandbox called without "--terminal raw" CTRL+C leaves U-Boot, "ESC/CTRL+C to quit" is misleading. Let's remove CTRL+C to quit key handling from bootmenu and eficonfig menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
|
#
8dbd0a0f |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add vertical scroll support The current eficonfig menu does not support vertical scroll, so it can not display the menu entries greater than the console row size. This commit add the vertial scroll support. The console size is retrieved by SIMPLE_TEXT_OUTPUT_PROTOCOL.QueryMode() service, then calculates the row size for menu entry by subtracting menu header and description row size from the console row size. "start" and "end" are added in the efimenu structure. "start" keeps the menu entry index at the top, "end" keeps the bottom menu entry index. item_data_print() menu function only draws the menu entry between "start" and "end". This commit also fixes the issue that "Save" and "Quit" entries can be moved by BKEY_PLUS in change boot order menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
0d590852 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation This commit removes the change boot order specific menu implementation. The change boot order implementation calls eficonfig_process_common() same as other menus. The change boot order menu requires own item_data_print and item_choice implementation, but display_statusline function can be a same function as other menus. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
cd160b27 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor eficonfig_process_common function Current change boot order implementation does not call eficonfig_process_common() and call own menu functions for display_statusline, item_data_print and item_choice. Change boot order functionality should call eficonfig_process_common() to improve maintenanceability. This commit is a preparation to remove the change boot order specific implementation. The menu functions (display_statusline, item_data_print and item_choice) are added as argument of eficonfig_process_common(). The menu description string displayed at the bottom of the menu is also added as argument. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
32bab0ea |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Make use of CLI character processing Avoid duplicating some of the escape-sequence processing here and use the CLI function instead. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
d0ca98db |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Update bootmenu_loop() to return the code Use the return value to save having to pass around a pointer. This also resolves any ambiguity about what *key contains when the function is called. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
2da4a15e |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Rename KEY_... to BKEY_... This enum values conflict with linux/input.h so rename them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
64550274 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: avoid SetVariable between GetNextVariableName calls The current code calls efi_set_variable_int() to delete the invalid boot option between calls to efi_get_next_variable_name_int(), it may produce unpredictable results. This commit moves removal of the invalid boot option outside of the efi_get_next_variable_name_int() calls. EFI_NOT_FOUND returned from efi_get_next_variable_name_int() indicates we retrieved all EFI variables, it should be treated as EFI_SUCEESS. To address the checkpatch warning of too many leading tabs, combine two if statement into one. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
ce327084 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: carve out efi_get_next_variable_name_int calls To retrieve the EFI variable name by efi_get_next_variable_name_int(), the sequence of alloc -> efi_get_next_variable_name_int -> realloc -> efi_get_next_variable_name_int is required. In current code, this sequence repeatedly appears in the several functions. It should be curved out a common function. This commit also fixes the missing free() of var_name16 in eficonfig_delete_invalid_boot_option(). Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
140a8959 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use efi_get_next_variable_name_int() eficonfig command reads all possible UEFI load options from 0x0000 to 0xFFFF to construct the menu. This takes too much time in some environment. This commit uses efi_get_next_variable_name_int() to read all existing UEFI load options to significantlly reduce the count of efi_get_var() call. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
78b1ccc4 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use u16_strsize() to get u16 string buffer size Use u16_strsize() to simplify the u16 string buffer size calculation. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c67d3c9e |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix going one directory up issue The directory name in eficonfig menu entry contains the '\' separator. strcmp() argument ".." is wrong and one directory up handling does not work correctly. strcmp() argument must include '\' separator. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c3b5af63 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add UEFI Secure Boot Key enrollment interface This commit adds the menu-driven UEFI Secure Boot Key enrollment interface. User can enroll PK, KEK, db and dbx by selecting file. Only the signed EFI Signature List(s) with an authenticated header, typically '.auth' file, is accepted. To clear the PK, KEK, db and dbx, user needs to enroll the null key signed by PK or KEK. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
21faf4ef |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use protocol interface for file selection EFI_SIMPLE_FILE_SYSTEM_PROTOCOL is not always provided by U-Boot. Use protocol interface functions instead of U-Boot internal functions. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d6566113 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose eficonfig_create_device_path() Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use eficonfig_create_device_path() to construct the full device path from device path of the volume and file path, so move it out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d571f9b2 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation All the eficonfig menus other than "Change Boot Order" use 'eficonfig_entry' structure for each menu entry. This commit refactors change boot order implementation to use 'eficonfig_entry' structure same as other menus to have consistent menu handling. This commit also simplifies the data->active handling when KEY_SPACE is pressed, and sizeof() parameter. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
8961e93e |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose append entry function Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use append_entry() and append_quit_entry() to construct the menu, so move them out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
a84040ab |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor file selection handling eficonfig_select_file_handler() is commonly used to select the file. eficonfig_display_select_file_option() adds an additional menu to clear the selected file. eficonfig_display_select_file_option() is not always necessary for the file selection process, so it must be outside of eficonfig_select_file_handler(). This commit also renames the following functions to avoid confusion. eficonfig_select_file_handler() -> eficonfig_process_select_file() eficonfig_select_file() -> eficonfig_show_file_selection() eficonfig_display_select_file_option() -> eficonfig_process_show_file_option() Finally, test_eficonfig.py need to be updated to get aligned with the above modification. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
1167e88a |
|
14-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix missing variable initialization The 'ret' variable must be initialized before use in eficonfig_delete_invalid_boot_option(). Fixes: c416f1c0bc ("bootmenu: add removable media entries") Addresses-Coverity: 376207 ("Uninitialized variables") Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
3d595ac5 |
|
09-Nov-2022 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: remove superfluous if in eficonfig_edit_boot_option Goto for an immediately succeeding label is superfluous. Fixes: 87d791423ac6 ("eficonfig: menu-driven addition of UEFI boot option") Addresses-Coverity: 376202 ("Identical code for different branches") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
f19171c9 |
|
08-Jan-2024 |
Ilias Apalodimas <ilias.apalodimas@linaro.org> |
efi_loader: Clean up efi_dp_append and efi_dp_concat Looking back at the initrd storing functionality, we introduced three functions, efi_dp_append_or_concatenate(), efi_dp_append/concat(). In hindsight we could have simplified that by a lot. First of all none of the functions append anything. They all allocate a new device path and concatenate the contents of two device paths in one. A boolean parameter controls the final device path -- if that's true an end node is injected between the two device paths. So let's rewrite this and make it a bit easier to read. Get rid of efi_dp_append(), efi_dp_concat() and rename efi_dp_append_or_concatenate() to efi_dp_concat(). This is far more intuitive and the only adjustment that is needed is an extra boolean argument on all callsites. Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
64658007 |
|
17-Nov-2023 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: eficonfig: create shortened boot options The boot options created by eficonfig should use shortened device-paths to avoid problems if drives are enumerated in a different sequence. Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
9945bc4f |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Fix incorrect return code of boot option update Correct the return code for out-of-memory and no boot option found Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
339b527b |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Move bootorder and bootoption apis to lib Rename and move bootorder and bootoption apis from cmd to lib for re-use between eficonfig and bootmgr Fix 'unexpected indentation' when 'make htmldocs' after functions are moved Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
2c0b0c31 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_SECURE_BOOT This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_SECURE_BOOT defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
83f3d121 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_MM_COMM_TEE This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_MM_COMM_TEE defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
88df3634 |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: CTRL+S to save the boot order 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>
|
#
45f5319f |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
menu: remove CTRL+C to quit On the sandbox called without "--terminal raw" CTRL+C leaves U-Boot, "ESC/CTRL+C to quit" is misleading. Let's remove CTRL+C to quit key handling from bootmenu and eficonfig menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
|
#
8dbd0a0f |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add vertical scroll support The current eficonfig menu does not support vertical scroll, so it can not display the menu entries greater than the console row size. This commit add the vertial scroll support. The console size is retrieved by SIMPLE_TEXT_OUTPUT_PROTOCOL.QueryMode() service, then calculates the row size for menu entry by subtracting menu header and description row size from the console row size. "start" and "end" are added in the efimenu structure. "start" keeps the menu entry index at the top, "end" keeps the bottom menu entry index. item_data_print() menu function only draws the menu entry between "start" and "end". This commit also fixes the issue that "Save" and "Quit" entries can be moved by BKEY_PLUS in change boot order menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
0d590852 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation This commit removes the change boot order specific menu implementation. The change boot order implementation calls eficonfig_process_common() same as other menus. The change boot order menu requires own item_data_print and item_choice implementation, but display_statusline function can be a same function as other menus. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
cd160b27 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor eficonfig_process_common function Current change boot order implementation does not call eficonfig_process_common() and call own menu functions for display_statusline, item_data_print and item_choice. Change boot order functionality should call eficonfig_process_common() to improve maintenanceability. This commit is a preparation to remove the change boot order specific implementation. The menu functions (display_statusline, item_data_print and item_choice) are added as argument of eficonfig_process_common(). The menu description string displayed at the bottom of the menu is also added as argument. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
32bab0ea |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Make use of CLI character processing Avoid duplicating some of the escape-sequence processing here and use the CLI function instead. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
d0ca98db |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Update bootmenu_loop() to return the code Use the return value to save having to pass around a pointer. This also resolves any ambiguity about what *key contains when the function is called. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
2da4a15e |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Rename KEY_... to BKEY_... This enum values conflict with linux/input.h so rename them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
64550274 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: avoid SetVariable between GetNextVariableName calls The current code calls efi_set_variable_int() to delete the invalid boot option between calls to efi_get_next_variable_name_int(), it may produce unpredictable results. This commit moves removal of the invalid boot option outside of the efi_get_next_variable_name_int() calls. EFI_NOT_FOUND returned from efi_get_next_variable_name_int() indicates we retrieved all EFI variables, it should be treated as EFI_SUCEESS. To address the checkpatch warning of too many leading tabs, combine two if statement into one. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
ce327084 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: carve out efi_get_next_variable_name_int calls To retrieve the EFI variable name by efi_get_next_variable_name_int(), the sequence of alloc -> efi_get_next_variable_name_int -> realloc -> efi_get_next_variable_name_int is required. In current code, this sequence repeatedly appears in the several functions. It should be curved out a common function. This commit also fixes the missing free() of var_name16 in eficonfig_delete_invalid_boot_option(). Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
140a8959 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use efi_get_next_variable_name_int() eficonfig command reads all possible UEFI load options from 0x0000 to 0xFFFF to construct the menu. This takes too much time in some environment. This commit uses efi_get_next_variable_name_int() to read all existing UEFI load options to significantlly reduce the count of efi_get_var() call. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
78b1ccc4 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use u16_strsize() to get u16 string buffer size Use u16_strsize() to simplify the u16 string buffer size calculation. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c67d3c9e |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix going one directory up issue The directory name in eficonfig menu entry contains the '\' separator. strcmp() argument ".." is wrong and one directory up handling does not work correctly. strcmp() argument must include '\' separator. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c3b5af63 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add UEFI Secure Boot Key enrollment interface This commit adds the menu-driven UEFI Secure Boot Key enrollment interface. User can enroll PK, KEK, db and dbx by selecting file. Only the signed EFI Signature List(s) with an authenticated header, typically '.auth' file, is accepted. To clear the PK, KEK, db and dbx, user needs to enroll the null key signed by PK or KEK. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
21faf4ef |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use protocol interface for file selection EFI_SIMPLE_FILE_SYSTEM_PROTOCOL is not always provided by U-Boot. Use protocol interface functions instead of U-Boot internal functions. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d6566113 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose eficonfig_create_device_path() Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use eficonfig_create_device_path() to construct the full device path from device path of the volume and file path, so move it out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d571f9b2 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation All the eficonfig menus other than "Change Boot Order" use 'eficonfig_entry' structure for each menu entry. This commit refactors change boot order implementation to use 'eficonfig_entry' structure same as other menus to have consistent menu handling. This commit also simplifies the data->active handling when KEY_SPACE is pressed, and sizeof() parameter. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
8961e93e |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose append entry function Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use append_entry() and append_quit_entry() to construct the menu, so move them out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
a84040ab |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor file selection handling eficonfig_select_file_handler() is commonly used to select the file. eficonfig_display_select_file_option() adds an additional menu to clear the selected file. eficonfig_display_select_file_option() is not always necessary for the file selection process, so it must be outside of eficonfig_select_file_handler(). This commit also renames the following functions to avoid confusion. eficonfig_select_file_handler() -> eficonfig_process_select_file() eficonfig_select_file() -> eficonfig_show_file_selection() eficonfig_display_select_file_option() -> eficonfig_process_show_file_option() Finally, test_eficonfig.py need to be updated to get aligned with the above modification. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
1167e88a |
|
14-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix missing variable initialization The 'ret' variable must be initialized before use in eficonfig_delete_invalid_boot_option(). Fixes: c416f1c0bc ("bootmenu: add removable media entries") Addresses-Coverity: 376207 ("Uninitialized variables") Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
3d595ac5 |
|
09-Nov-2022 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: remove superfluous if in eficonfig_edit_boot_option Goto for an immediately succeeding label is superfluous. Fixes: 87d791423ac6 ("eficonfig: menu-driven addition of UEFI boot option") Addresses-Coverity: 376202 ("Identical code for different branches") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
f19171c9 |
|
08-Jan-2024 |
Ilias Apalodimas <ilias.apalodimas@linaro.org> |
efi_loader: Clean up efi_dp_append and efi_dp_concat Looking back at the initrd storing functionality, we introduced three functions, efi_dp_append_or_concatenate(), efi_dp_append/concat(). In hindsight we could have simplified that by a lot. First of all none of the functions append anything. They all allocate a new device path and concatenate the contents of two device paths in one. A boolean parameter controls the final device path -- if that's true an end node is injected between the two device paths. So let's rewrite this and make it a bit easier to read. Get rid of efi_dp_append(), efi_dp_concat() and rename efi_dp_append_or_concatenate() to efi_dp_concat(). This is far more intuitive and the only adjustment that is needed is an extra boolean argument on all callsites. Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
64658007 |
|
17-Nov-2023 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: eficonfig: create shortened boot options The boot options created by eficonfig should use shortened device-paths to avoid problems if drives are enumerated in a different sequence. Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
9945bc4f |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Fix incorrect return code of boot option update Correct the return code for out-of-memory and no boot option found Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
339b527b |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Move bootorder and bootoption apis to lib Rename and move bootorder and bootoption apis from cmd to lib for re-use between eficonfig and bootmgr Fix 'unexpected indentation' when 'make htmldocs' after functions are moved Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
2c0b0c31 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_SECURE_BOOT This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_SECURE_BOOT defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
83f3d121 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_MM_COMM_TEE This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_MM_COMM_TEE defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
88df3634 |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: CTRL+S to save the boot order 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>
|
#
45f5319f |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
menu: remove CTRL+C to quit On the sandbox called without "--terminal raw" CTRL+C leaves U-Boot, "ESC/CTRL+C to quit" is misleading. Let's remove CTRL+C to quit key handling from bootmenu and eficonfig menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
|
#
8dbd0a0f |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add vertical scroll support The current eficonfig menu does not support vertical scroll, so it can not display the menu entries greater than the console row size. This commit add the vertial scroll support. The console size is retrieved by SIMPLE_TEXT_OUTPUT_PROTOCOL.QueryMode() service, then calculates the row size for menu entry by subtracting menu header and description row size from the console row size. "start" and "end" are added in the efimenu structure. "start" keeps the menu entry index at the top, "end" keeps the bottom menu entry index. item_data_print() menu function only draws the menu entry between "start" and "end". This commit also fixes the issue that "Save" and "Quit" entries can be moved by BKEY_PLUS in change boot order menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
0d590852 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation This commit removes the change boot order specific menu implementation. The change boot order implementation calls eficonfig_process_common() same as other menus. The change boot order menu requires own item_data_print and item_choice implementation, but display_statusline function can be a same function as other menus. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
cd160b27 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor eficonfig_process_common function Current change boot order implementation does not call eficonfig_process_common() and call own menu functions for display_statusline, item_data_print and item_choice. Change boot order functionality should call eficonfig_process_common() to improve maintenanceability. This commit is a preparation to remove the change boot order specific implementation. The menu functions (display_statusline, item_data_print and item_choice) are added as argument of eficonfig_process_common(). The menu description string displayed at the bottom of the menu is also added as argument. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
32bab0ea |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Make use of CLI character processing Avoid duplicating some of the escape-sequence processing here and use the CLI function instead. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
d0ca98db |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Update bootmenu_loop() to return the code Use the return value to save having to pass around a pointer. This also resolves any ambiguity about what *key contains when the function is called. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
2da4a15e |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Rename KEY_... to BKEY_... This enum values conflict with linux/input.h so rename them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
64550274 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: avoid SetVariable between GetNextVariableName calls The current code calls efi_set_variable_int() to delete the invalid boot option between calls to efi_get_next_variable_name_int(), it may produce unpredictable results. This commit moves removal of the invalid boot option outside of the efi_get_next_variable_name_int() calls. EFI_NOT_FOUND returned from efi_get_next_variable_name_int() indicates we retrieved all EFI variables, it should be treated as EFI_SUCEESS. To address the checkpatch warning of too many leading tabs, combine two if statement into one. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
ce327084 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: carve out efi_get_next_variable_name_int calls To retrieve the EFI variable name by efi_get_next_variable_name_int(), the sequence of alloc -> efi_get_next_variable_name_int -> realloc -> efi_get_next_variable_name_int is required. In current code, this sequence repeatedly appears in the several functions. It should be curved out a common function. This commit also fixes the missing free() of var_name16 in eficonfig_delete_invalid_boot_option(). Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
140a8959 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use efi_get_next_variable_name_int() eficonfig command reads all possible UEFI load options from 0x0000 to 0xFFFF to construct the menu. This takes too much time in some environment. This commit uses efi_get_next_variable_name_int() to read all existing UEFI load options to significantlly reduce the count of efi_get_var() call. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
78b1ccc4 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use u16_strsize() to get u16 string buffer size Use u16_strsize() to simplify the u16 string buffer size calculation. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c67d3c9e |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix going one directory up issue The directory name in eficonfig menu entry contains the '\' separator. strcmp() argument ".." is wrong and one directory up handling does not work correctly. strcmp() argument must include '\' separator. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c3b5af63 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add UEFI Secure Boot Key enrollment interface This commit adds the menu-driven UEFI Secure Boot Key enrollment interface. User can enroll PK, KEK, db and dbx by selecting file. Only the signed EFI Signature List(s) with an authenticated header, typically '.auth' file, is accepted. To clear the PK, KEK, db and dbx, user needs to enroll the null key signed by PK or KEK. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
21faf4ef |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use protocol interface for file selection EFI_SIMPLE_FILE_SYSTEM_PROTOCOL is not always provided by U-Boot. Use protocol interface functions instead of U-Boot internal functions. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d6566113 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose eficonfig_create_device_path() Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use eficonfig_create_device_path() to construct the full device path from device path of the volume and file path, so move it out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d571f9b2 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation All the eficonfig menus other than "Change Boot Order" use 'eficonfig_entry' structure for each menu entry. This commit refactors change boot order implementation to use 'eficonfig_entry' structure same as other menus to have consistent menu handling. This commit also simplifies the data->active handling when KEY_SPACE is pressed, and sizeof() parameter. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
8961e93e |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose append entry function Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use append_entry() and append_quit_entry() to construct the menu, so move them out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
a84040ab |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor file selection handling eficonfig_select_file_handler() is commonly used to select the file. eficonfig_display_select_file_option() adds an additional menu to clear the selected file. eficonfig_display_select_file_option() is not always necessary for the file selection process, so it must be outside of eficonfig_select_file_handler(). This commit also renames the following functions to avoid confusion. eficonfig_select_file_handler() -> eficonfig_process_select_file() eficonfig_select_file() -> eficonfig_show_file_selection() eficonfig_display_select_file_option() -> eficonfig_process_show_file_option() Finally, test_eficonfig.py need to be updated to get aligned with the above modification. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
1167e88a |
|
14-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix missing variable initialization The 'ret' variable must be initialized before use in eficonfig_delete_invalid_boot_option(). Fixes: c416f1c0bc ("bootmenu: add removable media entries") Addresses-Coverity: 376207 ("Uninitialized variables") Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
3d595ac5 |
|
09-Nov-2022 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: remove superfluous if in eficonfig_edit_boot_option Goto for an immediately succeeding label is superfluous. Fixes: 87d791423ac6 ("eficonfig: menu-driven addition of UEFI boot option") Addresses-Coverity: 376202 ("Identical code for different branches") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
f19171c9 |
|
08-Jan-2024 |
Ilias Apalodimas <ilias.apalodimas@linaro.org> |
efi_loader: Clean up efi_dp_append and efi_dp_concat Looking back at the initrd storing functionality, we introduced three functions, efi_dp_append_or_concatenate(), efi_dp_append/concat(). In hindsight we could have simplified that by a lot. First of all none of the functions append anything. They all allocate a new device path and concatenate the contents of two device paths in one. A boolean parameter controls the final device path -- if that's true an end node is injected between the two device paths. So let's rewrite this and make it a bit easier to read. Get rid of efi_dp_append(), efi_dp_concat() and rename efi_dp_append_or_concatenate() to efi_dp_concat(). This is far more intuitive and the only adjustment that is needed is an extra boolean argument on all callsites. Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
64658007 |
|
17-Nov-2023 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: eficonfig: create shortened boot options The boot options created by eficonfig should use shortened device-paths to avoid problems if drives are enumerated in a different sequence. Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
9945bc4f |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Fix incorrect return code of boot option update Correct the return code for out-of-memory and no boot option found Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
339b527b |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Move bootorder and bootoption apis to lib Rename and move bootorder and bootoption apis from cmd to lib for re-use between eficonfig and bootmgr Fix 'unexpected indentation' when 'make htmldocs' after functions are moved Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
2c0b0c31 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_SECURE_BOOT This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_SECURE_BOOT defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
83f3d121 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_MM_COMM_TEE This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_MM_COMM_TEE defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
88df3634 |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: CTRL+S to save the boot order 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>
|
#
45f5319f |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
menu: remove CTRL+C to quit On the sandbox called without "--terminal raw" CTRL+C leaves U-Boot, "ESC/CTRL+C to quit" is misleading. Let's remove CTRL+C to quit key handling from bootmenu and eficonfig menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
|
#
8dbd0a0f |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add vertical scroll support The current eficonfig menu does not support vertical scroll, so it can not display the menu entries greater than the console row size. This commit add the vertial scroll support. The console size is retrieved by SIMPLE_TEXT_OUTPUT_PROTOCOL.QueryMode() service, then calculates the row size for menu entry by subtracting menu header and description row size from the console row size. "start" and "end" are added in the efimenu structure. "start" keeps the menu entry index at the top, "end" keeps the bottom menu entry index. item_data_print() menu function only draws the menu entry between "start" and "end". This commit also fixes the issue that "Save" and "Quit" entries can be moved by BKEY_PLUS in change boot order menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
0d590852 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation This commit removes the change boot order specific menu implementation. The change boot order implementation calls eficonfig_process_common() same as other menus. The change boot order menu requires own item_data_print and item_choice implementation, but display_statusline function can be a same function as other menus. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
cd160b27 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor eficonfig_process_common function Current change boot order implementation does not call eficonfig_process_common() and call own menu functions for display_statusline, item_data_print and item_choice. Change boot order functionality should call eficonfig_process_common() to improve maintenanceability. This commit is a preparation to remove the change boot order specific implementation. The menu functions (display_statusline, item_data_print and item_choice) are added as argument of eficonfig_process_common(). The menu description string displayed at the bottom of the menu is also added as argument. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
32bab0ea |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Make use of CLI character processing Avoid duplicating some of the escape-sequence processing here and use the CLI function instead. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
d0ca98db |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Update bootmenu_loop() to return the code Use the return value to save having to pass around a pointer. This also resolves any ambiguity about what *key contains when the function is called. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
2da4a15e |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Rename KEY_... to BKEY_... This enum values conflict with linux/input.h so rename them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
64550274 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: avoid SetVariable between GetNextVariableName calls The current code calls efi_set_variable_int() to delete the invalid boot option between calls to efi_get_next_variable_name_int(), it may produce unpredictable results. This commit moves removal of the invalid boot option outside of the efi_get_next_variable_name_int() calls. EFI_NOT_FOUND returned from efi_get_next_variable_name_int() indicates we retrieved all EFI variables, it should be treated as EFI_SUCEESS. To address the checkpatch warning of too many leading tabs, combine two if statement into one. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
ce327084 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: carve out efi_get_next_variable_name_int calls To retrieve the EFI variable name by efi_get_next_variable_name_int(), the sequence of alloc -> efi_get_next_variable_name_int -> realloc -> efi_get_next_variable_name_int is required. In current code, this sequence repeatedly appears in the several functions. It should be curved out a common function. This commit also fixes the missing free() of var_name16 in eficonfig_delete_invalid_boot_option(). Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
140a8959 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use efi_get_next_variable_name_int() eficonfig command reads all possible UEFI load options from 0x0000 to 0xFFFF to construct the menu. This takes too much time in some environment. This commit uses efi_get_next_variable_name_int() to read all existing UEFI load options to significantlly reduce the count of efi_get_var() call. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
78b1ccc4 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use u16_strsize() to get u16 string buffer size Use u16_strsize() to simplify the u16 string buffer size calculation. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c67d3c9e |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix going one directory up issue The directory name in eficonfig menu entry contains the '\' separator. strcmp() argument ".." is wrong and one directory up handling does not work correctly. strcmp() argument must include '\' separator. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c3b5af63 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add UEFI Secure Boot Key enrollment interface This commit adds the menu-driven UEFI Secure Boot Key enrollment interface. User can enroll PK, KEK, db and dbx by selecting file. Only the signed EFI Signature List(s) with an authenticated header, typically '.auth' file, is accepted. To clear the PK, KEK, db and dbx, user needs to enroll the null key signed by PK or KEK. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
21faf4ef |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use protocol interface for file selection EFI_SIMPLE_FILE_SYSTEM_PROTOCOL is not always provided by U-Boot. Use protocol interface functions instead of U-Boot internal functions. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d6566113 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose eficonfig_create_device_path() Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use eficonfig_create_device_path() to construct the full device path from device path of the volume and file path, so move it out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d571f9b2 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation All the eficonfig menus other than "Change Boot Order" use 'eficonfig_entry' structure for each menu entry. This commit refactors change boot order implementation to use 'eficonfig_entry' structure same as other menus to have consistent menu handling. This commit also simplifies the data->active handling when KEY_SPACE is pressed, and sizeof() parameter. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
8961e93e |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose append entry function Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use append_entry() and append_quit_entry() to construct the menu, so move them out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
a84040ab |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor file selection handling eficonfig_select_file_handler() is commonly used to select the file. eficonfig_display_select_file_option() adds an additional menu to clear the selected file. eficonfig_display_select_file_option() is not always necessary for the file selection process, so it must be outside of eficonfig_select_file_handler(). This commit also renames the following functions to avoid confusion. eficonfig_select_file_handler() -> eficonfig_process_select_file() eficonfig_select_file() -> eficonfig_show_file_selection() eficonfig_display_select_file_option() -> eficonfig_process_show_file_option() Finally, test_eficonfig.py need to be updated to get aligned with the above modification. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
1167e88a |
|
14-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix missing variable initialization The 'ret' variable must be initialized before use in eficonfig_delete_invalid_boot_option(). Fixes: c416f1c0bc ("bootmenu: add removable media entries") Addresses-Coverity: 376207 ("Uninitialized variables") Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
3d595ac5 |
|
09-Nov-2022 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: remove superfluous if in eficonfig_edit_boot_option Goto for an immediately succeeding label is superfluous. Fixes: 87d791423ac6 ("eficonfig: menu-driven addition of UEFI boot option") Addresses-Coverity: 376202 ("Identical code for different branches") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
f19171c9 |
|
08-Jan-2024 |
Ilias Apalodimas <ilias.apalodimas@linaro.org> |
efi_loader: Clean up efi_dp_append and efi_dp_concat Looking back at the initrd storing functionality, we introduced three functions, efi_dp_append_or_concatenate(), efi_dp_append/concat(). In hindsight we could have simplified that by a lot. First of all none of the functions append anything. They all allocate a new device path and concatenate the contents of two device paths in one. A boolean parameter controls the final device path -- if that's true an end node is injected between the two device paths. So let's rewrite this and make it a bit easier to read. Get rid of efi_dp_append(), efi_dp_concat() and rename efi_dp_append_or_concatenate() to efi_dp_concat(). This is far more intuitive and the only adjustment that is needed is an extra boolean argument on all callsites. Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
64658007 |
|
17-Nov-2023 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: eficonfig: create shortened boot options The boot options created by eficonfig should use shortened device-paths to avoid problems if drives are enumerated in a different sequence. Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
9945bc4f |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Fix incorrect return code of boot option update Correct the return code for out-of-memory and no boot option found Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
339b527b |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Move bootorder and bootoption apis to lib Rename and move bootorder and bootoption apis from cmd to lib for re-use between eficonfig and bootmgr Fix 'unexpected indentation' when 'make htmldocs' after functions are moved Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
2c0b0c31 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_SECURE_BOOT This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_SECURE_BOOT defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
83f3d121 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_MM_COMM_TEE This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_MM_COMM_TEE defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
88df3634 |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: CTRL+S to save the boot order 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>
|
#
45f5319f |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
menu: remove CTRL+C to quit On the sandbox called without "--terminal raw" CTRL+C leaves U-Boot, "ESC/CTRL+C to quit" is misleading. Let's remove CTRL+C to quit key handling from bootmenu and eficonfig menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
|
#
8dbd0a0f |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add vertical scroll support The current eficonfig menu does not support vertical scroll, so it can not display the menu entries greater than the console row size. This commit add the vertial scroll support. The console size is retrieved by SIMPLE_TEXT_OUTPUT_PROTOCOL.QueryMode() service, then calculates the row size for menu entry by subtracting menu header and description row size from the console row size. "start" and "end" are added in the efimenu structure. "start" keeps the menu entry index at the top, "end" keeps the bottom menu entry index. item_data_print() menu function only draws the menu entry between "start" and "end". This commit also fixes the issue that "Save" and "Quit" entries can be moved by BKEY_PLUS in change boot order menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
0d590852 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation This commit removes the change boot order specific menu implementation. The change boot order implementation calls eficonfig_process_common() same as other menus. The change boot order menu requires own item_data_print and item_choice implementation, but display_statusline function can be a same function as other menus. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
cd160b27 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor eficonfig_process_common function Current change boot order implementation does not call eficonfig_process_common() and call own menu functions for display_statusline, item_data_print and item_choice. Change boot order functionality should call eficonfig_process_common() to improve maintenanceability. This commit is a preparation to remove the change boot order specific implementation. The menu functions (display_statusline, item_data_print and item_choice) are added as argument of eficonfig_process_common(). The menu description string displayed at the bottom of the menu is also added as argument. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
32bab0ea |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Make use of CLI character processing Avoid duplicating some of the escape-sequence processing here and use the CLI function instead. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
d0ca98db |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Update bootmenu_loop() to return the code Use the return value to save having to pass around a pointer. This also resolves any ambiguity about what *key contains when the function is called. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
2da4a15e |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Rename KEY_... to BKEY_... This enum values conflict with linux/input.h so rename them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
64550274 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: avoid SetVariable between GetNextVariableName calls The current code calls efi_set_variable_int() to delete the invalid boot option between calls to efi_get_next_variable_name_int(), it may produce unpredictable results. This commit moves removal of the invalid boot option outside of the efi_get_next_variable_name_int() calls. EFI_NOT_FOUND returned from efi_get_next_variable_name_int() indicates we retrieved all EFI variables, it should be treated as EFI_SUCEESS. To address the checkpatch warning of too many leading tabs, combine two if statement into one. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
ce327084 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: carve out efi_get_next_variable_name_int calls To retrieve the EFI variable name by efi_get_next_variable_name_int(), the sequence of alloc -> efi_get_next_variable_name_int -> realloc -> efi_get_next_variable_name_int is required. In current code, this sequence repeatedly appears in the several functions. It should be curved out a common function. This commit also fixes the missing free() of var_name16 in eficonfig_delete_invalid_boot_option(). Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
140a8959 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use efi_get_next_variable_name_int() eficonfig command reads all possible UEFI load options from 0x0000 to 0xFFFF to construct the menu. This takes too much time in some environment. This commit uses efi_get_next_variable_name_int() to read all existing UEFI load options to significantlly reduce the count of efi_get_var() call. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
78b1ccc4 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use u16_strsize() to get u16 string buffer size Use u16_strsize() to simplify the u16 string buffer size calculation. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c67d3c9e |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix going one directory up issue The directory name in eficonfig menu entry contains the '\' separator. strcmp() argument ".." is wrong and one directory up handling does not work correctly. strcmp() argument must include '\' separator. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c3b5af63 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add UEFI Secure Boot Key enrollment interface This commit adds the menu-driven UEFI Secure Boot Key enrollment interface. User can enroll PK, KEK, db and dbx by selecting file. Only the signed EFI Signature List(s) with an authenticated header, typically '.auth' file, is accepted. To clear the PK, KEK, db and dbx, user needs to enroll the null key signed by PK or KEK. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
21faf4ef |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use protocol interface for file selection EFI_SIMPLE_FILE_SYSTEM_PROTOCOL is not always provided by U-Boot. Use protocol interface functions instead of U-Boot internal functions. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d6566113 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose eficonfig_create_device_path() Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use eficonfig_create_device_path() to construct the full device path from device path of the volume and file path, so move it out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d571f9b2 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation All the eficonfig menus other than "Change Boot Order" use 'eficonfig_entry' structure for each menu entry. This commit refactors change boot order implementation to use 'eficonfig_entry' structure same as other menus to have consistent menu handling. This commit also simplifies the data->active handling when KEY_SPACE is pressed, and sizeof() parameter. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
8961e93e |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose append entry function Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use append_entry() and append_quit_entry() to construct the menu, so move them out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
a84040ab |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor file selection handling eficonfig_select_file_handler() is commonly used to select the file. eficonfig_display_select_file_option() adds an additional menu to clear the selected file. eficonfig_display_select_file_option() is not always necessary for the file selection process, so it must be outside of eficonfig_select_file_handler(). This commit also renames the following functions to avoid confusion. eficonfig_select_file_handler() -> eficonfig_process_select_file() eficonfig_select_file() -> eficonfig_show_file_selection() eficonfig_display_select_file_option() -> eficonfig_process_show_file_option() Finally, test_eficonfig.py need to be updated to get aligned with the above modification. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
1167e88a |
|
14-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix missing variable initialization The 'ret' variable must be initialized before use in eficonfig_delete_invalid_boot_option(). Fixes: c416f1c0bc ("bootmenu: add removable media entries") Addresses-Coverity: 376207 ("Uninitialized variables") Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
3d595ac5 |
|
09-Nov-2022 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: remove superfluous if in eficonfig_edit_boot_option Goto for an immediately succeeding label is superfluous. Fixes: 87d791423ac6 ("eficonfig: menu-driven addition of UEFI boot option") Addresses-Coverity: 376202 ("Identical code for different branches") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
f19171c9 |
|
08-Jan-2024 |
Ilias Apalodimas <ilias.apalodimas@linaro.org> |
efi_loader: Clean up efi_dp_append and efi_dp_concat Looking back at the initrd storing functionality, we introduced three functions, efi_dp_append_or_concatenate(), efi_dp_append/concat(). In hindsight we could have simplified that by a lot. First of all none of the functions append anything. They all allocate a new device path and concatenate the contents of two device paths in one. A boolean parameter controls the final device path -- if that's true an end node is injected between the two device paths. So let's rewrite this and make it a bit easier to read. Get rid of efi_dp_append(), efi_dp_concat() and rename efi_dp_append_or_concatenate() to efi_dp_concat(). This is far more intuitive and the only adjustment that is needed is an extra boolean argument on all callsites. Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
64658007 |
|
17-Nov-2023 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: eficonfig: create shortened boot options The boot options created by eficonfig should use shortened device-paths to avoid problems if drives are enumerated in a different sequence. Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
9945bc4f |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Fix incorrect return code of boot option update Correct the return code for out-of-memory and no boot option found Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
339b527b |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Move bootorder and bootoption apis to lib Rename and move bootorder and bootoption apis from cmd to lib for re-use between eficonfig and bootmgr Fix 'unexpected indentation' when 'make htmldocs' after functions are moved Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
2c0b0c31 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_SECURE_BOOT This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_SECURE_BOOT defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
83f3d121 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_MM_COMM_TEE This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_MM_COMM_TEE defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
88df3634 |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: CTRL+S to save the boot order 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>
|
#
45f5319f |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
menu: remove CTRL+C to quit On the sandbox called without "--terminal raw" CTRL+C leaves U-Boot, "ESC/CTRL+C to quit" is misleading. Let's remove CTRL+C to quit key handling from bootmenu and eficonfig menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
|
#
8dbd0a0f |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add vertical scroll support The current eficonfig menu does not support vertical scroll, so it can not display the menu entries greater than the console row size. This commit add the vertial scroll support. The console size is retrieved by SIMPLE_TEXT_OUTPUT_PROTOCOL.QueryMode() service, then calculates the row size for menu entry by subtracting menu header and description row size from the console row size. "start" and "end" are added in the efimenu structure. "start" keeps the menu entry index at the top, "end" keeps the bottom menu entry index. item_data_print() menu function only draws the menu entry between "start" and "end". This commit also fixes the issue that "Save" and "Quit" entries can be moved by BKEY_PLUS in change boot order menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
0d590852 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation This commit removes the change boot order specific menu implementation. The change boot order implementation calls eficonfig_process_common() same as other menus. The change boot order menu requires own item_data_print and item_choice implementation, but display_statusline function can be a same function as other menus. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
cd160b27 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor eficonfig_process_common function Current change boot order implementation does not call eficonfig_process_common() and call own menu functions for display_statusline, item_data_print and item_choice. Change boot order functionality should call eficonfig_process_common() to improve maintenanceability. This commit is a preparation to remove the change boot order specific implementation. The menu functions (display_statusline, item_data_print and item_choice) are added as argument of eficonfig_process_common(). The menu description string displayed at the bottom of the menu is also added as argument. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
32bab0ea |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Make use of CLI character processing Avoid duplicating some of the escape-sequence processing here and use the CLI function instead. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
d0ca98db |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Update bootmenu_loop() to return the code Use the return value to save having to pass around a pointer. This also resolves any ambiguity about what *key contains when the function is called. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
2da4a15e |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Rename KEY_... to BKEY_... This enum values conflict with linux/input.h so rename them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
64550274 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: avoid SetVariable between GetNextVariableName calls The current code calls efi_set_variable_int() to delete the invalid boot option between calls to efi_get_next_variable_name_int(), it may produce unpredictable results. This commit moves removal of the invalid boot option outside of the efi_get_next_variable_name_int() calls. EFI_NOT_FOUND returned from efi_get_next_variable_name_int() indicates we retrieved all EFI variables, it should be treated as EFI_SUCEESS. To address the checkpatch warning of too many leading tabs, combine two if statement into one. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
ce327084 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: carve out efi_get_next_variable_name_int calls To retrieve the EFI variable name by efi_get_next_variable_name_int(), the sequence of alloc -> efi_get_next_variable_name_int -> realloc -> efi_get_next_variable_name_int is required. In current code, this sequence repeatedly appears in the several functions. It should be curved out a common function. This commit also fixes the missing free() of var_name16 in eficonfig_delete_invalid_boot_option(). Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
140a8959 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use efi_get_next_variable_name_int() eficonfig command reads all possible UEFI load options from 0x0000 to 0xFFFF to construct the menu. This takes too much time in some environment. This commit uses efi_get_next_variable_name_int() to read all existing UEFI load options to significantlly reduce the count of efi_get_var() call. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
78b1ccc4 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use u16_strsize() to get u16 string buffer size Use u16_strsize() to simplify the u16 string buffer size calculation. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c67d3c9e |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix going one directory up issue The directory name in eficonfig menu entry contains the '\' separator. strcmp() argument ".." is wrong and one directory up handling does not work correctly. strcmp() argument must include '\' separator. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c3b5af63 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add UEFI Secure Boot Key enrollment interface This commit adds the menu-driven UEFI Secure Boot Key enrollment interface. User can enroll PK, KEK, db and dbx by selecting file. Only the signed EFI Signature List(s) with an authenticated header, typically '.auth' file, is accepted. To clear the PK, KEK, db and dbx, user needs to enroll the null key signed by PK or KEK. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
21faf4ef |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use protocol interface for file selection EFI_SIMPLE_FILE_SYSTEM_PROTOCOL is not always provided by U-Boot. Use protocol interface functions instead of U-Boot internal functions. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d6566113 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose eficonfig_create_device_path() Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use eficonfig_create_device_path() to construct the full device path from device path of the volume and file path, so move it out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d571f9b2 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation All the eficonfig menus other than "Change Boot Order" use 'eficonfig_entry' structure for each menu entry. This commit refactors change boot order implementation to use 'eficonfig_entry' structure same as other menus to have consistent menu handling. This commit also simplifies the data->active handling when KEY_SPACE is pressed, and sizeof() parameter. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
8961e93e |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose append entry function Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use append_entry() and append_quit_entry() to construct the menu, so move them out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
a84040ab |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor file selection handling eficonfig_select_file_handler() is commonly used to select the file. eficonfig_display_select_file_option() adds an additional menu to clear the selected file. eficonfig_display_select_file_option() is not always necessary for the file selection process, so it must be outside of eficonfig_select_file_handler(). This commit also renames the following functions to avoid confusion. eficonfig_select_file_handler() -> eficonfig_process_select_file() eficonfig_select_file() -> eficonfig_show_file_selection() eficonfig_display_select_file_option() -> eficonfig_process_show_file_option() Finally, test_eficonfig.py need to be updated to get aligned with the above modification. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
1167e88a |
|
14-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix missing variable initialization The 'ret' variable must be initialized before use in eficonfig_delete_invalid_boot_option(). Fixes: c416f1c0bc ("bootmenu: add removable media entries") Addresses-Coverity: 376207 ("Uninitialized variables") Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
3d595ac5 |
|
09-Nov-2022 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: remove superfluous if in eficonfig_edit_boot_option Goto for an immediately succeeding label is superfluous. Fixes: 87d791423ac6 ("eficonfig: menu-driven addition of UEFI boot option") Addresses-Coverity: 376202 ("Identical code for different branches") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
f19171c9 |
|
08-Jan-2024 |
Ilias Apalodimas <ilias.apalodimas@linaro.org> |
efi_loader: Clean up efi_dp_append and efi_dp_concat Looking back at the initrd storing functionality, we introduced three functions, efi_dp_append_or_concatenate(), efi_dp_append/concat(). In hindsight we could have simplified that by a lot. First of all none of the functions append anything. They all allocate a new device path and concatenate the contents of two device paths in one. A boolean parameter controls the final device path -- if that's true an end node is injected between the two device paths. So let's rewrite this and make it a bit easier to read. Get rid of efi_dp_append(), efi_dp_concat() and rename efi_dp_append_or_concatenate() to efi_dp_concat(). This is far more intuitive and the only adjustment that is needed is an extra boolean argument on all callsites. Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
64658007 |
|
17-Nov-2023 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: eficonfig: create shortened boot options The boot options created by eficonfig should use shortened device-paths to avoid problems if drives are enumerated in a different sequence. Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
9945bc4f |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Fix incorrect return code of boot option update Correct the return code for out-of-memory and no boot option found Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
339b527b |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Move bootorder and bootoption apis to lib Rename and move bootorder and bootoption apis from cmd to lib for re-use between eficonfig and bootmgr Fix 'unexpected indentation' when 'make htmldocs' after functions are moved Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
2c0b0c31 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_SECURE_BOOT This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_SECURE_BOOT defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
83f3d121 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_MM_COMM_TEE This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_MM_COMM_TEE defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
88df3634 |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: CTRL+S to save the boot order 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>
|
#
45f5319f |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
menu: remove CTRL+C to quit On the sandbox called without "--terminal raw" CTRL+C leaves U-Boot, "ESC/CTRL+C to quit" is misleading. Let's remove CTRL+C to quit key handling from bootmenu and eficonfig menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
|
#
8dbd0a0f |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add vertical scroll support The current eficonfig menu does not support vertical scroll, so it can not display the menu entries greater than the console row size. This commit add the vertial scroll support. The console size is retrieved by SIMPLE_TEXT_OUTPUT_PROTOCOL.QueryMode() service, then calculates the row size for menu entry by subtracting menu header and description row size from the console row size. "start" and "end" are added in the efimenu structure. "start" keeps the menu entry index at the top, "end" keeps the bottom menu entry index. item_data_print() menu function only draws the menu entry between "start" and "end". This commit also fixes the issue that "Save" and "Quit" entries can be moved by BKEY_PLUS in change boot order menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
0d590852 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation This commit removes the change boot order specific menu implementation. The change boot order implementation calls eficonfig_process_common() same as other menus. The change boot order menu requires own item_data_print and item_choice implementation, but display_statusline function can be a same function as other menus. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
cd160b27 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor eficonfig_process_common function Current change boot order implementation does not call eficonfig_process_common() and call own menu functions for display_statusline, item_data_print and item_choice. Change boot order functionality should call eficonfig_process_common() to improve maintenanceability. This commit is a preparation to remove the change boot order specific implementation. The menu functions (display_statusline, item_data_print and item_choice) are added as argument of eficonfig_process_common(). The menu description string displayed at the bottom of the menu is also added as argument. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
32bab0ea |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Make use of CLI character processing Avoid duplicating some of the escape-sequence processing here and use the CLI function instead. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
d0ca98db |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Update bootmenu_loop() to return the code Use the return value to save having to pass around a pointer. This also resolves any ambiguity about what *key contains when the function is called. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
2da4a15e |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Rename KEY_... to BKEY_... This enum values conflict with linux/input.h so rename them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
64550274 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: avoid SetVariable between GetNextVariableName calls The current code calls efi_set_variable_int() to delete the invalid boot option between calls to efi_get_next_variable_name_int(), it may produce unpredictable results. This commit moves removal of the invalid boot option outside of the efi_get_next_variable_name_int() calls. EFI_NOT_FOUND returned from efi_get_next_variable_name_int() indicates we retrieved all EFI variables, it should be treated as EFI_SUCEESS. To address the checkpatch warning of too many leading tabs, combine two if statement into one. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
ce327084 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: carve out efi_get_next_variable_name_int calls To retrieve the EFI variable name by efi_get_next_variable_name_int(), the sequence of alloc -> efi_get_next_variable_name_int -> realloc -> efi_get_next_variable_name_int is required. In current code, this sequence repeatedly appears in the several functions. It should be curved out a common function. This commit also fixes the missing free() of var_name16 in eficonfig_delete_invalid_boot_option(). Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
140a8959 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use efi_get_next_variable_name_int() eficonfig command reads all possible UEFI load options from 0x0000 to 0xFFFF to construct the menu. This takes too much time in some environment. This commit uses efi_get_next_variable_name_int() to read all existing UEFI load options to significantlly reduce the count of efi_get_var() call. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
78b1ccc4 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use u16_strsize() to get u16 string buffer size Use u16_strsize() to simplify the u16 string buffer size calculation. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c67d3c9e |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix going one directory up issue The directory name in eficonfig menu entry contains the '\' separator. strcmp() argument ".." is wrong and one directory up handling does not work correctly. strcmp() argument must include '\' separator. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c3b5af63 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add UEFI Secure Boot Key enrollment interface This commit adds the menu-driven UEFI Secure Boot Key enrollment interface. User can enroll PK, KEK, db and dbx by selecting file. Only the signed EFI Signature List(s) with an authenticated header, typically '.auth' file, is accepted. To clear the PK, KEK, db and dbx, user needs to enroll the null key signed by PK or KEK. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
21faf4ef |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use protocol interface for file selection EFI_SIMPLE_FILE_SYSTEM_PROTOCOL is not always provided by U-Boot. Use protocol interface functions instead of U-Boot internal functions. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d6566113 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose eficonfig_create_device_path() Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use eficonfig_create_device_path() to construct the full device path from device path of the volume and file path, so move it out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d571f9b2 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation All the eficonfig menus other than "Change Boot Order" use 'eficonfig_entry' structure for each menu entry. This commit refactors change boot order implementation to use 'eficonfig_entry' structure same as other menus to have consistent menu handling. This commit also simplifies the data->active handling when KEY_SPACE is pressed, and sizeof() parameter. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
8961e93e |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose append entry function Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use append_entry() and append_quit_entry() to construct the menu, so move them out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
a84040ab |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor file selection handling eficonfig_select_file_handler() is commonly used to select the file. eficonfig_display_select_file_option() adds an additional menu to clear the selected file. eficonfig_display_select_file_option() is not always necessary for the file selection process, so it must be outside of eficonfig_select_file_handler(). This commit also renames the following functions to avoid confusion. eficonfig_select_file_handler() -> eficonfig_process_select_file() eficonfig_select_file() -> eficonfig_show_file_selection() eficonfig_display_select_file_option() -> eficonfig_process_show_file_option() Finally, test_eficonfig.py need to be updated to get aligned with the above modification. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
1167e88a |
|
14-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix missing variable initialization The 'ret' variable must be initialized before use in eficonfig_delete_invalid_boot_option(). Fixes: c416f1c0bc ("bootmenu: add removable media entries") Addresses-Coverity: 376207 ("Uninitialized variables") Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
3d595ac5 |
|
09-Nov-2022 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: remove superfluous if in eficonfig_edit_boot_option Goto for an immediately succeeding label is superfluous. Fixes: 87d791423ac6 ("eficonfig: menu-driven addition of UEFI boot option") Addresses-Coverity: 376202 ("Identical code for different branches") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
f19171c9 |
|
08-Jan-2024 |
Ilias Apalodimas <ilias.apalodimas@linaro.org> |
efi_loader: Clean up efi_dp_append and efi_dp_concat Looking back at the initrd storing functionality, we introduced three functions, efi_dp_append_or_concatenate(), efi_dp_append/concat(). In hindsight we could have simplified that by a lot. First of all none of the functions append anything. They all allocate a new device path and concatenate the contents of two device paths in one. A boolean parameter controls the final device path -- if that's true an end node is injected between the two device paths. So let's rewrite this and make it a bit easier to read. Get rid of efi_dp_append(), efi_dp_concat() and rename efi_dp_append_or_concatenate() to efi_dp_concat(). This is far more intuitive and the only adjustment that is needed is an extra boolean argument on all callsites. Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
64658007 |
|
17-Nov-2023 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: eficonfig: create shortened boot options The boot options created by eficonfig should use shortened device-paths to avoid problems if drives are enumerated in a different sequence. Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
9945bc4f |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Fix incorrect return code of boot option update Correct the return code for out-of-memory and no boot option found Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
339b527b |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Move bootorder and bootoption apis to lib Rename and move bootorder and bootoption apis from cmd to lib for re-use between eficonfig and bootmgr Fix 'unexpected indentation' when 'make htmldocs' after functions are moved Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
2c0b0c31 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_SECURE_BOOT This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_SECURE_BOOT defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
83f3d121 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_MM_COMM_TEE This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_MM_COMM_TEE defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
88df3634 |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: CTRL+S to save the boot order 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>
|
#
45f5319f |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
menu: remove CTRL+C to quit On the sandbox called without "--terminal raw" CTRL+C leaves U-Boot, "ESC/CTRL+C to quit" is misleading. Let's remove CTRL+C to quit key handling from bootmenu and eficonfig menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
|
#
8dbd0a0f |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add vertical scroll support The current eficonfig menu does not support vertical scroll, so it can not display the menu entries greater than the console row size. This commit add the vertial scroll support. The console size is retrieved by SIMPLE_TEXT_OUTPUT_PROTOCOL.QueryMode() service, then calculates the row size for menu entry by subtracting menu header and description row size from the console row size. "start" and "end" are added in the efimenu structure. "start" keeps the menu entry index at the top, "end" keeps the bottom menu entry index. item_data_print() menu function only draws the menu entry between "start" and "end". This commit also fixes the issue that "Save" and "Quit" entries can be moved by BKEY_PLUS in change boot order menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
0d590852 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation This commit removes the change boot order specific menu implementation. The change boot order implementation calls eficonfig_process_common() same as other menus. The change boot order menu requires own item_data_print and item_choice implementation, but display_statusline function can be a same function as other menus. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
cd160b27 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor eficonfig_process_common function Current change boot order implementation does not call eficonfig_process_common() and call own menu functions for display_statusline, item_data_print and item_choice. Change boot order functionality should call eficonfig_process_common() to improve maintenanceability. This commit is a preparation to remove the change boot order specific implementation. The menu functions (display_statusline, item_data_print and item_choice) are added as argument of eficonfig_process_common(). The menu description string displayed at the bottom of the menu is also added as argument. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
32bab0ea |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Make use of CLI character processing Avoid duplicating some of the escape-sequence processing here and use the CLI function instead. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
d0ca98db |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Update bootmenu_loop() to return the code Use the return value to save having to pass around a pointer. This also resolves any ambiguity about what *key contains when the function is called. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
2da4a15e |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Rename KEY_... to BKEY_... This enum values conflict with linux/input.h so rename them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
64550274 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: avoid SetVariable between GetNextVariableName calls The current code calls efi_set_variable_int() to delete the invalid boot option between calls to efi_get_next_variable_name_int(), it may produce unpredictable results. This commit moves removal of the invalid boot option outside of the efi_get_next_variable_name_int() calls. EFI_NOT_FOUND returned from efi_get_next_variable_name_int() indicates we retrieved all EFI variables, it should be treated as EFI_SUCEESS. To address the checkpatch warning of too many leading tabs, combine two if statement into one. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
ce327084 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: carve out efi_get_next_variable_name_int calls To retrieve the EFI variable name by efi_get_next_variable_name_int(), the sequence of alloc -> efi_get_next_variable_name_int -> realloc -> efi_get_next_variable_name_int is required. In current code, this sequence repeatedly appears in the several functions. It should be curved out a common function. This commit also fixes the missing free() of var_name16 in eficonfig_delete_invalid_boot_option(). Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
140a8959 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use efi_get_next_variable_name_int() eficonfig command reads all possible UEFI load options from 0x0000 to 0xFFFF to construct the menu. This takes too much time in some environment. This commit uses efi_get_next_variable_name_int() to read all existing UEFI load options to significantlly reduce the count of efi_get_var() call. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
78b1ccc4 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use u16_strsize() to get u16 string buffer size Use u16_strsize() to simplify the u16 string buffer size calculation. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c67d3c9e |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix going one directory up issue The directory name in eficonfig menu entry contains the '\' separator. strcmp() argument ".." is wrong and one directory up handling does not work correctly. strcmp() argument must include '\' separator. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c3b5af63 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add UEFI Secure Boot Key enrollment interface This commit adds the menu-driven UEFI Secure Boot Key enrollment interface. User can enroll PK, KEK, db and dbx by selecting file. Only the signed EFI Signature List(s) with an authenticated header, typically '.auth' file, is accepted. To clear the PK, KEK, db and dbx, user needs to enroll the null key signed by PK or KEK. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
21faf4ef |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use protocol interface for file selection EFI_SIMPLE_FILE_SYSTEM_PROTOCOL is not always provided by U-Boot. Use protocol interface functions instead of U-Boot internal functions. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d6566113 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose eficonfig_create_device_path() Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use eficonfig_create_device_path() to construct the full device path from device path of the volume and file path, so move it out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d571f9b2 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation All the eficonfig menus other than "Change Boot Order" use 'eficonfig_entry' structure for each menu entry. This commit refactors change boot order implementation to use 'eficonfig_entry' structure same as other menus to have consistent menu handling. This commit also simplifies the data->active handling when KEY_SPACE is pressed, and sizeof() parameter. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
8961e93e |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose append entry function Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use append_entry() and append_quit_entry() to construct the menu, so move them out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
a84040ab |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor file selection handling eficonfig_select_file_handler() is commonly used to select the file. eficonfig_display_select_file_option() adds an additional menu to clear the selected file. eficonfig_display_select_file_option() is not always necessary for the file selection process, so it must be outside of eficonfig_select_file_handler(). This commit also renames the following functions to avoid confusion. eficonfig_select_file_handler() -> eficonfig_process_select_file() eficonfig_select_file() -> eficonfig_show_file_selection() eficonfig_display_select_file_option() -> eficonfig_process_show_file_option() Finally, test_eficonfig.py need to be updated to get aligned with the above modification. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
1167e88a |
|
14-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix missing variable initialization The 'ret' variable must be initialized before use in eficonfig_delete_invalid_boot_option(). Fixes: c416f1c0bc ("bootmenu: add removable media entries") Addresses-Coverity: 376207 ("Uninitialized variables") Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
3d595ac5 |
|
09-Nov-2022 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: remove superfluous if in eficonfig_edit_boot_option Goto for an immediately succeeding label is superfluous. Fixes: 87d791423ac6 ("eficonfig: menu-driven addition of UEFI boot option") Addresses-Coverity: 376202 ("Identical code for different branches") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
f19171c9 |
|
08-Jan-2024 |
Ilias Apalodimas <ilias.apalodimas@linaro.org> |
efi_loader: Clean up efi_dp_append and efi_dp_concat Looking back at the initrd storing functionality, we introduced three functions, efi_dp_append_or_concatenate(), efi_dp_append/concat(). In hindsight we could have simplified that by a lot. First of all none of the functions append anything. They all allocate a new device path and concatenate the contents of two device paths in one. A boolean parameter controls the final device path -- if that's true an end node is injected between the two device paths. So let's rewrite this and make it a bit easier to read. Get rid of efi_dp_append(), efi_dp_concat() and rename efi_dp_append_or_concatenate() to efi_dp_concat(). This is far more intuitive and the only adjustment that is needed is an extra boolean argument on all callsites. Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
64658007 |
|
17-Nov-2023 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: eficonfig: create shortened boot options The boot options created by eficonfig should use shortened device-paths to avoid problems if drives are enumerated in a different sequence. Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
9945bc4f |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Fix incorrect return code of boot option update Correct the return code for out-of-memory and no boot option found Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
339b527b |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Move bootorder and bootoption apis to lib Rename and move bootorder and bootoption apis from cmd to lib for re-use between eficonfig and bootmgr Fix 'unexpected indentation' when 'make htmldocs' after functions are moved Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
2c0b0c31 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_SECURE_BOOT This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_SECURE_BOOT defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
83f3d121 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_MM_COMM_TEE This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_MM_COMM_TEE defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
88df3634 |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: CTRL+S to save the boot order 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>
|
#
45f5319f |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
menu: remove CTRL+C to quit On the sandbox called without "--terminal raw" CTRL+C leaves U-Boot, "ESC/CTRL+C to quit" is misleading. Let's remove CTRL+C to quit key handling from bootmenu and eficonfig menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
|
#
8dbd0a0f |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add vertical scroll support The current eficonfig menu does not support vertical scroll, so it can not display the menu entries greater than the console row size. This commit add the vertial scroll support. The console size is retrieved by SIMPLE_TEXT_OUTPUT_PROTOCOL.QueryMode() service, then calculates the row size for menu entry by subtracting menu header and description row size from the console row size. "start" and "end" are added in the efimenu structure. "start" keeps the menu entry index at the top, "end" keeps the bottom menu entry index. item_data_print() menu function only draws the menu entry between "start" and "end". This commit also fixes the issue that "Save" and "Quit" entries can be moved by BKEY_PLUS in change boot order menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
0d590852 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation This commit removes the change boot order specific menu implementation. The change boot order implementation calls eficonfig_process_common() same as other menus. The change boot order menu requires own item_data_print and item_choice implementation, but display_statusline function can be a same function as other menus. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
cd160b27 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor eficonfig_process_common function Current change boot order implementation does not call eficonfig_process_common() and call own menu functions for display_statusline, item_data_print and item_choice. Change boot order functionality should call eficonfig_process_common() to improve maintenanceability. This commit is a preparation to remove the change boot order specific implementation. The menu functions (display_statusline, item_data_print and item_choice) are added as argument of eficonfig_process_common(). The menu description string displayed at the bottom of the menu is also added as argument. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
32bab0ea |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Make use of CLI character processing Avoid duplicating some of the escape-sequence processing here and use the CLI function instead. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
d0ca98db |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Update bootmenu_loop() to return the code Use the return value to save having to pass around a pointer. This also resolves any ambiguity about what *key contains when the function is called. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
2da4a15e |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Rename KEY_... to BKEY_... This enum values conflict with linux/input.h so rename them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
64550274 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: avoid SetVariable between GetNextVariableName calls The current code calls efi_set_variable_int() to delete the invalid boot option between calls to efi_get_next_variable_name_int(), it may produce unpredictable results. This commit moves removal of the invalid boot option outside of the efi_get_next_variable_name_int() calls. EFI_NOT_FOUND returned from efi_get_next_variable_name_int() indicates we retrieved all EFI variables, it should be treated as EFI_SUCEESS. To address the checkpatch warning of too many leading tabs, combine two if statement into one. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
ce327084 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: carve out efi_get_next_variable_name_int calls To retrieve the EFI variable name by efi_get_next_variable_name_int(), the sequence of alloc -> efi_get_next_variable_name_int -> realloc -> efi_get_next_variable_name_int is required. In current code, this sequence repeatedly appears in the several functions. It should be curved out a common function. This commit also fixes the missing free() of var_name16 in eficonfig_delete_invalid_boot_option(). Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
140a8959 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use efi_get_next_variable_name_int() eficonfig command reads all possible UEFI load options from 0x0000 to 0xFFFF to construct the menu. This takes too much time in some environment. This commit uses efi_get_next_variable_name_int() to read all existing UEFI load options to significantlly reduce the count of efi_get_var() call. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
78b1ccc4 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use u16_strsize() to get u16 string buffer size Use u16_strsize() to simplify the u16 string buffer size calculation. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c67d3c9e |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix going one directory up issue The directory name in eficonfig menu entry contains the '\' separator. strcmp() argument ".." is wrong and one directory up handling does not work correctly. strcmp() argument must include '\' separator. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c3b5af63 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add UEFI Secure Boot Key enrollment interface This commit adds the menu-driven UEFI Secure Boot Key enrollment interface. User can enroll PK, KEK, db and dbx by selecting file. Only the signed EFI Signature List(s) with an authenticated header, typically '.auth' file, is accepted. To clear the PK, KEK, db and dbx, user needs to enroll the null key signed by PK or KEK. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
21faf4ef |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use protocol interface for file selection EFI_SIMPLE_FILE_SYSTEM_PROTOCOL is not always provided by U-Boot. Use protocol interface functions instead of U-Boot internal functions. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d6566113 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose eficonfig_create_device_path() Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use eficonfig_create_device_path() to construct the full device path from device path of the volume and file path, so move it out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d571f9b2 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation All the eficonfig menus other than "Change Boot Order" use 'eficonfig_entry' structure for each menu entry. This commit refactors change boot order implementation to use 'eficonfig_entry' structure same as other menus to have consistent menu handling. This commit also simplifies the data->active handling when KEY_SPACE is pressed, and sizeof() parameter. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
8961e93e |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose append entry function Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use append_entry() and append_quit_entry() to construct the menu, so move them out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
a84040ab |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor file selection handling eficonfig_select_file_handler() is commonly used to select the file. eficonfig_display_select_file_option() adds an additional menu to clear the selected file. eficonfig_display_select_file_option() is not always necessary for the file selection process, so it must be outside of eficonfig_select_file_handler(). This commit also renames the following functions to avoid confusion. eficonfig_select_file_handler() -> eficonfig_process_select_file() eficonfig_select_file() -> eficonfig_show_file_selection() eficonfig_display_select_file_option() -> eficonfig_process_show_file_option() Finally, test_eficonfig.py need to be updated to get aligned with the above modification. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
1167e88a |
|
14-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix missing variable initialization The 'ret' variable must be initialized before use in eficonfig_delete_invalid_boot_option(). Fixes: c416f1c0bc ("bootmenu: add removable media entries") Addresses-Coverity: 376207 ("Uninitialized variables") Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
3d595ac5 |
|
09-Nov-2022 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: remove superfluous if in eficonfig_edit_boot_option Goto for an immediately succeeding label is superfluous. Fixes: 87d791423ac6 ("eficonfig: menu-driven addition of UEFI boot option") Addresses-Coverity: 376202 ("Identical code for different branches") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
f19171c9 |
|
08-Jan-2024 |
Ilias Apalodimas <ilias.apalodimas@linaro.org> |
efi_loader: Clean up efi_dp_append and efi_dp_concat Looking back at the initrd storing functionality, we introduced three functions, efi_dp_append_or_concatenate(), efi_dp_append/concat(). In hindsight we could have simplified that by a lot. First of all none of the functions append anything. They all allocate a new device path and concatenate the contents of two device paths in one. A boolean parameter controls the final device path -- if that's true an end node is injected between the two device paths. So let's rewrite this and make it a bit easier to read. Get rid of efi_dp_append(), efi_dp_concat() and rename efi_dp_append_or_concatenate() to efi_dp_concat(). This is far more intuitive and the only adjustment that is needed is an extra boolean argument on all callsites. Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
64658007 |
|
17-Nov-2023 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: eficonfig: create shortened boot options The boot options created by eficonfig should use shortened device-paths to avoid problems if drives are enumerated in a different sequence. Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
9945bc4f |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Fix incorrect return code of boot option update Correct the return code for out-of-memory and no boot option found Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
339b527b |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Move bootorder and bootoption apis to lib Rename and move bootorder and bootoption apis from cmd to lib for re-use between eficonfig and bootmgr Fix 'unexpected indentation' when 'make htmldocs' after functions are moved Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
2c0b0c31 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_SECURE_BOOT This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_SECURE_BOOT defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
83f3d121 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_MM_COMM_TEE This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_MM_COMM_TEE defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
88df3634 |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: CTRL+S to save the boot order 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>
|
#
45f5319f |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
menu: remove CTRL+C to quit On the sandbox called without "--terminal raw" CTRL+C leaves U-Boot, "ESC/CTRL+C to quit" is misleading. Let's remove CTRL+C to quit key handling from bootmenu and eficonfig menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
|
#
8dbd0a0f |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add vertical scroll support The current eficonfig menu does not support vertical scroll, so it can not display the menu entries greater than the console row size. This commit add the vertial scroll support. The console size is retrieved by SIMPLE_TEXT_OUTPUT_PROTOCOL.QueryMode() service, then calculates the row size for menu entry by subtracting menu header and description row size from the console row size. "start" and "end" are added in the efimenu structure. "start" keeps the menu entry index at the top, "end" keeps the bottom menu entry index. item_data_print() menu function only draws the menu entry between "start" and "end". This commit also fixes the issue that "Save" and "Quit" entries can be moved by BKEY_PLUS in change boot order menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
0d590852 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation This commit removes the change boot order specific menu implementation. The change boot order implementation calls eficonfig_process_common() same as other menus. The change boot order menu requires own item_data_print and item_choice implementation, but display_statusline function can be a same function as other menus. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
cd160b27 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor eficonfig_process_common function Current change boot order implementation does not call eficonfig_process_common() and call own menu functions for display_statusline, item_data_print and item_choice. Change boot order functionality should call eficonfig_process_common() to improve maintenanceability. This commit is a preparation to remove the change boot order specific implementation. The menu functions (display_statusline, item_data_print and item_choice) are added as argument of eficonfig_process_common(). The menu description string displayed at the bottom of the menu is also added as argument. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
32bab0ea |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Make use of CLI character processing Avoid duplicating some of the escape-sequence processing here and use the CLI function instead. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
d0ca98db |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Update bootmenu_loop() to return the code Use the return value to save having to pass around a pointer. This also resolves any ambiguity about what *key contains when the function is called. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
2da4a15e |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Rename KEY_... to BKEY_... This enum values conflict with linux/input.h so rename them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
64550274 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: avoid SetVariable between GetNextVariableName calls The current code calls efi_set_variable_int() to delete the invalid boot option between calls to efi_get_next_variable_name_int(), it may produce unpredictable results. This commit moves removal of the invalid boot option outside of the efi_get_next_variable_name_int() calls. EFI_NOT_FOUND returned from efi_get_next_variable_name_int() indicates we retrieved all EFI variables, it should be treated as EFI_SUCEESS. To address the checkpatch warning of too many leading tabs, combine two if statement into one. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
ce327084 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: carve out efi_get_next_variable_name_int calls To retrieve the EFI variable name by efi_get_next_variable_name_int(), the sequence of alloc -> efi_get_next_variable_name_int -> realloc -> efi_get_next_variable_name_int is required. In current code, this sequence repeatedly appears in the several functions. It should be curved out a common function. This commit also fixes the missing free() of var_name16 in eficonfig_delete_invalid_boot_option(). Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
140a8959 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use efi_get_next_variable_name_int() eficonfig command reads all possible UEFI load options from 0x0000 to 0xFFFF to construct the menu. This takes too much time in some environment. This commit uses efi_get_next_variable_name_int() to read all existing UEFI load options to significantlly reduce the count of efi_get_var() call. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
78b1ccc4 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use u16_strsize() to get u16 string buffer size Use u16_strsize() to simplify the u16 string buffer size calculation. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c67d3c9e |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix going one directory up issue The directory name in eficonfig menu entry contains the '\' separator. strcmp() argument ".." is wrong and one directory up handling does not work correctly. strcmp() argument must include '\' separator. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c3b5af63 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add UEFI Secure Boot Key enrollment interface This commit adds the menu-driven UEFI Secure Boot Key enrollment interface. User can enroll PK, KEK, db and dbx by selecting file. Only the signed EFI Signature List(s) with an authenticated header, typically '.auth' file, is accepted. To clear the PK, KEK, db and dbx, user needs to enroll the null key signed by PK or KEK. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
21faf4ef |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use protocol interface for file selection EFI_SIMPLE_FILE_SYSTEM_PROTOCOL is not always provided by U-Boot. Use protocol interface functions instead of U-Boot internal functions. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d6566113 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose eficonfig_create_device_path() Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use eficonfig_create_device_path() to construct the full device path from device path of the volume and file path, so move it out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d571f9b2 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation All the eficonfig menus other than "Change Boot Order" use 'eficonfig_entry' structure for each menu entry. This commit refactors change boot order implementation to use 'eficonfig_entry' structure same as other menus to have consistent menu handling. This commit also simplifies the data->active handling when KEY_SPACE is pressed, and sizeof() parameter. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
8961e93e |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose append entry function Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use append_entry() and append_quit_entry() to construct the menu, so move them out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
a84040ab |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor file selection handling eficonfig_select_file_handler() is commonly used to select the file. eficonfig_display_select_file_option() adds an additional menu to clear the selected file. eficonfig_display_select_file_option() is not always necessary for the file selection process, so it must be outside of eficonfig_select_file_handler(). This commit also renames the following functions to avoid confusion. eficonfig_select_file_handler() -> eficonfig_process_select_file() eficonfig_select_file() -> eficonfig_show_file_selection() eficonfig_display_select_file_option() -> eficonfig_process_show_file_option() Finally, test_eficonfig.py need to be updated to get aligned with the above modification. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
1167e88a |
|
14-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix missing variable initialization The 'ret' variable must be initialized before use in eficonfig_delete_invalid_boot_option(). Fixes: c416f1c0bc ("bootmenu: add removable media entries") Addresses-Coverity: 376207 ("Uninitialized variables") Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
3d595ac5 |
|
09-Nov-2022 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: remove superfluous if in eficonfig_edit_boot_option Goto for an immediately succeeding label is superfluous. Fixes: 87d791423ac6 ("eficonfig: menu-driven addition of UEFI boot option") Addresses-Coverity: 376202 ("Identical code for different branches") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
f19171c9 |
|
08-Jan-2024 |
Ilias Apalodimas <ilias.apalodimas@linaro.org> |
efi_loader: Clean up efi_dp_append and efi_dp_concat Looking back at the initrd storing functionality, we introduced three functions, efi_dp_append_or_concatenate(), efi_dp_append/concat(). In hindsight we could have simplified that by a lot. First of all none of the functions append anything. They all allocate a new device path and concatenate the contents of two device paths in one. A boolean parameter controls the final device path -- if that's true an end node is injected between the two device paths. So let's rewrite this and make it a bit easier to read. Get rid of efi_dp_append(), efi_dp_concat() and rename efi_dp_append_or_concatenate() to efi_dp_concat(). This is far more intuitive and the only adjustment that is needed is an extra boolean argument on all callsites. Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
64658007 |
|
17-Nov-2023 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: eficonfig: create shortened boot options The boot options created by eficonfig should use shortened device-paths to avoid problems if drives are enumerated in a different sequence. Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
9945bc4f |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Fix incorrect return code of boot option update Correct the return code for out-of-memory and no boot option found Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
339b527b |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Move bootorder and bootoption apis to lib Rename and move bootorder and bootoption apis from cmd to lib for re-use between eficonfig and bootmgr Fix 'unexpected indentation' when 'make htmldocs' after functions are moved Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
2c0b0c31 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_SECURE_BOOT This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_SECURE_BOOT defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
83f3d121 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_MM_COMM_TEE This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_MM_COMM_TEE defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
88df3634 |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: CTRL+S to save the boot order 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>
|
#
45f5319f |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
menu: remove CTRL+C to quit On the sandbox called without "--terminal raw" CTRL+C leaves U-Boot, "ESC/CTRL+C to quit" is misleading. Let's remove CTRL+C to quit key handling from bootmenu and eficonfig menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
|
#
8dbd0a0f |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add vertical scroll support The current eficonfig menu does not support vertical scroll, so it can not display the menu entries greater than the console row size. This commit add the vertial scroll support. The console size is retrieved by SIMPLE_TEXT_OUTPUT_PROTOCOL.QueryMode() service, then calculates the row size for menu entry by subtracting menu header and description row size from the console row size. "start" and "end" are added in the efimenu structure. "start" keeps the menu entry index at the top, "end" keeps the bottom menu entry index. item_data_print() menu function only draws the menu entry between "start" and "end". This commit also fixes the issue that "Save" and "Quit" entries can be moved by BKEY_PLUS in change boot order menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
0d590852 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation This commit removes the change boot order specific menu implementation. The change boot order implementation calls eficonfig_process_common() same as other menus. The change boot order menu requires own item_data_print and item_choice implementation, but display_statusline function can be a same function as other menus. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
cd160b27 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor eficonfig_process_common function Current change boot order implementation does not call eficonfig_process_common() and call own menu functions for display_statusline, item_data_print and item_choice. Change boot order functionality should call eficonfig_process_common() to improve maintenanceability. This commit is a preparation to remove the change boot order specific implementation. The menu functions (display_statusline, item_data_print and item_choice) are added as argument of eficonfig_process_common(). The menu description string displayed at the bottom of the menu is also added as argument. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
32bab0ea |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Make use of CLI character processing Avoid duplicating some of the escape-sequence processing here and use the CLI function instead. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
d0ca98db |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Update bootmenu_loop() to return the code Use the return value to save having to pass around a pointer. This also resolves any ambiguity about what *key contains when the function is called. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
2da4a15e |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Rename KEY_... to BKEY_... This enum values conflict with linux/input.h so rename them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
64550274 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: avoid SetVariable between GetNextVariableName calls The current code calls efi_set_variable_int() to delete the invalid boot option between calls to efi_get_next_variable_name_int(), it may produce unpredictable results. This commit moves removal of the invalid boot option outside of the efi_get_next_variable_name_int() calls. EFI_NOT_FOUND returned from efi_get_next_variable_name_int() indicates we retrieved all EFI variables, it should be treated as EFI_SUCEESS. To address the checkpatch warning of too many leading tabs, combine two if statement into one. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
ce327084 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: carve out efi_get_next_variable_name_int calls To retrieve the EFI variable name by efi_get_next_variable_name_int(), the sequence of alloc -> efi_get_next_variable_name_int -> realloc -> efi_get_next_variable_name_int is required. In current code, this sequence repeatedly appears in the several functions. It should be curved out a common function. This commit also fixes the missing free() of var_name16 in eficonfig_delete_invalid_boot_option(). Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
140a8959 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use efi_get_next_variable_name_int() eficonfig command reads all possible UEFI load options from 0x0000 to 0xFFFF to construct the menu. This takes too much time in some environment. This commit uses efi_get_next_variable_name_int() to read all existing UEFI load options to significantlly reduce the count of efi_get_var() call. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
78b1ccc4 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use u16_strsize() to get u16 string buffer size Use u16_strsize() to simplify the u16 string buffer size calculation. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c67d3c9e |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix going one directory up issue The directory name in eficonfig menu entry contains the '\' separator. strcmp() argument ".." is wrong and one directory up handling does not work correctly. strcmp() argument must include '\' separator. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c3b5af63 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add UEFI Secure Boot Key enrollment interface This commit adds the menu-driven UEFI Secure Boot Key enrollment interface. User can enroll PK, KEK, db and dbx by selecting file. Only the signed EFI Signature List(s) with an authenticated header, typically '.auth' file, is accepted. To clear the PK, KEK, db and dbx, user needs to enroll the null key signed by PK or KEK. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
21faf4ef |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use protocol interface for file selection EFI_SIMPLE_FILE_SYSTEM_PROTOCOL is not always provided by U-Boot. Use protocol interface functions instead of U-Boot internal functions. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d6566113 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose eficonfig_create_device_path() Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use eficonfig_create_device_path() to construct the full device path from device path of the volume and file path, so move it out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d571f9b2 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation All the eficonfig menus other than "Change Boot Order" use 'eficonfig_entry' structure for each menu entry. This commit refactors change boot order implementation to use 'eficonfig_entry' structure same as other menus to have consistent menu handling. This commit also simplifies the data->active handling when KEY_SPACE is pressed, and sizeof() parameter. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
8961e93e |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose append entry function Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use append_entry() and append_quit_entry() to construct the menu, so move them out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
a84040ab |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor file selection handling eficonfig_select_file_handler() is commonly used to select the file. eficonfig_display_select_file_option() adds an additional menu to clear the selected file. eficonfig_display_select_file_option() is not always necessary for the file selection process, so it must be outside of eficonfig_select_file_handler(). This commit also renames the following functions to avoid confusion. eficonfig_select_file_handler() -> eficonfig_process_select_file() eficonfig_select_file() -> eficonfig_show_file_selection() eficonfig_display_select_file_option() -> eficonfig_process_show_file_option() Finally, test_eficonfig.py need to be updated to get aligned with the above modification. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
1167e88a |
|
14-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix missing variable initialization The 'ret' variable must be initialized before use in eficonfig_delete_invalid_boot_option(). Fixes: c416f1c0bc ("bootmenu: add removable media entries") Addresses-Coverity: 376207 ("Uninitialized variables") Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
3d595ac5 |
|
09-Nov-2022 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: remove superfluous if in eficonfig_edit_boot_option Goto for an immediately succeeding label is superfluous. Fixes: 87d791423ac6 ("eficonfig: menu-driven addition of UEFI boot option") Addresses-Coverity: 376202 ("Identical code for different branches") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
f19171c9 |
|
08-Jan-2024 |
Ilias Apalodimas <ilias.apalodimas@linaro.org> |
efi_loader: Clean up efi_dp_append and efi_dp_concat Looking back at the initrd storing functionality, we introduced three functions, efi_dp_append_or_concatenate(), efi_dp_append/concat(). In hindsight we could have simplified that by a lot. First of all none of the functions append anything. They all allocate a new device path and concatenate the contents of two device paths in one. A boolean parameter controls the final device path -- if that's true an end node is injected between the two device paths. So let's rewrite this and make it a bit easier to read. Get rid of efi_dp_append(), efi_dp_concat() and rename efi_dp_append_or_concatenate() to efi_dp_concat(). This is far more intuitive and the only adjustment that is needed is an extra boolean argument on all callsites. Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
64658007 |
|
17-Nov-2023 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: eficonfig: create shortened boot options The boot options created by eficonfig should use shortened device-paths to avoid problems if drives are enumerated in a different sequence. Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
9945bc4f |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Fix incorrect return code of boot option update Correct the return code for out-of-memory and no boot option found Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
339b527b |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Move bootorder and bootoption apis to lib Rename and move bootorder and bootoption apis from cmd to lib for re-use between eficonfig and bootmgr Fix 'unexpected indentation' when 'make htmldocs' after functions are moved Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
2c0b0c31 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_SECURE_BOOT This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_SECURE_BOOT defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
83f3d121 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_MM_COMM_TEE This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_MM_COMM_TEE defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
88df3634 |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: CTRL+S to save the boot order 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>
|
#
45f5319f |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
menu: remove CTRL+C to quit On the sandbox called without "--terminal raw" CTRL+C leaves U-Boot, "ESC/CTRL+C to quit" is misleading. Let's remove CTRL+C to quit key handling from bootmenu and eficonfig menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
|
#
8dbd0a0f |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add vertical scroll support The current eficonfig menu does not support vertical scroll, so it can not display the menu entries greater than the console row size. This commit add the vertial scroll support. The console size is retrieved by SIMPLE_TEXT_OUTPUT_PROTOCOL.QueryMode() service, then calculates the row size for menu entry by subtracting menu header and description row size from the console row size. "start" and "end" are added in the efimenu structure. "start" keeps the menu entry index at the top, "end" keeps the bottom menu entry index. item_data_print() menu function only draws the menu entry between "start" and "end". This commit also fixes the issue that "Save" and "Quit" entries can be moved by BKEY_PLUS in change boot order menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
0d590852 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation This commit removes the change boot order specific menu implementation. The change boot order implementation calls eficonfig_process_common() same as other menus. The change boot order menu requires own item_data_print and item_choice implementation, but display_statusline function can be a same function as other menus. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
cd160b27 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor eficonfig_process_common function Current change boot order implementation does not call eficonfig_process_common() and call own menu functions for display_statusline, item_data_print and item_choice. Change boot order functionality should call eficonfig_process_common() to improve maintenanceability. This commit is a preparation to remove the change boot order specific implementation. The menu functions (display_statusline, item_data_print and item_choice) are added as argument of eficonfig_process_common(). The menu description string displayed at the bottom of the menu is also added as argument. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
32bab0ea |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Make use of CLI character processing Avoid duplicating some of the escape-sequence processing here and use the CLI function instead. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
d0ca98db |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Update bootmenu_loop() to return the code Use the return value to save having to pass around a pointer. This also resolves any ambiguity about what *key contains when the function is called. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
2da4a15e |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Rename KEY_... to BKEY_... This enum values conflict with linux/input.h so rename them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
64550274 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: avoid SetVariable between GetNextVariableName calls The current code calls efi_set_variable_int() to delete the invalid boot option between calls to efi_get_next_variable_name_int(), it may produce unpredictable results. This commit moves removal of the invalid boot option outside of the efi_get_next_variable_name_int() calls. EFI_NOT_FOUND returned from efi_get_next_variable_name_int() indicates we retrieved all EFI variables, it should be treated as EFI_SUCEESS. To address the checkpatch warning of too many leading tabs, combine two if statement into one. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
ce327084 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: carve out efi_get_next_variable_name_int calls To retrieve the EFI variable name by efi_get_next_variable_name_int(), the sequence of alloc -> efi_get_next_variable_name_int -> realloc -> efi_get_next_variable_name_int is required. In current code, this sequence repeatedly appears in the several functions. It should be curved out a common function. This commit also fixes the missing free() of var_name16 in eficonfig_delete_invalid_boot_option(). Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
140a8959 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use efi_get_next_variable_name_int() eficonfig command reads all possible UEFI load options from 0x0000 to 0xFFFF to construct the menu. This takes too much time in some environment. This commit uses efi_get_next_variable_name_int() to read all existing UEFI load options to significantlly reduce the count of efi_get_var() call. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
78b1ccc4 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use u16_strsize() to get u16 string buffer size Use u16_strsize() to simplify the u16 string buffer size calculation. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c67d3c9e |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix going one directory up issue The directory name in eficonfig menu entry contains the '\' separator. strcmp() argument ".." is wrong and one directory up handling does not work correctly. strcmp() argument must include '\' separator. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c3b5af63 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add UEFI Secure Boot Key enrollment interface This commit adds the menu-driven UEFI Secure Boot Key enrollment interface. User can enroll PK, KEK, db and dbx by selecting file. Only the signed EFI Signature List(s) with an authenticated header, typically '.auth' file, is accepted. To clear the PK, KEK, db and dbx, user needs to enroll the null key signed by PK or KEK. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
21faf4ef |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use protocol interface for file selection EFI_SIMPLE_FILE_SYSTEM_PROTOCOL is not always provided by U-Boot. Use protocol interface functions instead of U-Boot internal functions. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d6566113 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose eficonfig_create_device_path() Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use eficonfig_create_device_path() to construct the full device path from device path of the volume and file path, so move it out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d571f9b2 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation All the eficonfig menus other than "Change Boot Order" use 'eficonfig_entry' structure for each menu entry. This commit refactors change boot order implementation to use 'eficonfig_entry' structure same as other menus to have consistent menu handling. This commit also simplifies the data->active handling when KEY_SPACE is pressed, and sizeof() parameter. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
8961e93e |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose append entry function Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use append_entry() and append_quit_entry() to construct the menu, so move them out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
a84040ab |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor file selection handling eficonfig_select_file_handler() is commonly used to select the file. eficonfig_display_select_file_option() adds an additional menu to clear the selected file. eficonfig_display_select_file_option() is not always necessary for the file selection process, so it must be outside of eficonfig_select_file_handler(). This commit also renames the following functions to avoid confusion. eficonfig_select_file_handler() -> eficonfig_process_select_file() eficonfig_select_file() -> eficonfig_show_file_selection() eficonfig_display_select_file_option() -> eficonfig_process_show_file_option() Finally, test_eficonfig.py need to be updated to get aligned with the above modification. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
1167e88a |
|
14-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix missing variable initialization The 'ret' variable must be initialized before use in eficonfig_delete_invalid_boot_option(). Fixes: c416f1c0bc ("bootmenu: add removable media entries") Addresses-Coverity: 376207 ("Uninitialized variables") Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
3d595ac5 |
|
09-Nov-2022 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: remove superfluous if in eficonfig_edit_boot_option Goto for an immediately succeeding label is superfluous. Fixes: 87d791423ac6 ("eficonfig: menu-driven addition of UEFI boot option") Addresses-Coverity: 376202 ("Identical code for different branches") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
f19171c9 |
|
08-Jan-2024 |
Ilias Apalodimas <ilias.apalodimas@linaro.org> |
efi_loader: Clean up efi_dp_append and efi_dp_concat Looking back at the initrd storing functionality, we introduced three functions, efi_dp_append_or_concatenate(), efi_dp_append/concat(). In hindsight we could have simplified that by a lot. First of all none of the functions append anything. They all allocate a new device path and concatenate the contents of two device paths in one. A boolean parameter controls the final device path -- if that's true an end node is injected between the two device paths. So let's rewrite this and make it a bit easier to read. Get rid of efi_dp_append(), efi_dp_concat() and rename efi_dp_append_or_concatenate() to efi_dp_concat(). This is far more intuitive and the only adjustment that is needed is an extra boolean argument on all callsites. Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
64658007 |
|
17-Nov-2023 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: eficonfig: create shortened boot options The boot options created by eficonfig should use shortened device-paths to avoid problems if drives are enumerated in a different sequence. Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
9945bc4f |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Fix incorrect return code of boot option update Correct the return code for out-of-memory and no boot option found Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
339b527b |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Move bootorder and bootoption apis to lib Rename and move bootorder and bootoption apis from cmd to lib for re-use between eficonfig and bootmgr Fix 'unexpected indentation' when 'make htmldocs' after functions are moved Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
2c0b0c31 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_SECURE_BOOT This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_SECURE_BOOT defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
83f3d121 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_MM_COMM_TEE This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_MM_COMM_TEE defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
88df3634 |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: CTRL+S to save the boot order 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>
|
#
45f5319f |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
menu: remove CTRL+C to quit On the sandbox called without "--terminal raw" CTRL+C leaves U-Boot, "ESC/CTRL+C to quit" is misleading. Let's remove CTRL+C to quit key handling from bootmenu and eficonfig menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
|
#
8dbd0a0f |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add vertical scroll support The current eficonfig menu does not support vertical scroll, so it can not display the menu entries greater than the console row size. This commit add the vertial scroll support. The console size is retrieved by SIMPLE_TEXT_OUTPUT_PROTOCOL.QueryMode() service, then calculates the row size for menu entry by subtracting menu header and description row size from the console row size. "start" and "end" are added in the efimenu structure. "start" keeps the menu entry index at the top, "end" keeps the bottom menu entry index. item_data_print() menu function only draws the menu entry between "start" and "end". This commit also fixes the issue that "Save" and "Quit" entries can be moved by BKEY_PLUS in change boot order menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
0d590852 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation This commit removes the change boot order specific menu implementation. The change boot order implementation calls eficonfig_process_common() same as other menus. The change boot order menu requires own item_data_print and item_choice implementation, but display_statusline function can be a same function as other menus. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
cd160b27 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor eficonfig_process_common function Current change boot order implementation does not call eficonfig_process_common() and call own menu functions for display_statusline, item_data_print and item_choice. Change boot order functionality should call eficonfig_process_common() to improve maintenanceability. This commit is a preparation to remove the change boot order specific implementation. The menu functions (display_statusline, item_data_print and item_choice) are added as argument of eficonfig_process_common(). The menu description string displayed at the bottom of the menu is also added as argument. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
32bab0ea |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Make use of CLI character processing Avoid duplicating some of the escape-sequence processing here and use the CLI function instead. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
d0ca98db |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Update bootmenu_loop() to return the code Use the return value to save having to pass around a pointer. This also resolves any ambiguity about what *key contains when the function is called. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
2da4a15e |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Rename KEY_... to BKEY_... This enum values conflict with linux/input.h so rename them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
64550274 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: avoid SetVariable between GetNextVariableName calls The current code calls efi_set_variable_int() to delete the invalid boot option between calls to efi_get_next_variable_name_int(), it may produce unpredictable results. This commit moves removal of the invalid boot option outside of the efi_get_next_variable_name_int() calls. EFI_NOT_FOUND returned from efi_get_next_variable_name_int() indicates we retrieved all EFI variables, it should be treated as EFI_SUCEESS. To address the checkpatch warning of too many leading tabs, combine two if statement into one. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
ce327084 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: carve out efi_get_next_variable_name_int calls To retrieve the EFI variable name by efi_get_next_variable_name_int(), the sequence of alloc -> efi_get_next_variable_name_int -> realloc -> efi_get_next_variable_name_int is required. In current code, this sequence repeatedly appears in the several functions. It should be curved out a common function. This commit also fixes the missing free() of var_name16 in eficonfig_delete_invalid_boot_option(). Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
140a8959 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use efi_get_next_variable_name_int() eficonfig command reads all possible UEFI load options from 0x0000 to 0xFFFF to construct the menu. This takes too much time in some environment. This commit uses efi_get_next_variable_name_int() to read all existing UEFI load options to significantlly reduce the count of efi_get_var() call. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
78b1ccc4 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use u16_strsize() to get u16 string buffer size Use u16_strsize() to simplify the u16 string buffer size calculation. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c67d3c9e |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix going one directory up issue The directory name in eficonfig menu entry contains the '\' separator. strcmp() argument ".." is wrong and one directory up handling does not work correctly. strcmp() argument must include '\' separator. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c3b5af63 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add UEFI Secure Boot Key enrollment interface This commit adds the menu-driven UEFI Secure Boot Key enrollment interface. User can enroll PK, KEK, db and dbx by selecting file. Only the signed EFI Signature List(s) with an authenticated header, typically '.auth' file, is accepted. To clear the PK, KEK, db and dbx, user needs to enroll the null key signed by PK or KEK. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
21faf4ef |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use protocol interface for file selection EFI_SIMPLE_FILE_SYSTEM_PROTOCOL is not always provided by U-Boot. Use protocol interface functions instead of U-Boot internal functions. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d6566113 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose eficonfig_create_device_path() Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use eficonfig_create_device_path() to construct the full device path from device path of the volume and file path, so move it out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d571f9b2 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation All the eficonfig menus other than "Change Boot Order" use 'eficonfig_entry' structure for each menu entry. This commit refactors change boot order implementation to use 'eficonfig_entry' structure same as other menus to have consistent menu handling. This commit also simplifies the data->active handling when KEY_SPACE is pressed, and sizeof() parameter. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
8961e93e |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose append entry function Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use append_entry() and append_quit_entry() to construct the menu, so move them out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
a84040ab |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor file selection handling eficonfig_select_file_handler() is commonly used to select the file. eficonfig_display_select_file_option() adds an additional menu to clear the selected file. eficonfig_display_select_file_option() is not always necessary for the file selection process, so it must be outside of eficonfig_select_file_handler(). This commit also renames the following functions to avoid confusion. eficonfig_select_file_handler() -> eficonfig_process_select_file() eficonfig_select_file() -> eficonfig_show_file_selection() eficonfig_display_select_file_option() -> eficonfig_process_show_file_option() Finally, test_eficonfig.py need to be updated to get aligned with the above modification. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
1167e88a |
|
14-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix missing variable initialization The 'ret' variable must be initialized before use in eficonfig_delete_invalid_boot_option(). Fixes: c416f1c0bc ("bootmenu: add removable media entries") Addresses-Coverity: 376207 ("Uninitialized variables") Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
3d595ac5 |
|
09-Nov-2022 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: remove superfluous if in eficonfig_edit_boot_option Goto for an immediately succeeding label is superfluous. Fixes: 87d791423ac6 ("eficonfig: menu-driven addition of UEFI boot option") Addresses-Coverity: 376202 ("Identical code for different branches") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
f19171c9 |
|
08-Jan-2024 |
Ilias Apalodimas <ilias.apalodimas@linaro.org> |
efi_loader: Clean up efi_dp_append and efi_dp_concat Looking back at the initrd storing functionality, we introduced three functions, efi_dp_append_or_concatenate(), efi_dp_append/concat(). In hindsight we could have simplified that by a lot. First of all none of the functions append anything. They all allocate a new device path and concatenate the contents of two device paths in one. A boolean parameter controls the final device path -- if that's true an end node is injected between the two device paths. So let's rewrite this and make it a bit easier to read. Get rid of efi_dp_append(), efi_dp_concat() and rename efi_dp_append_or_concatenate() to efi_dp_concat(). This is far more intuitive and the only adjustment that is needed is an extra boolean argument on all callsites. Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
64658007 |
|
17-Nov-2023 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: eficonfig: create shortened boot options The boot options created by eficonfig should use shortened device-paths to avoid problems if drives are enumerated in a different sequence. Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
9945bc4f |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Fix incorrect return code of boot option update Correct the return code for out-of-memory and no boot option found Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
339b527b |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Move bootorder and bootoption apis to lib Rename and move bootorder and bootoption apis from cmd to lib for re-use between eficonfig and bootmgr Fix 'unexpected indentation' when 'make htmldocs' after functions are moved Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
2c0b0c31 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_SECURE_BOOT This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_SECURE_BOOT defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
83f3d121 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_MM_COMM_TEE This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_MM_COMM_TEE defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
88df3634 |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: CTRL+S to save the boot order 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>
|
#
45f5319f |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
menu: remove CTRL+C to quit On the sandbox called without "--terminal raw" CTRL+C leaves U-Boot, "ESC/CTRL+C to quit" is misleading. Let's remove CTRL+C to quit key handling from bootmenu and eficonfig menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
|
#
8dbd0a0f |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add vertical scroll support The current eficonfig menu does not support vertical scroll, so it can not display the menu entries greater than the console row size. This commit add the vertial scroll support. The console size is retrieved by SIMPLE_TEXT_OUTPUT_PROTOCOL.QueryMode() service, then calculates the row size for menu entry by subtracting menu header and description row size from the console row size. "start" and "end" are added in the efimenu structure. "start" keeps the menu entry index at the top, "end" keeps the bottom menu entry index. item_data_print() menu function only draws the menu entry between "start" and "end". This commit also fixes the issue that "Save" and "Quit" entries can be moved by BKEY_PLUS in change boot order menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
0d590852 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation This commit removes the change boot order specific menu implementation. The change boot order implementation calls eficonfig_process_common() same as other menus. The change boot order menu requires own item_data_print and item_choice implementation, but display_statusline function can be a same function as other menus. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
cd160b27 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor eficonfig_process_common function Current change boot order implementation does not call eficonfig_process_common() and call own menu functions for display_statusline, item_data_print and item_choice. Change boot order functionality should call eficonfig_process_common() to improve maintenanceability. This commit is a preparation to remove the change boot order specific implementation. The menu functions (display_statusline, item_data_print and item_choice) are added as argument of eficonfig_process_common(). The menu description string displayed at the bottom of the menu is also added as argument. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
32bab0ea |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Make use of CLI character processing Avoid duplicating some of the escape-sequence processing here and use the CLI function instead. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
d0ca98db |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Update bootmenu_loop() to return the code Use the return value to save having to pass around a pointer. This also resolves any ambiguity about what *key contains when the function is called. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
2da4a15e |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Rename KEY_... to BKEY_... This enum values conflict with linux/input.h so rename them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
64550274 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: avoid SetVariable between GetNextVariableName calls The current code calls efi_set_variable_int() to delete the invalid boot option between calls to efi_get_next_variable_name_int(), it may produce unpredictable results. This commit moves removal of the invalid boot option outside of the efi_get_next_variable_name_int() calls. EFI_NOT_FOUND returned from efi_get_next_variable_name_int() indicates we retrieved all EFI variables, it should be treated as EFI_SUCEESS. To address the checkpatch warning of too many leading tabs, combine two if statement into one. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
ce327084 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: carve out efi_get_next_variable_name_int calls To retrieve the EFI variable name by efi_get_next_variable_name_int(), the sequence of alloc -> efi_get_next_variable_name_int -> realloc -> efi_get_next_variable_name_int is required. In current code, this sequence repeatedly appears in the several functions. It should be curved out a common function. This commit also fixes the missing free() of var_name16 in eficonfig_delete_invalid_boot_option(). Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
140a8959 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use efi_get_next_variable_name_int() eficonfig command reads all possible UEFI load options from 0x0000 to 0xFFFF to construct the menu. This takes too much time in some environment. This commit uses efi_get_next_variable_name_int() to read all existing UEFI load options to significantlly reduce the count of efi_get_var() call. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
78b1ccc4 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use u16_strsize() to get u16 string buffer size Use u16_strsize() to simplify the u16 string buffer size calculation. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c67d3c9e |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix going one directory up issue The directory name in eficonfig menu entry contains the '\' separator. strcmp() argument ".." is wrong and one directory up handling does not work correctly. strcmp() argument must include '\' separator. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c3b5af63 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add UEFI Secure Boot Key enrollment interface This commit adds the menu-driven UEFI Secure Boot Key enrollment interface. User can enroll PK, KEK, db and dbx by selecting file. Only the signed EFI Signature List(s) with an authenticated header, typically '.auth' file, is accepted. To clear the PK, KEK, db and dbx, user needs to enroll the null key signed by PK or KEK. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
21faf4ef |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use protocol interface for file selection EFI_SIMPLE_FILE_SYSTEM_PROTOCOL is not always provided by U-Boot. Use protocol interface functions instead of U-Boot internal functions. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d6566113 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose eficonfig_create_device_path() Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use eficonfig_create_device_path() to construct the full device path from device path of the volume and file path, so move it out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d571f9b2 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation All the eficonfig menus other than "Change Boot Order" use 'eficonfig_entry' structure for each menu entry. This commit refactors change boot order implementation to use 'eficonfig_entry' structure same as other menus to have consistent menu handling. This commit also simplifies the data->active handling when KEY_SPACE is pressed, and sizeof() parameter. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
8961e93e |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose append entry function Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use append_entry() and append_quit_entry() to construct the menu, so move them out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
a84040ab |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor file selection handling eficonfig_select_file_handler() is commonly used to select the file. eficonfig_display_select_file_option() adds an additional menu to clear the selected file. eficonfig_display_select_file_option() is not always necessary for the file selection process, so it must be outside of eficonfig_select_file_handler(). This commit also renames the following functions to avoid confusion. eficonfig_select_file_handler() -> eficonfig_process_select_file() eficonfig_select_file() -> eficonfig_show_file_selection() eficonfig_display_select_file_option() -> eficonfig_process_show_file_option() Finally, test_eficonfig.py need to be updated to get aligned with the above modification. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
1167e88a |
|
14-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix missing variable initialization The 'ret' variable must be initialized before use in eficonfig_delete_invalid_boot_option(). Fixes: c416f1c0bc ("bootmenu: add removable media entries") Addresses-Coverity: 376207 ("Uninitialized variables") Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
3d595ac5 |
|
09-Nov-2022 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: remove superfluous if in eficonfig_edit_boot_option Goto for an immediately succeeding label is superfluous. Fixes: 87d791423ac6 ("eficonfig: menu-driven addition of UEFI boot option") Addresses-Coverity: 376202 ("Identical code for different branches") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
f19171c9 |
|
08-Jan-2024 |
Ilias Apalodimas <ilias.apalodimas@linaro.org> |
efi_loader: Clean up efi_dp_append and efi_dp_concat Looking back at the initrd storing functionality, we introduced three functions, efi_dp_append_or_concatenate(), efi_dp_append/concat(). In hindsight we could have simplified that by a lot. First of all none of the functions append anything. They all allocate a new device path and concatenate the contents of two device paths in one. A boolean parameter controls the final device path -- if that's true an end node is injected between the two device paths. So let's rewrite this and make it a bit easier to read. Get rid of efi_dp_append(), efi_dp_concat() and rename efi_dp_append_or_concatenate() to efi_dp_concat(). This is far more intuitive and the only adjustment that is needed is an extra boolean argument on all callsites. Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
64658007 |
|
17-Nov-2023 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: eficonfig: create shortened boot options The boot options created by eficonfig should use shortened device-paths to avoid problems if drives are enumerated in a different sequence. Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
9945bc4f |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Fix incorrect return code of boot option update Correct the return code for out-of-memory and no boot option found Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
339b527b |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Move bootorder and bootoption apis to lib Rename and move bootorder and bootoption apis from cmd to lib for re-use between eficonfig and bootmgr Fix 'unexpected indentation' when 'make htmldocs' after functions are moved Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
2c0b0c31 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_SECURE_BOOT This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_SECURE_BOOT defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
83f3d121 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_MM_COMM_TEE This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_MM_COMM_TEE defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
88df3634 |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: CTRL+S to save the boot order 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>
|
#
45f5319f |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
menu: remove CTRL+C to quit On the sandbox called without "--terminal raw" CTRL+C leaves U-Boot, "ESC/CTRL+C to quit" is misleading. Let's remove CTRL+C to quit key handling from bootmenu and eficonfig menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
|
#
8dbd0a0f |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add vertical scroll support The current eficonfig menu does not support vertical scroll, so it can not display the menu entries greater than the console row size. This commit add the vertial scroll support. The console size is retrieved by SIMPLE_TEXT_OUTPUT_PROTOCOL.QueryMode() service, then calculates the row size for menu entry by subtracting menu header and description row size from the console row size. "start" and "end" are added in the efimenu structure. "start" keeps the menu entry index at the top, "end" keeps the bottom menu entry index. item_data_print() menu function only draws the menu entry between "start" and "end". This commit also fixes the issue that "Save" and "Quit" entries can be moved by BKEY_PLUS in change boot order menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
0d590852 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation This commit removes the change boot order specific menu implementation. The change boot order implementation calls eficonfig_process_common() same as other menus. The change boot order menu requires own item_data_print and item_choice implementation, but display_statusline function can be a same function as other menus. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
cd160b27 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor eficonfig_process_common function Current change boot order implementation does not call eficonfig_process_common() and call own menu functions for display_statusline, item_data_print and item_choice. Change boot order functionality should call eficonfig_process_common() to improve maintenanceability. This commit is a preparation to remove the change boot order specific implementation. The menu functions (display_statusline, item_data_print and item_choice) are added as argument of eficonfig_process_common(). The menu description string displayed at the bottom of the menu is also added as argument. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
32bab0ea |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Make use of CLI character processing Avoid duplicating some of the escape-sequence processing here and use the CLI function instead. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
d0ca98db |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Update bootmenu_loop() to return the code Use the return value to save having to pass around a pointer. This also resolves any ambiguity about what *key contains when the function is called. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
2da4a15e |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Rename KEY_... to BKEY_... This enum values conflict with linux/input.h so rename them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
64550274 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: avoid SetVariable between GetNextVariableName calls The current code calls efi_set_variable_int() to delete the invalid boot option between calls to efi_get_next_variable_name_int(), it may produce unpredictable results. This commit moves removal of the invalid boot option outside of the efi_get_next_variable_name_int() calls. EFI_NOT_FOUND returned from efi_get_next_variable_name_int() indicates we retrieved all EFI variables, it should be treated as EFI_SUCEESS. To address the checkpatch warning of too many leading tabs, combine two if statement into one. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
ce327084 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: carve out efi_get_next_variable_name_int calls To retrieve the EFI variable name by efi_get_next_variable_name_int(), the sequence of alloc -> efi_get_next_variable_name_int -> realloc -> efi_get_next_variable_name_int is required. In current code, this sequence repeatedly appears in the several functions. It should be curved out a common function. This commit also fixes the missing free() of var_name16 in eficonfig_delete_invalid_boot_option(). Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
140a8959 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use efi_get_next_variable_name_int() eficonfig command reads all possible UEFI load options from 0x0000 to 0xFFFF to construct the menu. This takes too much time in some environment. This commit uses efi_get_next_variable_name_int() to read all existing UEFI load options to significantlly reduce the count of efi_get_var() call. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
78b1ccc4 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use u16_strsize() to get u16 string buffer size Use u16_strsize() to simplify the u16 string buffer size calculation. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c67d3c9e |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix going one directory up issue The directory name in eficonfig menu entry contains the '\' separator. strcmp() argument ".." is wrong and one directory up handling does not work correctly. strcmp() argument must include '\' separator. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c3b5af63 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add UEFI Secure Boot Key enrollment interface This commit adds the menu-driven UEFI Secure Boot Key enrollment interface. User can enroll PK, KEK, db and dbx by selecting file. Only the signed EFI Signature List(s) with an authenticated header, typically '.auth' file, is accepted. To clear the PK, KEK, db and dbx, user needs to enroll the null key signed by PK or KEK. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
21faf4ef |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use protocol interface for file selection EFI_SIMPLE_FILE_SYSTEM_PROTOCOL is not always provided by U-Boot. Use protocol interface functions instead of U-Boot internal functions. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d6566113 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose eficonfig_create_device_path() Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use eficonfig_create_device_path() to construct the full device path from device path of the volume and file path, so move it out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d571f9b2 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation All the eficonfig menus other than "Change Boot Order" use 'eficonfig_entry' structure for each menu entry. This commit refactors change boot order implementation to use 'eficonfig_entry' structure same as other menus to have consistent menu handling. This commit also simplifies the data->active handling when KEY_SPACE is pressed, and sizeof() parameter. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
8961e93e |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose append entry function Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use append_entry() and append_quit_entry() to construct the menu, so move them out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
a84040ab |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor file selection handling eficonfig_select_file_handler() is commonly used to select the file. eficonfig_display_select_file_option() adds an additional menu to clear the selected file. eficonfig_display_select_file_option() is not always necessary for the file selection process, so it must be outside of eficonfig_select_file_handler(). This commit also renames the following functions to avoid confusion. eficonfig_select_file_handler() -> eficonfig_process_select_file() eficonfig_select_file() -> eficonfig_show_file_selection() eficonfig_display_select_file_option() -> eficonfig_process_show_file_option() Finally, test_eficonfig.py need to be updated to get aligned with the above modification. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
1167e88a |
|
14-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix missing variable initialization The 'ret' variable must be initialized before use in eficonfig_delete_invalid_boot_option(). Fixes: c416f1c0bc ("bootmenu: add removable media entries") Addresses-Coverity: 376207 ("Uninitialized variables") Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
3d595ac5 |
|
09-Nov-2022 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: remove superfluous if in eficonfig_edit_boot_option Goto for an immediately succeeding label is superfluous. Fixes: 87d791423ac6 ("eficonfig: menu-driven addition of UEFI boot option") Addresses-Coverity: 376202 ("Identical code for different branches") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
f19171c9 |
|
08-Jan-2024 |
Ilias Apalodimas <ilias.apalodimas@linaro.org> |
efi_loader: Clean up efi_dp_append and efi_dp_concat Looking back at the initrd storing functionality, we introduced three functions, efi_dp_append_or_concatenate(), efi_dp_append/concat(). In hindsight we could have simplified that by a lot. First of all none of the functions append anything. They all allocate a new device path and concatenate the contents of two device paths in one. A boolean parameter controls the final device path -- if that's true an end node is injected between the two device paths. So let's rewrite this and make it a bit easier to read. Get rid of efi_dp_append(), efi_dp_concat() and rename efi_dp_append_or_concatenate() to efi_dp_concat(). This is far more intuitive and the only adjustment that is needed is an extra boolean argument on all callsites. Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
64658007 |
|
17-Nov-2023 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: eficonfig: create shortened boot options The boot options created by eficonfig should use shortened device-paths to avoid problems if drives are enumerated in a different sequence. Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
9945bc4f |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Fix incorrect return code of boot option update Correct the return code for out-of-memory and no boot option found Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
339b527b |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Move bootorder and bootoption apis to lib Rename and move bootorder and bootoption apis from cmd to lib for re-use between eficonfig and bootmgr Fix 'unexpected indentation' when 'make htmldocs' after functions are moved Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
2c0b0c31 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_SECURE_BOOT This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_SECURE_BOOT defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
83f3d121 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_MM_COMM_TEE This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_MM_COMM_TEE defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
88df3634 |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: CTRL+S to save the boot order 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>
|
#
45f5319f |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
menu: remove CTRL+C to quit On the sandbox called without "--terminal raw" CTRL+C leaves U-Boot, "ESC/CTRL+C to quit" is misleading. Let's remove CTRL+C to quit key handling from bootmenu and eficonfig menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
|
#
8dbd0a0f |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add vertical scroll support The current eficonfig menu does not support vertical scroll, so it can not display the menu entries greater than the console row size. This commit add the vertial scroll support. The console size is retrieved by SIMPLE_TEXT_OUTPUT_PROTOCOL.QueryMode() service, then calculates the row size for menu entry by subtracting menu header and description row size from the console row size. "start" and "end" are added in the efimenu structure. "start" keeps the menu entry index at the top, "end" keeps the bottom menu entry index. item_data_print() menu function only draws the menu entry between "start" and "end". This commit also fixes the issue that "Save" and "Quit" entries can be moved by BKEY_PLUS in change boot order menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
0d590852 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation This commit removes the change boot order specific menu implementation. The change boot order implementation calls eficonfig_process_common() same as other menus. The change boot order menu requires own item_data_print and item_choice implementation, but display_statusline function can be a same function as other menus. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
cd160b27 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor eficonfig_process_common function Current change boot order implementation does not call eficonfig_process_common() and call own menu functions for display_statusline, item_data_print and item_choice. Change boot order functionality should call eficonfig_process_common() to improve maintenanceability. This commit is a preparation to remove the change boot order specific implementation. The menu functions (display_statusline, item_data_print and item_choice) are added as argument of eficonfig_process_common(). The menu description string displayed at the bottom of the menu is also added as argument. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
32bab0ea |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Make use of CLI character processing Avoid duplicating some of the escape-sequence processing here and use the CLI function instead. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
d0ca98db |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Update bootmenu_loop() to return the code Use the return value to save having to pass around a pointer. This also resolves any ambiguity about what *key contains when the function is called. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
2da4a15e |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Rename KEY_... to BKEY_... This enum values conflict with linux/input.h so rename them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
64550274 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: avoid SetVariable between GetNextVariableName calls The current code calls efi_set_variable_int() to delete the invalid boot option between calls to efi_get_next_variable_name_int(), it may produce unpredictable results. This commit moves removal of the invalid boot option outside of the efi_get_next_variable_name_int() calls. EFI_NOT_FOUND returned from efi_get_next_variable_name_int() indicates we retrieved all EFI variables, it should be treated as EFI_SUCEESS. To address the checkpatch warning of too many leading tabs, combine two if statement into one. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
ce327084 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: carve out efi_get_next_variable_name_int calls To retrieve the EFI variable name by efi_get_next_variable_name_int(), the sequence of alloc -> efi_get_next_variable_name_int -> realloc -> efi_get_next_variable_name_int is required. In current code, this sequence repeatedly appears in the several functions. It should be curved out a common function. This commit also fixes the missing free() of var_name16 in eficonfig_delete_invalid_boot_option(). Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
140a8959 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use efi_get_next_variable_name_int() eficonfig command reads all possible UEFI load options from 0x0000 to 0xFFFF to construct the menu. This takes too much time in some environment. This commit uses efi_get_next_variable_name_int() to read all existing UEFI load options to significantlly reduce the count of efi_get_var() call. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
78b1ccc4 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use u16_strsize() to get u16 string buffer size Use u16_strsize() to simplify the u16 string buffer size calculation. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c67d3c9e |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix going one directory up issue The directory name in eficonfig menu entry contains the '\' separator. strcmp() argument ".." is wrong and one directory up handling does not work correctly. strcmp() argument must include '\' separator. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c3b5af63 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add UEFI Secure Boot Key enrollment interface This commit adds the menu-driven UEFI Secure Boot Key enrollment interface. User can enroll PK, KEK, db and dbx by selecting file. Only the signed EFI Signature List(s) with an authenticated header, typically '.auth' file, is accepted. To clear the PK, KEK, db and dbx, user needs to enroll the null key signed by PK or KEK. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
21faf4ef |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use protocol interface for file selection EFI_SIMPLE_FILE_SYSTEM_PROTOCOL is not always provided by U-Boot. Use protocol interface functions instead of U-Boot internal functions. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d6566113 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose eficonfig_create_device_path() Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use eficonfig_create_device_path() to construct the full device path from device path of the volume and file path, so move it out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d571f9b2 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation All the eficonfig menus other than "Change Boot Order" use 'eficonfig_entry' structure for each menu entry. This commit refactors change boot order implementation to use 'eficonfig_entry' structure same as other menus to have consistent menu handling. This commit also simplifies the data->active handling when KEY_SPACE is pressed, and sizeof() parameter. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
8961e93e |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose append entry function Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use append_entry() and append_quit_entry() to construct the menu, so move them out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
a84040ab |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor file selection handling eficonfig_select_file_handler() is commonly used to select the file. eficonfig_display_select_file_option() adds an additional menu to clear the selected file. eficonfig_display_select_file_option() is not always necessary for the file selection process, so it must be outside of eficonfig_select_file_handler(). This commit also renames the following functions to avoid confusion. eficonfig_select_file_handler() -> eficonfig_process_select_file() eficonfig_select_file() -> eficonfig_show_file_selection() eficonfig_display_select_file_option() -> eficonfig_process_show_file_option() Finally, test_eficonfig.py need to be updated to get aligned with the above modification. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
1167e88a |
|
14-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix missing variable initialization The 'ret' variable must be initialized before use in eficonfig_delete_invalid_boot_option(). Fixes: c416f1c0bc ("bootmenu: add removable media entries") Addresses-Coverity: 376207 ("Uninitialized variables") Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
3d595ac5 |
|
09-Nov-2022 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: remove superfluous if in eficonfig_edit_boot_option Goto for an immediately succeeding label is superfluous. Fixes: 87d791423ac6 ("eficonfig: menu-driven addition of UEFI boot option") Addresses-Coverity: 376202 ("Identical code for different branches") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
f19171c9 |
|
08-Jan-2024 |
Ilias Apalodimas <ilias.apalodimas@linaro.org> |
efi_loader: Clean up efi_dp_append and efi_dp_concat Looking back at the initrd storing functionality, we introduced three functions, efi_dp_append_or_concatenate(), efi_dp_append/concat(). In hindsight we could have simplified that by a lot. First of all none of the functions append anything. They all allocate a new device path and concatenate the contents of two device paths in one. A boolean parameter controls the final device path -- if that's true an end node is injected between the two device paths. So let's rewrite this and make it a bit easier to read. Get rid of efi_dp_append(), efi_dp_concat() and rename efi_dp_append_or_concatenate() to efi_dp_concat(). This is far more intuitive and the only adjustment that is needed is an extra boolean argument on all callsites. Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
64658007 |
|
17-Nov-2023 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: eficonfig: create shortened boot options The boot options created by eficonfig should use shortened device-paths to avoid problems if drives are enumerated in a different sequence. Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
9945bc4f |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Fix incorrect return code of boot option update Correct the return code for out-of-memory and no boot option found Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
339b527b |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Move bootorder and bootoption apis to lib Rename and move bootorder and bootoption apis from cmd to lib for re-use between eficonfig and bootmgr Fix 'unexpected indentation' when 'make htmldocs' after functions are moved Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
2c0b0c31 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_SECURE_BOOT This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_SECURE_BOOT defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
83f3d121 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_MM_COMM_TEE This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_MM_COMM_TEE defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
88df3634 |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: CTRL+S to save the boot order 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>
|
#
45f5319f |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
menu: remove CTRL+C to quit On the sandbox called without "--terminal raw" CTRL+C leaves U-Boot, "ESC/CTRL+C to quit" is misleading. Let's remove CTRL+C to quit key handling from bootmenu and eficonfig menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
|
#
8dbd0a0f |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add vertical scroll support The current eficonfig menu does not support vertical scroll, so it can not display the menu entries greater than the console row size. This commit add the vertial scroll support. The console size is retrieved by SIMPLE_TEXT_OUTPUT_PROTOCOL.QueryMode() service, then calculates the row size for menu entry by subtracting menu header and description row size from the console row size. "start" and "end" are added in the efimenu structure. "start" keeps the menu entry index at the top, "end" keeps the bottom menu entry index. item_data_print() menu function only draws the menu entry between "start" and "end". This commit also fixes the issue that "Save" and "Quit" entries can be moved by BKEY_PLUS in change boot order menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
0d590852 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation This commit removes the change boot order specific menu implementation. The change boot order implementation calls eficonfig_process_common() same as other menus. The change boot order menu requires own item_data_print and item_choice implementation, but display_statusline function can be a same function as other menus. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
cd160b27 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor eficonfig_process_common function Current change boot order implementation does not call eficonfig_process_common() and call own menu functions for display_statusline, item_data_print and item_choice. Change boot order functionality should call eficonfig_process_common() to improve maintenanceability. This commit is a preparation to remove the change boot order specific implementation. The menu functions (display_statusline, item_data_print and item_choice) are added as argument of eficonfig_process_common(). The menu description string displayed at the bottom of the menu is also added as argument. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
32bab0ea |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Make use of CLI character processing Avoid duplicating some of the escape-sequence processing here and use the CLI function instead. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
d0ca98db |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Update bootmenu_loop() to return the code Use the return value to save having to pass around a pointer. This also resolves any ambiguity about what *key contains when the function is called. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
2da4a15e |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Rename KEY_... to BKEY_... This enum values conflict with linux/input.h so rename them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
64550274 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: avoid SetVariable between GetNextVariableName calls The current code calls efi_set_variable_int() to delete the invalid boot option between calls to efi_get_next_variable_name_int(), it may produce unpredictable results. This commit moves removal of the invalid boot option outside of the efi_get_next_variable_name_int() calls. EFI_NOT_FOUND returned from efi_get_next_variable_name_int() indicates we retrieved all EFI variables, it should be treated as EFI_SUCEESS. To address the checkpatch warning of too many leading tabs, combine two if statement into one. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
ce327084 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: carve out efi_get_next_variable_name_int calls To retrieve the EFI variable name by efi_get_next_variable_name_int(), the sequence of alloc -> efi_get_next_variable_name_int -> realloc -> efi_get_next_variable_name_int is required. In current code, this sequence repeatedly appears in the several functions. It should be curved out a common function. This commit also fixes the missing free() of var_name16 in eficonfig_delete_invalid_boot_option(). Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
140a8959 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use efi_get_next_variable_name_int() eficonfig command reads all possible UEFI load options from 0x0000 to 0xFFFF to construct the menu. This takes too much time in some environment. This commit uses efi_get_next_variable_name_int() to read all existing UEFI load options to significantlly reduce the count of efi_get_var() call. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
78b1ccc4 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use u16_strsize() to get u16 string buffer size Use u16_strsize() to simplify the u16 string buffer size calculation. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c67d3c9e |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix going one directory up issue The directory name in eficonfig menu entry contains the '\' separator. strcmp() argument ".." is wrong and one directory up handling does not work correctly. strcmp() argument must include '\' separator. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c3b5af63 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add UEFI Secure Boot Key enrollment interface This commit adds the menu-driven UEFI Secure Boot Key enrollment interface. User can enroll PK, KEK, db and dbx by selecting file. Only the signed EFI Signature List(s) with an authenticated header, typically '.auth' file, is accepted. To clear the PK, KEK, db and dbx, user needs to enroll the null key signed by PK or KEK. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
21faf4ef |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use protocol interface for file selection EFI_SIMPLE_FILE_SYSTEM_PROTOCOL is not always provided by U-Boot. Use protocol interface functions instead of U-Boot internal functions. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d6566113 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose eficonfig_create_device_path() Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use eficonfig_create_device_path() to construct the full device path from device path of the volume and file path, so move it out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d571f9b2 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation All the eficonfig menus other than "Change Boot Order" use 'eficonfig_entry' structure for each menu entry. This commit refactors change boot order implementation to use 'eficonfig_entry' structure same as other menus to have consistent menu handling. This commit also simplifies the data->active handling when KEY_SPACE is pressed, and sizeof() parameter. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
8961e93e |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose append entry function Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use append_entry() and append_quit_entry() to construct the menu, so move them out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
a84040ab |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor file selection handling eficonfig_select_file_handler() is commonly used to select the file. eficonfig_display_select_file_option() adds an additional menu to clear the selected file. eficonfig_display_select_file_option() is not always necessary for the file selection process, so it must be outside of eficonfig_select_file_handler(). This commit also renames the following functions to avoid confusion. eficonfig_select_file_handler() -> eficonfig_process_select_file() eficonfig_select_file() -> eficonfig_show_file_selection() eficonfig_display_select_file_option() -> eficonfig_process_show_file_option() Finally, test_eficonfig.py need to be updated to get aligned with the above modification. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
1167e88a |
|
14-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix missing variable initialization The 'ret' variable must be initialized before use in eficonfig_delete_invalid_boot_option(). Fixes: c416f1c0bc ("bootmenu: add removable media entries") Addresses-Coverity: 376207 ("Uninitialized variables") Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
3d595ac5 |
|
09-Nov-2022 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: remove superfluous if in eficonfig_edit_boot_option Goto for an immediately succeeding label is superfluous. Fixes: 87d791423ac6 ("eficonfig: menu-driven addition of UEFI boot option") Addresses-Coverity: 376202 ("Identical code for different branches") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
f19171c9 |
|
08-Jan-2024 |
Ilias Apalodimas <ilias.apalodimas@linaro.org> |
efi_loader: Clean up efi_dp_append and efi_dp_concat Looking back at the initrd storing functionality, we introduced three functions, efi_dp_append_or_concatenate(), efi_dp_append/concat(). In hindsight we could have simplified that by a lot. First of all none of the functions append anything. They all allocate a new device path and concatenate the contents of two device paths in one. A boolean parameter controls the final device path -- if that's true an end node is injected between the two device paths. So let's rewrite this and make it a bit easier to read. Get rid of efi_dp_append(), efi_dp_concat() and rename efi_dp_append_or_concatenate() to efi_dp_concat(). This is far more intuitive and the only adjustment that is needed is an extra boolean argument on all callsites. Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
64658007 |
|
17-Nov-2023 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: eficonfig: create shortened boot options The boot options created by eficonfig should use shortened device-paths to avoid problems if drives are enumerated in a different sequence. Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
9945bc4f |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Fix incorrect return code of boot option update Correct the return code for out-of-memory and no boot option found Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
339b527b |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Move bootorder and bootoption apis to lib Rename and move bootorder and bootoption apis from cmd to lib for re-use between eficonfig and bootmgr Fix 'unexpected indentation' when 'make htmldocs' after functions are moved Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
2c0b0c31 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_SECURE_BOOT This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_SECURE_BOOT defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
83f3d121 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_MM_COMM_TEE This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_MM_COMM_TEE defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
88df3634 |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: CTRL+S to save the boot order 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>
|
#
45f5319f |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
menu: remove CTRL+C to quit On the sandbox called without "--terminal raw" CTRL+C leaves U-Boot, "ESC/CTRL+C to quit" is misleading. Let's remove CTRL+C to quit key handling from bootmenu and eficonfig menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
|
#
8dbd0a0f |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add vertical scroll support The current eficonfig menu does not support vertical scroll, so it can not display the menu entries greater than the console row size. This commit add the vertial scroll support. The console size is retrieved by SIMPLE_TEXT_OUTPUT_PROTOCOL.QueryMode() service, then calculates the row size for menu entry by subtracting menu header and description row size from the console row size. "start" and "end" are added in the efimenu structure. "start" keeps the menu entry index at the top, "end" keeps the bottom menu entry index. item_data_print() menu function only draws the menu entry between "start" and "end". This commit also fixes the issue that "Save" and "Quit" entries can be moved by BKEY_PLUS in change boot order menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
0d590852 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation This commit removes the change boot order specific menu implementation. The change boot order implementation calls eficonfig_process_common() same as other menus. The change boot order menu requires own item_data_print and item_choice implementation, but display_statusline function can be a same function as other menus. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
cd160b27 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor eficonfig_process_common function Current change boot order implementation does not call eficonfig_process_common() and call own menu functions for display_statusline, item_data_print and item_choice. Change boot order functionality should call eficonfig_process_common() to improve maintenanceability. This commit is a preparation to remove the change boot order specific implementation. The menu functions (display_statusline, item_data_print and item_choice) are added as argument of eficonfig_process_common(). The menu description string displayed at the bottom of the menu is also added as argument. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
32bab0ea |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Make use of CLI character processing Avoid duplicating some of the escape-sequence processing here and use the CLI function instead. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
d0ca98db |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Update bootmenu_loop() to return the code Use the return value to save having to pass around a pointer. This also resolves any ambiguity about what *key contains when the function is called. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
2da4a15e |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Rename KEY_... to BKEY_... This enum values conflict with linux/input.h so rename them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
64550274 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: avoid SetVariable between GetNextVariableName calls The current code calls efi_set_variable_int() to delete the invalid boot option between calls to efi_get_next_variable_name_int(), it may produce unpredictable results. This commit moves removal of the invalid boot option outside of the efi_get_next_variable_name_int() calls. EFI_NOT_FOUND returned from efi_get_next_variable_name_int() indicates we retrieved all EFI variables, it should be treated as EFI_SUCEESS. To address the checkpatch warning of too many leading tabs, combine two if statement into one. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
ce327084 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: carve out efi_get_next_variable_name_int calls To retrieve the EFI variable name by efi_get_next_variable_name_int(), the sequence of alloc -> efi_get_next_variable_name_int -> realloc -> efi_get_next_variable_name_int is required. In current code, this sequence repeatedly appears in the several functions. It should be curved out a common function. This commit also fixes the missing free() of var_name16 in eficonfig_delete_invalid_boot_option(). Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
140a8959 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use efi_get_next_variable_name_int() eficonfig command reads all possible UEFI load options from 0x0000 to 0xFFFF to construct the menu. This takes too much time in some environment. This commit uses efi_get_next_variable_name_int() to read all existing UEFI load options to significantlly reduce the count of efi_get_var() call. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
78b1ccc4 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use u16_strsize() to get u16 string buffer size Use u16_strsize() to simplify the u16 string buffer size calculation. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c67d3c9e |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix going one directory up issue The directory name in eficonfig menu entry contains the '\' separator. strcmp() argument ".." is wrong and one directory up handling does not work correctly. strcmp() argument must include '\' separator. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c3b5af63 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add UEFI Secure Boot Key enrollment interface This commit adds the menu-driven UEFI Secure Boot Key enrollment interface. User can enroll PK, KEK, db and dbx by selecting file. Only the signed EFI Signature List(s) with an authenticated header, typically '.auth' file, is accepted. To clear the PK, KEK, db and dbx, user needs to enroll the null key signed by PK or KEK. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
21faf4ef |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use protocol interface for file selection EFI_SIMPLE_FILE_SYSTEM_PROTOCOL is not always provided by U-Boot. Use protocol interface functions instead of U-Boot internal functions. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d6566113 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose eficonfig_create_device_path() Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use eficonfig_create_device_path() to construct the full device path from device path of the volume and file path, so move it out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d571f9b2 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation All the eficonfig menus other than "Change Boot Order" use 'eficonfig_entry' structure for each menu entry. This commit refactors change boot order implementation to use 'eficonfig_entry' structure same as other menus to have consistent menu handling. This commit also simplifies the data->active handling when KEY_SPACE is pressed, and sizeof() parameter. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
8961e93e |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose append entry function Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use append_entry() and append_quit_entry() to construct the menu, so move them out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
a84040ab |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor file selection handling eficonfig_select_file_handler() is commonly used to select the file. eficonfig_display_select_file_option() adds an additional menu to clear the selected file. eficonfig_display_select_file_option() is not always necessary for the file selection process, so it must be outside of eficonfig_select_file_handler(). This commit also renames the following functions to avoid confusion. eficonfig_select_file_handler() -> eficonfig_process_select_file() eficonfig_select_file() -> eficonfig_show_file_selection() eficonfig_display_select_file_option() -> eficonfig_process_show_file_option() Finally, test_eficonfig.py need to be updated to get aligned with the above modification. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
1167e88a |
|
14-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix missing variable initialization The 'ret' variable must be initialized before use in eficonfig_delete_invalid_boot_option(). Fixes: c416f1c0bc ("bootmenu: add removable media entries") Addresses-Coverity: 376207 ("Uninitialized variables") Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
3d595ac5 |
|
09-Nov-2022 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: remove superfluous if in eficonfig_edit_boot_option Goto for an immediately succeeding label is superfluous. Fixes: 87d791423ac6 ("eficonfig: menu-driven addition of UEFI boot option") Addresses-Coverity: 376202 ("Identical code for different branches") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
f19171c9 |
|
08-Jan-2024 |
Ilias Apalodimas <ilias.apalodimas@linaro.org> |
efi_loader: Clean up efi_dp_append and efi_dp_concat Looking back at the initrd storing functionality, we introduced three functions, efi_dp_append_or_concatenate(), efi_dp_append/concat(). In hindsight we could have simplified that by a lot. First of all none of the functions append anything. They all allocate a new device path and concatenate the contents of two device paths in one. A boolean parameter controls the final device path -- if that's true an end node is injected between the two device paths. So let's rewrite this and make it a bit easier to read. Get rid of efi_dp_append(), efi_dp_concat() and rename efi_dp_append_or_concatenate() to efi_dp_concat(). This is far more intuitive and the only adjustment that is needed is an extra boolean argument on all callsites. Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
64658007 |
|
17-Nov-2023 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: eficonfig: create shortened boot options The boot options created by eficonfig should use shortened device-paths to avoid problems if drives are enumerated in a different sequence. Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
9945bc4f |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Fix incorrect return code of boot option update Correct the return code for out-of-memory and no boot option found Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
339b527b |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Move bootorder and bootoption apis to lib Rename and move bootorder and bootoption apis from cmd to lib for re-use between eficonfig and bootmgr Fix 'unexpected indentation' when 'make htmldocs' after functions are moved Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
2c0b0c31 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_SECURE_BOOT This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_SECURE_BOOT defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
83f3d121 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_MM_COMM_TEE This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_MM_COMM_TEE defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
88df3634 |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: CTRL+S to save the boot order 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>
|
#
45f5319f |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
menu: remove CTRL+C to quit On the sandbox called without "--terminal raw" CTRL+C leaves U-Boot, "ESC/CTRL+C to quit" is misleading. Let's remove CTRL+C to quit key handling from bootmenu and eficonfig menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
|
#
8dbd0a0f |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add vertical scroll support The current eficonfig menu does not support vertical scroll, so it can not display the menu entries greater than the console row size. This commit add the vertial scroll support. The console size is retrieved by SIMPLE_TEXT_OUTPUT_PROTOCOL.QueryMode() service, then calculates the row size for menu entry by subtracting menu header and description row size from the console row size. "start" and "end" are added in the efimenu structure. "start" keeps the menu entry index at the top, "end" keeps the bottom menu entry index. item_data_print() menu function only draws the menu entry between "start" and "end". This commit also fixes the issue that "Save" and "Quit" entries can be moved by BKEY_PLUS in change boot order menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
0d590852 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation This commit removes the change boot order specific menu implementation. The change boot order implementation calls eficonfig_process_common() same as other menus. The change boot order menu requires own item_data_print and item_choice implementation, but display_statusline function can be a same function as other menus. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
cd160b27 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor eficonfig_process_common function Current change boot order implementation does not call eficonfig_process_common() and call own menu functions for display_statusline, item_data_print and item_choice. Change boot order functionality should call eficonfig_process_common() to improve maintenanceability. This commit is a preparation to remove the change boot order specific implementation. The menu functions (display_statusline, item_data_print and item_choice) are added as argument of eficonfig_process_common(). The menu description string displayed at the bottom of the menu is also added as argument. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
32bab0ea |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Make use of CLI character processing Avoid duplicating some of the escape-sequence processing here and use the CLI function instead. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
d0ca98db |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Update bootmenu_loop() to return the code Use the return value to save having to pass around a pointer. This also resolves any ambiguity about what *key contains when the function is called. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
2da4a15e |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Rename KEY_... to BKEY_... This enum values conflict with linux/input.h so rename them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
64550274 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: avoid SetVariable between GetNextVariableName calls The current code calls efi_set_variable_int() to delete the invalid boot option between calls to efi_get_next_variable_name_int(), it may produce unpredictable results. This commit moves removal of the invalid boot option outside of the efi_get_next_variable_name_int() calls. EFI_NOT_FOUND returned from efi_get_next_variable_name_int() indicates we retrieved all EFI variables, it should be treated as EFI_SUCEESS. To address the checkpatch warning of too many leading tabs, combine two if statement into one. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
ce327084 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: carve out efi_get_next_variable_name_int calls To retrieve the EFI variable name by efi_get_next_variable_name_int(), the sequence of alloc -> efi_get_next_variable_name_int -> realloc -> efi_get_next_variable_name_int is required. In current code, this sequence repeatedly appears in the several functions. It should be curved out a common function. This commit also fixes the missing free() of var_name16 in eficonfig_delete_invalid_boot_option(). Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
140a8959 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use efi_get_next_variable_name_int() eficonfig command reads all possible UEFI load options from 0x0000 to 0xFFFF to construct the menu. This takes too much time in some environment. This commit uses efi_get_next_variable_name_int() to read all existing UEFI load options to significantlly reduce the count of efi_get_var() call. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
78b1ccc4 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use u16_strsize() to get u16 string buffer size Use u16_strsize() to simplify the u16 string buffer size calculation. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c67d3c9e |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix going one directory up issue The directory name in eficonfig menu entry contains the '\' separator. strcmp() argument ".." is wrong and one directory up handling does not work correctly. strcmp() argument must include '\' separator. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c3b5af63 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add UEFI Secure Boot Key enrollment interface This commit adds the menu-driven UEFI Secure Boot Key enrollment interface. User can enroll PK, KEK, db and dbx by selecting file. Only the signed EFI Signature List(s) with an authenticated header, typically '.auth' file, is accepted. To clear the PK, KEK, db and dbx, user needs to enroll the null key signed by PK or KEK. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
21faf4ef |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use protocol interface for file selection EFI_SIMPLE_FILE_SYSTEM_PROTOCOL is not always provided by U-Boot. Use protocol interface functions instead of U-Boot internal functions. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d6566113 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose eficonfig_create_device_path() Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use eficonfig_create_device_path() to construct the full device path from device path of the volume and file path, so move it out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d571f9b2 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation All the eficonfig menus other than "Change Boot Order" use 'eficonfig_entry' structure for each menu entry. This commit refactors change boot order implementation to use 'eficonfig_entry' structure same as other menus to have consistent menu handling. This commit also simplifies the data->active handling when KEY_SPACE is pressed, and sizeof() parameter. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
8961e93e |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose append entry function Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use append_entry() and append_quit_entry() to construct the menu, so move them out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
a84040ab |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor file selection handling eficonfig_select_file_handler() is commonly used to select the file. eficonfig_display_select_file_option() adds an additional menu to clear the selected file. eficonfig_display_select_file_option() is not always necessary for the file selection process, so it must be outside of eficonfig_select_file_handler(). This commit also renames the following functions to avoid confusion. eficonfig_select_file_handler() -> eficonfig_process_select_file() eficonfig_select_file() -> eficonfig_show_file_selection() eficonfig_display_select_file_option() -> eficonfig_process_show_file_option() Finally, test_eficonfig.py need to be updated to get aligned with the above modification. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
1167e88a |
|
14-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix missing variable initialization The 'ret' variable must be initialized before use in eficonfig_delete_invalid_boot_option(). Fixes: c416f1c0bc ("bootmenu: add removable media entries") Addresses-Coverity: 376207 ("Uninitialized variables") Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
3d595ac5 |
|
09-Nov-2022 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: remove superfluous if in eficonfig_edit_boot_option Goto for an immediately succeeding label is superfluous. Fixes: 87d791423ac6 ("eficonfig: menu-driven addition of UEFI boot option") Addresses-Coverity: 376202 ("Identical code for different branches") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
f19171c9 |
|
08-Jan-2024 |
Ilias Apalodimas <ilias.apalodimas@linaro.org> |
efi_loader: Clean up efi_dp_append and efi_dp_concat Looking back at the initrd storing functionality, we introduced three functions, efi_dp_append_or_concatenate(), efi_dp_append/concat(). In hindsight we could have simplified that by a lot. First of all none of the functions append anything. They all allocate a new device path and concatenate the contents of two device paths in one. A boolean parameter controls the final device path -- if that's true an end node is injected between the two device paths. So let's rewrite this and make it a bit easier to read. Get rid of efi_dp_append(), efi_dp_concat() and rename efi_dp_append_or_concatenate() to efi_dp_concat(). This is far more intuitive and the only adjustment that is needed is an extra boolean argument on all callsites. Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
64658007 |
|
17-Nov-2023 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: eficonfig: create shortened boot options The boot options created by eficonfig should use shortened device-paths to avoid problems if drives are enumerated in a different sequence. Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
9945bc4f |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Fix incorrect return code of boot option update Correct the return code for out-of-memory and no boot option found Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
339b527b |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Move bootorder and bootoption apis to lib Rename and move bootorder and bootoption apis from cmd to lib for re-use between eficonfig and bootmgr Fix 'unexpected indentation' when 'make htmldocs' after functions are moved Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
2c0b0c31 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_SECURE_BOOT This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_SECURE_BOOT defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
83f3d121 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_MM_COMM_TEE This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_MM_COMM_TEE defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
88df3634 |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: CTRL+S to save the boot order 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>
|
#
45f5319f |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
menu: remove CTRL+C to quit On the sandbox called without "--terminal raw" CTRL+C leaves U-Boot, "ESC/CTRL+C to quit" is misleading. Let's remove CTRL+C to quit key handling from bootmenu and eficonfig menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
|
#
8dbd0a0f |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add vertical scroll support The current eficonfig menu does not support vertical scroll, so it can not display the menu entries greater than the console row size. This commit add the vertial scroll support. The console size is retrieved by SIMPLE_TEXT_OUTPUT_PROTOCOL.QueryMode() service, then calculates the row size for menu entry by subtracting menu header and description row size from the console row size. "start" and "end" are added in the efimenu structure. "start" keeps the menu entry index at the top, "end" keeps the bottom menu entry index. item_data_print() menu function only draws the menu entry between "start" and "end". This commit also fixes the issue that "Save" and "Quit" entries can be moved by BKEY_PLUS in change boot order menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
0d590852 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation This commit removes the change boot order specific menu implementation. The change boot order implementation calls eficonfig_process_common() same as other menus. The change boot order menu requires own item_data_print and item_choice implementation, but display_statusline function can be a same function as other menus. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
cd160b27 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor eficonfig_process_common function Current change boot order implementation does not call eficonfig_process_common() and call own menu functions for display_statusline, item_data_print and item_choice. Change boot order functionality should call eficonfig_process_common() to improve maintenanceability. This commit is a preparation to remove the change boot order specific implementation. The menu functions (display_statusline, item_data_print and item_choice) are added as argument of eficonfig_process_common(). The menu description string displayed at the bottom of the menu is also added as argument. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
32bab0ea |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Make use of CLI character processing Avoid duplicating some of the escape-sequence processing here and use the CLI function instead. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
d0ca98db |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Update bootmenu_loop() to return the code Use the return value to save having to pass around a pointer. This also resolves any ambiguity about what *key contains when the function is called. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
2da4a15e |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Rename KEY_... to BKEY_... This enum values conflict with linux/input.h so rename them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
64550274 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: avoid SetVariable between GetNextVariableName calls The current code calls efi_set_variable_int() to delete the invalid boot option between calls to efi_get_next_variable_name_int(), it may produce unpredictable results. This commit moves removal of the invalid boot option outside of the efi_get_next_variable_name_int() calls. EFI_NOT_FOUND returned from efi_get_next_variable_name_int() indicates we retrieved all EFI variables, it should be treated as EFI_SUCEESS. To address the checkpatch warning of too many leading tabs, combine two if statement into one. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
ce327084 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: carve out efi_get_next_variable_name_int calls To retrieve the EFI variable name by efi_get_next_variable_name_int(), the sequence of alloc -> efi_get_next_variable_name_int -> realloc -> efi_get_next_variable_name_int is required. In current code, this sequence repeatedly appears in the several functions. It should be curved out a common function. This commit also fixes the missing free() of var_name16 in eficonfig_delete_invalid_boot_option(). Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
140a8959 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use efi_get_next_variable_name_int() eficonfig command reads all possible UEFI load options from 0x0000 to 0xFFFF to construct the menu. This takes too much time in some environment. This commit uses efi_get_next_variable_name_int() to read all existing UEFI load options to significantlly reduce the count of efi_get_var() call. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
78b1ccc4 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use u16_strsize() to get u16 string buffer size Use u16_strsize() to simplify the u16 string buffer size calculation. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c67d3c9e |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix going one directory up issue The directory name in eficonfig menu entry contains the '\' separator. strcmp() argument ".." is wrong and one directory up handling does not work correctly. strcmp() argument must include '\' separator. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c3b5af63 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add UEFI Secure Boot Key enrollment interface This commit adds the menu-driven UEFI Secure Boot Key enrollment interface. User can enroll PK, KEK, db and dbx by selecting file. Only the signed EFI Signature List(s) with an authenticated header, typically '.auth' file, is accepted. To clear the PK, KEK, db and dbx, user needs to enroll the null key signed by PK or KEK. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
21faf4ef |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use protocol interface for file selection EFI_SIMPLE_FILE_SYSTEM_PROTOCOL is not always provided by U-Boot. Use protocol interface functions instead of U-Boot internal functions. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d6566113 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose eficonfig_create_device_path() Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use eficonfig_create_device_path() to construct the full device path from device path of the volume and file path, so move it out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d571f9b2 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation All the eficonfig menus other than "Change Boot Order" use 'eficonfig_entry' structure for each menu entry. This commit refactors change boot order implementation to use 'eficonfig_entry' structure same as other menus to have consistent menu handling. This commit also simplifies the data->active handling when KEY_SPACE is pressed, and sizeof() parameter. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
8961e93e |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose append entry function Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use append_entry() and append_quit_entry() to construct the menu, so move them out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
a84040ab |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor file selection handling eficonfig_select_file_handler() is commonly used to select the file. eficonfig_display_select_file_option() adds an additional menu to clear the selected file. eficonfig_display_select_file_option() is not always necessary for the file selection process, so it must be outside of eficonfig_select_file_handler(). This commit also renames the following functions to avoid confusion. eficonfig_select_file_handler() -> eficonfig_process_select_file() eficonfig_select_file() -> eficonfig_show_file_selection() eficonfig_display_select_file_option() -> eficonfig_process_show_file_option() Finally, test_eficonfig.py need to be updated to get aligned with the above modification. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
1167e88a |
|
14-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix missing variable initialization The 'ret' variable must be initialized before use in eficonfig_delete_invalid_boot_option(). Fixes: c416f1c0bc ("bootmenu: add removable media entries") Addresses-Coverity: 376207 ("Uninitialized variables") Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
3d595ac5 |
|
09-Nov-2022 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: remove superfluous if in eficonfig_edit_boot_option Goto for an immediately succeeding label is superfluous. Fixes: 87d791423ac6 ("eficonfig: menu-driven addition of UEFI boot option") Addresses-Coverity: 376202 ("Identical code for different branches") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
f19171c9 |
|
08-Jan-2024 |
Ilias Apalodimas <ilias.apalodimas@linaro.org> |
efi_loader: Clean up efi_dp_append and efi_dp_concat Looking back at the initrd storing functionality, we introduced three functions, efi_dp_append_or_concatenate(), efi_dp_append/concat(). In hindsight we could have simplified that by a lot. First of all none of the functions append anything. They all allocate a new device path and concatenate the contents of two device paths in one. A boolean parameter controls the final device path -- if that's true an end node is injected between the two device paths. So let's rewrite this and make it a bit easier to read. Get rid of efi_dp_append(), efi_dp_concat() and rename efi_dp_append_or_concatenate() to efi_dp_concat(). This is far more intuitive and the only adjustment that is needed is an extra boolean argument on all callsites. Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
64658007 |
|
17-Nov-2023 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: eficonfig: create shortened boot options The boot options created by eficonfig should use shortened device-paths to avoid problems if drives are enumerated in a different sequence. Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
9945bc4f |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Fix incorrect return code of boot option update Correct the return code for out-of-memory and no boot option found Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
339b527b |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Move bootorder and bootoption apis to lib Rename and move bootorder and bootoption apis from cmd to lib for re-use between eficonfig and bootmgr Fix 'unexpected indentation' when 'make htmldocs' after functions are moved Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
2c0b0c31 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_SECURE_BOOT This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_SECURE_BOOT defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
83f3d121 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_MM_COMM_TEE This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_MM_COMM_TEE defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
88df3634 |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: CTRL+S to save the boot order 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>
|
#
45f5319f |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
menu: remove CTRL+C to quit On the sandbox called without "--terminal raw" CTRL+C leaves U-Boot, "ESC/CTRL+C to quit" is misleading. Let's remove CTRL+C to quit key handling from bootmenu and eficonfig menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
|
#
8dbd0a0f |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add vertical scroll support The current eficonfig menu does not support vertical scroll, so it can not display the menu entries greater than the console row size. This commit add the vertial scroll support. The console size is retrieved by SIMPLE_TEXT_OUTPUT_PROTOCOL.QueryMode() service, then calculates the row size for menu entry by subtracting menu header and description row size from the console row size. "start" and "end" are added in the efimenu structure. "start" keeps the menu entry index at the top, "end" keeps the bottom menu entry index. item_data_print() menu function only draws the menu entry between "start" and "end". This commit also fixes the issue that "Save" and "Quit" entries can be moved by BKEY_PLUS in change boot order menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
0d590852 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation This commit removes the change boot order specific menu implementation. The change boot order implementation calls eficonfig_process_common() same as other menus. The change boot order menu requires own item_data_print and item_choice implementation, but display_statusline function can be a same function as other menus. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
cd160b27 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor eficonfig_process_common function Current change boot order implementation does not call eficonfig_process_common() and call own menu functions for display_statusline, item_data_print and item_choice. Change boot order functionality should call eficonfig_process_common() to improve maintenanceability. This commit is a preparation to remove the change boot order specific implementation. The menu functions (display_statusline, item_data_print and item_choice) are added as argument of eficonfig_process_common(). The menu description string displayed at the bottom of the menu is also added as argument. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
32bab0ea |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Make use of CLI character processing Avoid duplicating some of the escape-sequence processing here and use the CLI function instead. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
d0ca98db |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Update bootmenu_loop() to return the code Use the return value to save having to pass around a pointer. This also resolves any ambiguity about what *key contains when the function is called. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
2da4a15e |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Rename KEY_... to BKEY_... This enum values conflict with linux/input.h so rename them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
64550274 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: avoid SetVariable between GetNextVariableName calls The current code calls efi_set_variable_int() to delete the invalid boot option between calls to efi_get_next_variable_name_int(), it may produce unpredictable results. This commit moves removal of the invalid boot option outside of the efi_get_next_variable_name_int() calls. EFI_NOT_FOUND returned from efi_get_next_variable_name_int() indicates we retrieved all EFI variables, it should be treated as EFI_SUCEESS. To address the checkpatch warning of too many leading tabs, combine two if statement into one. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
ce327084 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: carve out efi_get_next_variable_name_int calls To retrieve the EFI variable name by efi_get_next_variable_name_int(), the sequence of alloc -> efi_get_next_variable_name_int -> realloc -> efi_get_next_variable_name_int is required. In current code, this sequence repeatedly appears in the several functions. It should be curved out a common function. This commit also fixes the missing free() of var_name16 in eficonfig_delete_invalid_boot_option(). Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
140a8959 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use efi_get_next_variable_name_int() eficonfig command reads all possible UEFI load options from 0x0000 to 0xFFFF to construct the menu. This takes too much time in some environment. This commit uses efi_get_next_variable_name_int() to read all existing UEFI load options to significantlly reduce the count of efi_get_var() call. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
78b1ccc4 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use u16_strsize() to get u16 string buffer size Use u16_strsize() to simplify the u16 string buffer size calculation. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c67d3c9e |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix going one directory up issue The directory name in eficonfig menu entry contains the '\' separator. strcmp() argument ".." is wrong and one directory up handling does not work correctly. strcmp() argument must include '\' separator. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c3b5af63 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add UEFI Secure Boot Key enrollment interface This commit adds the menu-driven UEFI Secure Boot Key enrollment interface. User can enroll PK, KEK, db and dbx by selecting file. Only the signed EFI Signature List(s) with an authenticated header, typically '.auth' file, is accepted. To clear the PK, KEK, db and dbx, user needs to enroll the null key signed by PK or KEK. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
21faf4ef |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use protocol interface for file selection EFI_SIMPLE_FILE_SYSTEM_PROTOCOL is not always provided by U-Boot. Use protocol interface functions instead of U-Boot internal functions. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d6566113 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose eficonfig_create_device_path() Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use eficonfig_create_device_path() to construct the full device path from device path of the volume and file path, so move it out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d571f9b2 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation All the eficonfig menus other than "Change Boot Order" use 'eficonfig_entry' structure for each menu entry. This commit refactors change boot order implementation to use 'eficonfig_entry' structure same as other menus to have consistent menu handling. This commit also simplifies the data->active handling when KEY_SPACE is pressed, and sizeof() parameter. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
8961e93e |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose append entry function Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use append_entry() and append_quit_entry() to construct the menu, so move them out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
a84040ab |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor file selection handling eficonfig_select_file_handler() is commonly used to select the file. eficonfig_display_select_file_option() adds an additional menu to clear the selected file. eficonfig_display_select_file_option() is not always necessary for the file selection process, so it must be outside of eficonfig_select_file_handler(). This commit also renames the following functions to avoid confusion. eficonfig_select_file_handler() -> eficonfig_process_select_file() eficonfig_select_file() -> eficonfig_show_file_selection() eficonfig_display_select_file_option() -> eficonfig_process_show_file_option() Finally, test_eficonfig.py need to be updated to get aligned with the above modification. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
1167e88a |
|
14-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix missing variable initialization The 'ret' variable must be initialized before use in eficonfig_delete_invalid_boot_option(). Fixes: c416f1c0bc ("bootmenu: add removable media entries") Addresses-Coverity: 376207 ("Uninitialized variables") Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
3d595ac5 |
|
09-Nov-2022 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: remove superfluous if in eficonfig_edit_boot_option Goto for an immediately succeeding label is superfluous. Fixes: 87d791423ac6 ("eficonfig: menu-driven addition of UEFI boot option") Addresses-Coverity: 376202 ("Identical code for different branches") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
f19171c9 |
|
08-Jan-2024 |
Ilias Apalodimas <ilias.apalodimas@linaro.org> |
efi_loader: Clean up efi_dp_append and efi_dp_concat Looking back at the initrd storing functionality, we introduced three functions, efi_dp_append_or_concatenate(), efi_dp_append/concat(). In hindsight we could have simplified that by a lot. First of all none of the functions append anything. They all allocate a new device path and concatenate the contents of two device paths in one. A boolean parameter controls the final device path -- if that's true an end node is injected between the two device paths. So let's rewrite this and make it a bit easier to read. Get rid of efi_dp_append(), efi_dp_concat() and rename efi_dp_append_or_concatenate() to efi_dp_concat(). This is far more intuitive and the only adjustment that is needed is an extra boolean argument on all callsites. Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
64658007 |
|
17-Nov-2023 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: eficonfig: create shortened boot options The boot options created by eficonfig should use shortened device-paths to avoid problems if drives are enumerated in a different sequence. Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
9945bc4f |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Fix incorrect return code of boot option update Correct the return code for out-of-memory and no boot option found Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
339b527b |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Move bootorder and bootoption apis to lib Rename and move bootorder and bootoption apis from cmd to lib for re-use between eficonfig and bootmgr Fix 'unexpected indentation' when 'make htmldocs' after functions are moved Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
2c0b0c31 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_SECURE_BOOT This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_SECURE_BOOT defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
83f3d121 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_MM_COMM_TEE This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_MM_COMM_TEE defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
88df3634 |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: CTRL+S to save the boot order 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>
|
#
45f5319f |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
menu: remove CTRL+C to quit On the sandbox called without "--terminal raw" CTRL+C leaves U-Boot, "ESC/CTRL+C to quit" is misleading. Let's remove CTRL+C to quit key handling from bootmenu and eficonfig menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
|
#
8dbd0a0f |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add vertical scroll support The current eficonfig menu does not support vertical scroll, so it can not display the menu entries greater than the console row size. This commit add the vertial scroll support. The console size is retrieved by SIMPLE_TEXT_OUTPUT_PROTOCOL.QueryMode() service, then calculates the row size for menu entry by subtracting menu header and description row size from the console row size. "start" and "end" are added in the efimenu structure. "start" keeps the menu entry index at the top, "end" keeps the bottom menu entry index. item_data_print() menu function only draws the menu entry between "start" and "end". This commit also fixes the issue that "Save" and "Quit" entries can be moved by BKEY_PLUS in change boot order menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
0d590852 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation This commit removes the change boot order specific menu implementation. The change boot order implementation calls eficonfig_process_common() same as other menus. The change boot order menu requires own item_data_print and item_choice implementation, but display_statusline function can be a same function as other menus. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
cd160b27 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor eficonfig_process_common function Current change boot order implementation does not call eficonfig_process_common() and call own menu functions for display_statusline, item_data_print and item_choice. Change boot order functionality should call eficonfig_process_common() to improve maintenanceability. This commit is a preparation to remove the change boot order specific implementation. The menu functions (display_statusline, item_data_print and item_choice) are added as argument of eficonfig_process_common(). The menu description string displayed at the bottom of the menu is also added as argument. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
32bab0ea |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Make use of CLI character processing Avoid duplicating some of the escape-sequence processing here and use the CLI function instead. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
d0ca98db |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Update bootmenu_loop() to return the code Use the return value to save having to pass around a pointer. This also resolves any ambiguity about what *key contains when the function is called. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
2da4a15e |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Rename KEY_... to BKEY_... This enum values conflict with linux/input.h so rename them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
64550274 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: avoid SetVariable between GetNextVariableName calls The current code calls efi_set_variable_int() to delete the invalid boot option between calls to efi_get_next_variable_name_int(), it may produce unpredictable results. This commit moves removal of the invalid boot option outside of the efi_get_next_variable_name_int() calls. EFI_NOT_FOUND returned from efi_get_next_variable_name_int() indicates we retrieved all EFI variables, it should be treated as EFI_SUCEESS. To address the checkpatch warning of too many leading tabs, combine two if statement into one. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
ce327084 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: carve out efi_get_next_variable_name_int calls To retrieve the EFI variable name by efi_get_next_variable_name_int(), the sequence of alloc -> efi_get_next_variable_name_int -> realloc -> efi_get_next_variable_name_int is required. In current code, this sequence repeatedly appears in the several functions. It should be curved out a common function. This commit also fixes the missing free() of var_name16 in eficonfig_delete_invalid_boot_option(). Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
140a8959 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use efi_get_next_variable_name_int() eficonfig command reads all possible UEFI load options from 0x0000 to 0xFFFF to construct the menu. This takes too much time in some environment. This commit uses efi_get_next_variable_name_int() to read all existing UEFI load options to significantlly reduce the count of efi_get_var() call. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
78b1ccc4 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use u16_strsize() to get u16 string buffer size Use u16_strsize() to simplify the u16 string buffer size calculation. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c67d3c9e |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix going one directory up issue The directory name in eficonfig menu entry contains the '\' separator. strcmp() argument ".." is wrong and one directory up handling does not work correctly. strcmp() argument must include '\' separator. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c3b5af63 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add UEFI Secure Boot Key enrollment interface This commit adds the menu-driven UEFI Secure Boot Key enrollment interface. User can enroll PK, KEK, db and dbx by selecting file. Only the signed EFI Signature List(s) with an authenticated header, typically '.auth' file, is accepted. To clear the PK, KEK, db and dbx, user needs to enroll the null key signed by PK or KEK. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
21faf4ef |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use protocol interface for file selection EFI_SIMPLE_FILE_SYSTEM_PROTOCOL is not always provided by U-Boot. Use protocol interface functions instead of U-Boot internal functions. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d6566113 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose eficonfig_create_device_path() Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use eficonfig_create_device_path() to construct the full device path from device path of the volume and file path, so move it out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d571f9b2 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation All the eficonfig menus other than "Change Boot Order" use 'eficonfig_entry' structure for each menu entry. This commit refactors change boot order implementation to use 'eficonfig_entry' structure same as other menus to have consistent menu handling. This commit also simplifies the data->active handling when KEY_SPACE is pressed, and sizeof() parameter. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
8961e93e |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose append entry function Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use append_entry() and append_quit_entry() to construct the menu, so move them out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
a84040ab |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor file selection handling eficonfig_select_file_handler() is commonly used to select the file. eficonfig_display_select_file_option() adds an additional menu to clear the selected file. eficonfig_display_select_file_option() is not always necessary for the file selection process, so it must be outside of eficonfig_select_file_handler(). This commit also renames the following functions to avoid confusion. eficonfig_select_file_handler() -> eficonfig_process_select_file() eficonfig_select_file() -> eficonfig_show_file_selection() eficonfig_display_select_file_option() -> eficonfig_process_show_file_option() Finally, test_eficonfig.py need to be updated to get aligned with the above modification. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
1167e88a |
|
14-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix missing variable initialization The 'ret' variable must be initialized before use in eficonfig_delete_invalid_boot_option(). Fixes: c416f1c0bc ("bootmenu: add removable media entries") Addresses-Coverity: 376207 ("Uninitialized variables") Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
3d595ac5 |
|
09-Nov-2022 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: remove superfluous if in eficonfig_edit_boot_option Goto for an immediately succeeding label is superfluous. Fixes: 87d791423ac6 ("eficonfig: menu-driven addition of UEFI boot option") Addresses-Coverity: 376202 ("Identical code for different branches") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
f19171c9 |
|
08-Jan-2024 |
Ilias Apalodimas <ilias.apalodimas@linaro.org> |
efi_loader: Clean up efi_dp_append and efi_dp_concat Looking back at the initrd storing functionality, we introduced three functions, efi_dp_append_or_concatenate(), efi_dp_append/concat(). In hindsight we could have simplified that by a lot. First of all none of the functions append anything. They all allocate a new device path and concatenate the contents of two device paths in one. A boolean parameter controls the final device path -- if that's true an end node is injected between the two device paths. So let's rewrite this and make it a bit easier to read. Get rid of efi_dp_append(), efi_dp_concat() and rename efi_dp_append_or_concatenate() to efi_dp_concat(). This is far more intuitive and the only adjustment that is needed is an extra boolean argument on all callsites. Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
64658007 |
|
17-Nov-2023 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: eficonfig: create shortened boot options The boot options created by eficonfig should use shortened device-paths to avoid problems if drives are enumerated in a different sequence. Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
9945bc4f |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Fix incorrect return code of boot option update Correct the return code for out-of-memory and no boot option found Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
339b527b |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Move bootorder and bootoption apis to lib Rename and move bootorder and bootoption apis from cmd to lib for re-use between eficonfig and bootmgr Fix 'unexpected indentation' when 'make htmldocs' after functions are moved Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
2c0b0c31 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_SECURE_BOOT This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_SECURE_BOOT defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
83f3d121 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_MM_COMM_TEE This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_MM_COMM_TEE defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
88df3634 |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: CTRL+S to save the boot order 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>
|
#
45f5319f |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
menu: remove CTRL+C to quit On the sandbox called without "--terminal raw" CTRL+C leaves U-Boot, "ESC/CTRL+C to quit" is misleading. Let's remove CTRL+C to quit key handling from bootmenu and eficonfig menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
|
#
8dbd0a0f |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add vertical scroll support The current eficonfig menu does not support vertical scroll, so it can not display the menu entries greater than the console row size. This commit add the vertial scroll support. The console size is retrieved by SIMPLE_TEXT_OUTPUT_PROTOCOL.QueryMode() service, then calculates the row size for menu entry by subtracting menu header and description row size from the console row size. "start" and "end" are added in the efimenu structure. "start" keeps the menu entry index at the top, "end" keeps the bottom menu entry index. item_data_print() menu function only draws the menu entry between "start" and "end". This commit also fixes the issue that "Save" and "Quit" entries can be moved by BKEY_PLUS in change boot order menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
0d590852 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation This commit removes the change boot order specific menu implementation. The change boot order implementation calls eficonfig_process_common() same as other menus. The change boot order menu requires own item_data_print and item_choice implementation, but display_statusline function can be a same function as other menus. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
cd160b27 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor eficonfig_process_common function Current change boot order implementation does not call eficonfig_process_common() and call own menu functions for display_statusline, item_data_print and item_choice. Change boot order functionality should call eficonfig_process_common() to improve maintenanceability. This commit is a preparation to remove the change boot order specific implementation. The menu functions (display_statusline, item_data_print and item_choice) are added as argument of eficonfig_process_common(). The menu description string displayed at the bottom of the menu is also added as argument. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
32bab0ea |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Make use of CLI character processing Avoid duplicating some of the escape-sequence processing here and use the CLI function instead. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
d0ca98db |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Update bootmenu_loop() to return the code Use the return value to save having to pass around a pointer. This also resolves any ambiguity about what *key contains when the function is called. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
2da4a15e |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Rename KEY_... to BKEY_... This enum values conflict with linux/input.h so rename them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
64550274 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: avoid SetVariable between GetNextVariableName calls The current code calls efi_set_variable_int() to delete the invalid boot option between calls to efi_get_next_variable_name_int(), it may produce unpredictable results. This commit moves removal of the invalid boot option outside of the efi_get_next_variable_name_int() calls. EFI_NOT_FOUND returned from efi_get_next_variable_name_int() indicates we retrieved all EFI variables, it should be treated as EFI_SUCEESS. To address the checkpatch warning of too many leading tabs, combine two if statement into one. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
ce327084 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: carve out efi_get_next_variable_name_int calls To retrieve the EFI variable name by efi_get_next_variable_name_int(), the sequence of alloc -> efi_get_next_variable_name_int -> realloc -> efi_get_next_variable_name_int is required. In current code, this sequence repeatedly appears in the several functions. It should be curved out a common function. This commit also fixes the missing free() of var_name16 in eficonfig_delete_invalid_boot_option(). Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
140a8959 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use efi_get_next_variable_name_int() eficonfig command reads all possible UEFI load options from 0x0000 to 0xFFFF to construct the menu. This takes too much time in some environment. This commit uses efi_get_next_variable_name_int() to read all existing UEFI load options to significantlly reduce the count of efi_get_var() call. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
78b1ccc4 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use u16_strsize() to get u16 string buffer size Use u16_strsize() to simplify the u16 string buffer size calculation. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c67d3c9e |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix going one directory up issue The directory name in eficonfig menu entry contains the '\' separator. strcmp() argument ".." is wrong and one directory up handling does not work correctly. strcmp() argument must include '\' separator. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c3b5af63 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add UEFI Secure Boot Key enrollment interface This commit adds the menu-driven UEFI Secure Boot Key enrollment interface. User can enroll PK, KEK, db and dbx by selecting file. Only the signed EFI Signature List(s) with an authenticated header, typically '.auth' file, is accepted. To clear the PK, KEK, db and dbx, user needs to enroll the null key signed by PK or KEK. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
21faf4ef |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use protocol interface for file selection EFI_SIMPLE_FILE_SYSTEM_PROTOCOL is not always provided by U-Boot. Use protocol interface functions instead of U-Boot internal functions. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d6566113 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose eficonfig_create_device_path() Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use eficonfig_create_device_path() to construct the full device path from device path of the volume and file path, so move it out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d571f9b2 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation All the eficonfig menus other than "Change Boot Order" use 'eficonfig_entry' structure for each menu entry. This commit refactors change boot order implementation to use 'eficonfig_entry' structure same as other menus to have consistent menu handling. This commit also simplifies the data->active handling when KEY_SPACE is pressed, and sizeof() parameter. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
8961e93e |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose append entry function Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use append_entry() and append_quit_entry() to construct the menu, so move them out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
a84040ab |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor file selection handling eficonfig_select_file_handler() is commonly used to select the file. eficonfig_display_select_file_option() adds an additional menu to clear the selected file. eficonfig_display_select_file_option() is not always necessary for the file selection process, so it must be outside of eficonfig_select_file_handler(). This commit also renames the following functions to avoid confusion. eficonfig_select_file_handler() -> eficonfig_process_select_file() eficonfig_select_file() -> eficonfig_show_file_selection() eficonfig_display_select_file_option() -> eficonfig_process_show_file_option() Finally, test_eficonfig.py need to be updated to get aligned with the above modification. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
1167e88a |
|
14-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix missing variable initialization The 'ret' variable must be initialized before use in eficonfig_delete_invalid_boot_option(). Fixes: c416f1c0bc ("bootmenu: add removable media entries") Addresses-Coverity: 376207 ("Uninitialized variables") Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
3d595ac5 |
|
09-Nov-2022 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: remove superfluous if in eficonfig_edit_boot_option Goto for an immediately succeeding label is superfluous. Fixes: 87d791423ac6 ("eficonfig: menu-driven addition of UEFI boot option") Addresses-Coverity: 376202 ("Identical code for different branches") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
f19171c9 |
|
08-Jan-2024 |
Ilias Apalodimas <ilias.apalodimas@linaro.org> |
efi_loader: Clean up efi_dp_append and efi_dp_concat Looking back at the initrd storing functionality, we introduced three functions, efi_dp_append_or_concatenate(), efi_dp_append/concat(). In hindsight we could have simplified that by a lot. First of all none of the functions append anything. They all allocate a new device path and concatenate the contents of two device paths in one. A boolean parameter controls the final device path -- if that's true an end node is injected between the two device paths. So let's rewrite this and make it a bit easier to read. Get rid of efi_dp_append(), efi_dp_concat() and rename efi_dp_append_or_concatenate() to efi_dp_concat(). This is far more intuitive and the only adjustment that is needed is an extra boolean argument on all callsites. Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
64658007 |
|
17-Nov-2023 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: eficonfig: create shortened boot options The boot options created by eficonfig should use shortened device-paths to avoid problems if drives are enumerated in a different sequence. Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
9945bc4f |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Fix incorrect return code of boot option update Correct the return code for out-of-memory and no boot option found Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
339b527b |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Move bootorder and bootoption apis to lib Rename and move bootorder and bootoption apis from cmd to lib for re-use between eficonfig and bootmgr Fix 'unexpected indentation' when 'make htmldocs' after functions are moved Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
2c0b0c31 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_SECURE_BOOT This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_SECURE_BOOT defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
83f3d121 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_MM_COMM_TEE This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_MM_COMM_TEE defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
88df3634 |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: CTRL+S to save the boot order 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>
|
#
45f5319f |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
menu: remove CTRL+C to quit On the sandbox called without "--terminal raw" CTRL+C leaves U-Boot, "ESC/CTRL+C to quit" is misleading. Let's remove CTRL+C to quit key handling from bootmenu and eficonfig menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
|
#
8dbd0a0f |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add vertical scroll support The current eficonfig menu does not support vertical scroll, so it can not display the menu entries greater than the console row size. This commit add the vertial scroll support. The console size is retrieved by SIMPLE_TEXT_OUTPUT_PROTOCOL.QueryMode() service, then calculates the row size for menu entry by subtracting menu header and description row size from the console row size. "start" and "end" are added in the efimenu structure. "start" keeps the menu entry index at the top, "end" keeps the bottom menu entry index. item_data_print() menu function only draws the menu entry between "start" and "end". This commit also fixes the issue that "Save" and "Quit" entries can be moved by BKEY_PLUS in change boot order menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
0d590852 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation This commit removes the change boot order specific menu implementation. The change boot order implementation calls eficonfig_process_common() same as other menus. The change boot order menu requires own item_data_print and item_choice implementation, but display_statusline function can be a same function as other menus. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
cd160b27 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor eficonfig_process_common function Current change boot order implementation does not call eficonfig_process_common() and call own menu functions for display_statusline, item_data_print and item_choice. Change boot order functionality should call eficonfig_process_common() to improve maintenanceability. This commit is a preparation to remove the change boot order specific implementation. The menu functions (display_statusline, item_data_print and item_choice) are added as argument of eficonfig_process_common(). The menu description string displayed at the bottom of the menu is also added as argument. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
32bab0ea |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Make use of CLI character processing Avoid duplicating some of the escape-sequence processing here and use the CLI function instead. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
d0ca98db |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Update bootmenu_loop() to return the code Use the return value to save having to pass around a pointer. This also resolves any ambiguity about what *key contains when the function is called. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
2da4a15e |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Rename KEY_... to BKEY_... This enum values conflict with linux/input.h so rename them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
64550274 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: avoid SetVariable between GetNextVariableName calls The current code calls efi_set_variable_int() to delete the invalid boot option between calls to efi_get_next_variable_name_int(), it may produce unpredictable results. This commit moves removal of the invalid boot option outside of the efi_get_next_variable_name_int() calls. EFI_NOT_FOUND returned from efi_get_next_variable_name_int() indicates we retrieved all EFI variables, it should be treated as EFI_SUCEESS. To address the checkpatch warning of too many leading tabs, combine two if statement into one. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
ce327084 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: carve out efi_get_next_variable_name_int calls To retrieve the EFI variable name by efi_get_next_variable_name_int(), the sequence of alloc -> efi_get_next_variable_name_int -> realloc -> efi_get_next_variable_name_int is required. In current code, this sequence repeatedly appears in the several functions. It should be curved out a common function. This commit also fixes the missing free() of var_name16 in eficonfig_delete_invalid_boot_option(). Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
140a8959 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use efi_get_next_variable_name_int() eficonfig command reads all possible UEFI load options from 0x0000 to 0xFFFF to construct the menu. This takes too much time in some environment. This commit uses efi_get_next_variable_name_int() to read all existing UEFI load options to significantlly reduce the count of efi_get_var() call. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
78b1ccc4 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use u16_strsize() to get u16 string buffer size Use u16_strsize() to simplify the u16 string buffer size calculation. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c67d3c9e |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix going one directory up issue The directory name in eficonfig menu entry contains the '\' separator. strcmp() argument ".." is wrong and one directory up handling does not work correctly. strcmp() argument must include '\' separator. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c3b5af63 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add UEFI Secure Boot Key enrollment interface This commit adds the menu-driven UEFI Secure Boot Key enrollment interface. User can enroll PK, KEK, db and dbx by selecting file. Only the signed EFI Signature List(s) with an authenticated header, typically '.auth' file, is accepted. To clear the PK, KEK, db and dbx, user needs to enroll the null key signed by PK or KEK. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
21faf4ef |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use protocol interface for file selection EFI_SIMPLE_FILE_SYSTEM_PROTOCOL is not always provided by U-Boot. Use protocol interface functions instead of U-Boot internal functions. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d6566113 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose eficonfig_create_device_path() Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use eficonfig_create_device_path() to construct the full device path from device path of the volume and file path, so move it out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d571f9b2 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation All the eficonfig menus other than "Change Boot Order" use 'eficonfig_entry' structure for each menu entry. This commit refactors change boot order implementation to use 'eficonfig_entry' structure same as other menus to have consistent menu handling. This commit also simplifies the data->active handling when KEY_SPACE is pressed, and sizeof() parameter. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
8961e93e |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose append entry function Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use append_entry() and append_quit_entry() to construct the menu, so move them out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
a84040ab |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor file selection handling eficonfig_select_file_handler() is commonly used to select the file. eficonfig_display_select_file_option() adds an additional menu to clear the selected file. eficonfig_display_select_file_option() is not always necessary for the file selection process, so it must be outside of eficonfig_select_file_handler(). This commit also renames the following functions to avoid confusion. eficonfig_select_file_handler() -> eficonfig_process_select_file() eficonfig_select_file() -> eficonfig_show_file_selection() eficonfig_display_select_file_option() -> eficonfig_process_show_file_option() Finally, test_eficonfig.py need to be updated to get aligned with the above modification. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
1167e88a |
|
14-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix missing variable initialization The 'ret' variable must be initialized before use in eficonfig_delete_invalid_boot_option(). Fixes: c416f1c0bc ("bootmenu: add removable media entries") Addresses-Coverity: 376207 ("Uninitialized variables") Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
3d595ac5 |
|
09-Nov-2022 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: remove superfluous if in eficonfig_edit_boot_option Goto for an immediately succeeding label is superfluous. Fixes: 87d791423ac6 ("eficonfig: menu-driven addition of UEFI boot option") Addresses-Coverity: 376202 ("Identical code for different branches") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
f19171c9 |
|
08-Jan-2024 |
Ilias Apalodimas <ilias.apalodimas@linaro.org> |
efi_loader: Clean up efi_dp_append and efi_dp_concat Looking back at the initrd storing functionality, we introduced three functions, efi_dp_append_or_concatenate(), efi_dp_append/concat(). In hindsight we could have simplified that by a lot. First of all none of the functions append anything. They all allocate a new device path and concatenate the contents of two device paths in one. A boolean parameter controls the final device path -- if that's true an end node is injected between the two device paths. So let's rewrite this and make it a bit easier to read. Get rid of efi_dp_append(), efi_dp_concat() and rename efi_dp_append_or_concatenate() to efi_dp_concat(). This is far more intuitive and the only adjustment that is needed is an extra boolean argument on all callsites. Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
64658007 |
|
17-Nov-2023 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: eficonfig: create shortened boot options The boot options created by eficonfig should use shortened device-paths to avoid problems if drives are enumerated in a different sequence. Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
9945bc4f |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Fix incorrect return code of boot option update Correct the return code for out-of-memory and no boot option found Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
339b527b |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Move bootorder and bootoption apis to lib Rename and move bootorder and bootoption apis from cmd to lib for re-use between eficonfig and bootmgr Fix 'unexpected indentation' when 'make htmldocs' after functions are moved Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
2c0b0c31 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_SECURE_BOOT This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_SECURE_BOOT defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
83f3d121 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_MM_COMM_TEE This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_MM_COMM_TEE defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
88df3634 |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: CTRL+S to save the boot order 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>
|
#
45f5319f |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
menu: remove CTRL+C to quit On the sandbox called without "--terminal raw" CTRL+C leaves U-Boot, "ESC/CTRL+C to quit" is misleading. Let's remove CTRL+C to quit key handling from bootmenu and eficonfig menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
|
#
8dbd0a0f |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add vertical scroll support The current eficonfig menu does not support vertical scroll, so it can not display the menu entries greater than the console row size. This commit add the vertial scroll support. The console size is retrieved by SIMPLE_TEXT_OUTPUT_PROTOCOL.QueryMode() service, then calculates the row size for menu entry by subtracting menu header and description row size from the console row size. "start" and "end" are added in the efimenu structure. "start" keeps the menu entry index at the top, "end" keeps the bottom menu entry index. item_data_print() menu function only draws the menu entry between "start" and "end". This commit also fixes the issue that "Save" and "Quit" entries can be moved by BKEY_PLUS in change boot order menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
0d590852 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation This commit removes the change boot order specific menu implementation. The change boot order implementation calls eficonfig_process_common() same as other menus. The change boot order menu requires own item_data_print and item_choice implementation, but display_statusline function can be a same function as other menus. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
cd160b27 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor eficonfig_process_common function Current change boot order implementation does not call eficonfig_process_common() and call own menu functions for display_statusline, item_data_print and item_choice. Change boot order functionality should call eficonfig_process_common() to improve maintenanceability. This commit is a preparation to remove the change boot order specific implementation. The menu functions (display_statusline, item_data_print and item_choice) are added as argument of eficonfig_process_common(). The menu description string displayed at the bottom of the menu is also added as argument. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
32bab0ea |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Make use of CLI character processing Avoid duplicating some of the escape-sequence processing here and use the CLI function instead. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
d0ca98db |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Update bootmenu_loop() to return the code Use the return value to save having to pass around a pointer. This also resolves any ambiguity about what *key contains when the function is called. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
2da4a15e |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Rename KEY_... to BKEY_... This enum values conflict with linux/input.h so rename them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
64550274 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: avoid SetVariable between GetNextVariableName calls The current code calls efi_set_variable_int() to delete the invalid boot option between calls to efi_get_next_variable_name_int(), it may produce unpredictable results. This commit moves removal of the invalid boot option outside of the efi_get_next_variable_name_int() calls. EFI_NOT_FOUND returned from efi_get_next_variable_name_int() indicates we retrieved all EFI variables, it should be treated as EFI_SUCEESS. To address the checkpatch warning of too many leading tabs, combine two if statement into one. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
ce327084 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: carve out efi_get_next_variable_name_int calls To retrieve the EFI variable name by efi_get_next_variable_name_int(), the sequence of alloc -> efi_get_next_variable_name_int -> realloc -> efi_get_next_variable_name_int is required. In current code, this sequence repeatedly appears in the several functions. It should be curved out a common function. This commit also fixes the missing free() of var_name16 in eficonfig_delete_invalid_boot_option(). Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
140a8959 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use efi_get_next_variable_name_int() eficonfig command reads all possible UEFI load options from 0x0000 to 0xFFFF to construct the menu. This takes too much time in some environment. This commit uses efi_get_next_variable_name_int() to read all existing UEFI load options to significantlly reduce the count of efi_get_var() call. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
78b1ccc4 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use u16_strsize() to get u16 string buffer size Use u16_strsize() to simplify the u16 string buffer size calculation. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c67d3c9e |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix going one directory up issue The directory name in eficonfig menu entry contains the '\' separator. strcmp() argument ".." is wrong and one directory up handling does not work correctly. strcmp() argument must include '\' separator. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c3b5af63 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add UEFI Secure Boot Key enrollment interface This commit adds the menu-driven UEFI Secure Boot Key enrollment interface. User can enroll PK, KEK, db and dbx by selecting file. Only the signed EFI Signature List(s) with an authenticated header, typically '.auth' file, is accepted. To clear the PK, KEK, db and dbx, user needs to enroll the null key signed by PK or KEK. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
21faf4ef |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use protocol interface for file selection EFI_SIMPLE_FILE_SYSTEM_PROTOCOL is not always provided by U-Boot. Use protocol interface functions instead of U-Boot internal functions. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d6566113 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose eficonfig_create_device_path() Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use eficonfig_create_device_path() to construct the full device path from device path of the volume and file path, so move it out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d571f9b2 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation All the eficonfig menus other than "Change Boot Order" use 'eficonfig_entry' structure for each menu entry. This commit refactors change boot order implementation to use 'eficonfig_entry' structure same as other menus to have consistent menu handling. This commit also simplifies the data->active handling when KEY_SPACE is pressed, and sizeof() parameter. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
8961e93e |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose append entry function Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use append_entry() and append_quit_entry() to construct the menu, so move them out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
a84040ab |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor file selection handling eficonfig_select_file_handler() is commonly used to select the file. eficonfig_display_select_file_option() adds an additional menu to clear the selected file. eficonfig_display_select_file_option() is not always necessary for the file selection process, so it must be outside of eficonfig_select_file_handler(). This commit also renames the following functions to avoid confusion. eficonfig_select_file_handler() -> eficonfig_process_select_file() eficonfig_select_file() -> eficonfig_show_file_selection() eficonfig_display_select_file_option() -> eficonfig_process_show_file_option() Finally, test_eficonfig.py need to be updated to get aligned with the above modification. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
1167e88a |
|
14-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix missing variable initialization The 'ret' variable must be initialized before use in eficonfig_delete_invalid_boot_option(). Fixes: c416f1c0bc ("bootmenu: add removable media entries") Addresses-Coverity: 376207 ("Uninitialized variables") Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
3d595ac5 |
|
09-Nov-2022 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: remove superfluous if in eficonfig_edit_boot_option Goto for an immediately succeeding label is superfluous. Fixes: 87d791423ac6 ("eficonfig: menu-driven addition of UEFI boot option") Addresses-Coverity: 376202 ("Identical code for different branches") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
f19171c9 |
|
08-Jan-2024 |
Ilias Apalodimas <ilias.apalodimas@linaro.org> |
efi_loader: Clean up efi_dp_append and efi_dp_concat Looking back at the initrd storing functionality, we introduced three functions, efi_dp_append_or_concatenate(), efi_dp_append/concat(). In hindsight we could have simplified that by a lot. First of all none of the functions append anything. They all allocate a new device path and concatenate the contents of two device paths in one. A boolean parameter controls the final device path -- if that's true an end node is injected between the two device paths. So let's rewrite this and make it a bit easier to read. Get rid of efi_dp_append(), efi_dp_concat() and rename efi_dp_append_or_concatenate() to efi_dp_concat(). This is far more intuitive and the only adjustment that is needed is an extra boolean argument on all callsites. Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
64658007 |
|
17-Nov-2023 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: eficonfig: create shortened boot options The boot options created by eficonfig should use shortened device-paths to avoid problems if drives are enumerated in a different sequence. Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
9945bc4f |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Fix incorrect return code of boot option update Correct the return code for out-of-memory and no boot option found Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
339b527b |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Move bootorder and bootoption apis to lib Rename and move bootorder and bootoption apis from cmd to lib for re-use between eficonfig and bootmgr Fix 'unexpected indentation' when 'make htmldocs' after functions are moved Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
2c0b0c31 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_SECURE_BOOT This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_SECURE_BOOT defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
83f3d121 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_MM_COMM_TEE This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_MM_COMM_TEE defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
88df3634 |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: CTRL+S to save the boot order 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>
|
#
45f5319f |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
menu: remove CTRL+C to quit On the sandbox called without "--terminal raw" CTRL+C leaves U-Boot, "ESC/CTRL+C to quit" is misleading. Let's remove CTRL+C to quit key handling from bootmenu and eficonfig menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
|
#
8dbd0a0f |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add vertical scroll support The current eficonfig menu does not support vertical scroll, so it can not display the menu entries greater than the console row size. This commit add the vertial scroll support. The console size is retrieved by SIMPLE_TEXT_OUTPUT_PROTOCOL.QueryMode() service, then calculates the row size for menu entry by subtracting menu header and description row size from the console row size. "start" and "end" are added in the efimenu structure. "start" keeps the menu entry index at the top, "end" keeps the bottom menu entry index. item_data_print() menu function only draws the menu entry between "start" and "end". This commit also fixes the issue that "Save" and "Quit" entries can be moved by BKEY_PLUS in change boot order menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
0d590852 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation This commit removes the change boot order specific menu implementation. The change boot order implementation calls eficonfig_process_common() same as other menus. The change boot order menu requires own item_data_print and item_choice implementation, but display_statusline function can be a same function as other menus. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
cd160b27 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor eficonfig_process_common function Current change boot order implementation does not call eficonfig_process_common() and call own menu functions for display_statusline, item_data_print and item_choice. Change boot order functionality should call eficonfig_process_common() to improve maintenanceability. This commit is a preparation to remove the change boot order specific implementation. The menu functions (display_statusline, item_data_print and item_choice) are added as argument of eficonfig_process_common(). The menu description string displayed at the bottom of the menu is also added as argument. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
32bab0ea |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Make use of CLI character processing Avoid duplicating some of the escape-sequence processing here and use the CLI function instead. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
d0ca98db |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Update bootmenu_loop() to return the code Use the return value to save having to pass around a pointer. This also resolves any ambiguity about what *key contains when the function is called. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
2da4a15e |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Rename KEY_... to BKEY_... This enum values conflict with linux/input.h so rename them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
64550274 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: avoid SetVariable between GetNextVariableName calls The current code calls efi_set_variable_int() to delete the invalid boot option between calls to efi_get_next_variable_name_int(), it may produce unpredictable results. This commit moves removal of the invalid boot option outside of the efi_get_next_variable_name_int() calls. EFI_NOT_FOUND returned from efi_get_next_variable_name_int() indicates we retrieved all EFI variables, it should be treated as EFI_SUCEESS. To address the checkpatch warning of too many leading tabs, combine two if statement into one. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
ce327084 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: carve out efi_get_next_variable_name_int calls To retrieve the EFI variable name by efi_get_next_variable_name_int(), the sequence of alloc -> efi_get_next_variable_name_int -> realloc -> efi_get_next_variable_name_int is required. In current code, this sequence repeatedly appears in the several functions. It should be curved out a common function. This commit also fixes the missing free() of var_name16 in eficonfig_delete_invalid_boot_option(). Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
140a8959 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use efi_get_next_variable_name_int() eficonfig command reads all possible UEFI load options from 0x0000 to 0xFFFF to construct the menu. This takes too much time in some environment. This commit uses efi_get_next_variable_name_int() to read all existing UEFI load options to significantlly reduce the count of efi_get_var() call. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
78b1ccc4 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use u16_strsize() to get u16 string buffer size Use u16_strsize() to simplify the u16 string buffer size calculation. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c67d3c9e |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix going one directory up issue The directory name in eficonfig menu entry contains the '\' separator. strcmp() argument ".." is wrong and one directory up handling does not work correctly. strcmp() argument must include '\' separator. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c3b5af63 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add UEFI Secure Boot Key enrollment interface This commit adds the menu-driven UEFI Secure Boot Key enrollment interface. User can enroll PK, KEK, db and dbx by selecting file. Only the signed EFI Signature List(s) with an authenticated header, typically '.auth' file, is accepted. To clear the PK, KEK, db and dbx, user needs to enroll the null key signed by PK or KEK. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
21faf4ef |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use protocol interface for file selection EFI_SIMPLE_FILE_SYSTEM_PROTOCOL is not always provided by U-Boot. Use protocol interface functions instead of U-Boot internal functions. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d6566113 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose eficonfig_create_device_path() Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use eficonfig_create_device_path() to construct the full device path from device path of the volume and file path, so move it out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d571f9b2 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation All the eficonfig menus other than "Change Boot Order" use 'eficonfig_entry' structure for each menu entry. This commit refactors change boot order implementation to use 'eficonfig_entry' structure same as other menus to have consistent menu handling. This commit also simplifies the data->active handling when KEY_SPACE is pressed, and sizeof() parameter. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
8961e93e |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose append entry function Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use append_entry() and append_quit_entry() to construct the menu, so move them out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
a84040ab |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor file selection handling eficonfig_select_file_handler() is commonly used to select the file. eficonfig_display_select_file_option() adds an additional menu to clear the selected file. eficonfig_display_select_file_option() is not always necessary for the file selection process, so it must be outside of eficonfig_select_file_handler(). This commit also renames the following functions to avoid confusion. eficonfig_select_file_handler() -> eficonfig_process_select_file() eficonfig_select_file() -> eficonfig_show_file_selection() eficonfig_display_select_file_option() -> eficonfig_process_show_file_option() Finally, test_eficonfig.py need to be updated to get aligned with the above modification. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
1167e88a |
|
14-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix missing variable initialization The 'ret' variable must be initialized before use in eficonfig_delete_invalid_boot_option(). Fixes: c416f1c0bc ("bootmenu: add removable media entries") Addresses-Coverity: 376207 ("Uninitialized variables") Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
3d595ac5 |
|
09-Nov-2022 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: remove superfluous if in eficonfig_edit_boot_option Goto for an immediately succeeding label is superfluous. Fixes: 87d791423ac6 ("eficonfig: menu-driven addition of UEFI boot option") Addresses-Coverity: 376202 ("Identical code for different branches") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
f19171c9 |
|
08-Jan-2024 |
Ilias Apalodimas <ilias.apalodimas@linaro.org> |
efi_loader: Clean up efi_dp_append and efi_dp_concat Looking back at the initrd storing functionality, we introduced three functions, efi_dp_append_or_concatenate(), efi_dp_append/concat(). In hindsight we could have simplified that by a lot. First of all none of the functions append anything. They all allocate a new device path and concatenate the contents of two device paths in one. A boolean parameter controls the final device path -- if that's true an end node is injected between the two device paths. So let's rewrite this and make it a bit easier to read. Get rid of efi_dp_append(), efi_dp_concat() and rename efi_dp_append_or_concatenate() to efi_dp_concat(). This is far more intuitive and the only adjustment that is needed is an extra boolean argument on all callsites. Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
64658007 |
|
17-Nov-2023 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: eficonfig: create shortened boot options The boot options created by eficonfig should use shortened device-paths to avoid problems if drives are enumerated in a different sequence. Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
9945bc4f |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Fix incorrect return code of boot option update Correct the return code for out-of-memory and no boot option found Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
339b527b |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Move bootorder and bootoption apis to lib Rename and move bootorder and bootoption apis from cmd to lib for re-use between eficonfig and bootmgr Fix 'unexpected indentation' when 'make htmldocs' after functions are moved Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
2c0b0c31 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_SECURE_BOOT This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_SECURE_BOOT defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
83f3d121 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_MM_COMM_TEE This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_MM_COMM_TEE defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
88df3634 |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: CTRL+S to save the boot order 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>
|
#
45f5319f |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
menu: remove CTRL+C to quit On the sandbox called without "--terminal raw" CTRL+C leaves U-Boot, "ESC/CTRL+C to quit" is misleading. Let's remove CTRL+C to quit key handling from bootmenu and eficonfig menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
|
#
8dbd0a0f |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add vertical scroll support The current eficonfig menu does not support vertical scroll, so it can not display the menu entries greater than the console row size. This commit add the vertial scroll support. The console size is retrieved by SIMPLE_TEXT_OUTPUT_PROTOCOL.QueryMode() service, then calculates the row size for menu entry by subtracting menu header and description row size from the console row size. "start" and "end" are added in the efimenu structure. "start" keeps the menu entry index at the top, "end" keeps the bottom menu entry index. item_data_print() menu function only draws the menu entry between "start" and "end". This commit also fixes the issue that "Save" and "Quit" entries can be moved by BKEY_PLUS in change boot order menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
0d590852 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation This commit removes the change boot order specific menu implementation. The change boot order implementation calls eficonfig_process_common() same as other menus. The change boot order menu requires own item_data_print and item_choice implementation, but display_statusline function can be a same function as other menus. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
cd160b27 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor eficonfig_process_common function Current change boot order implementation does not call eficonfig_process_common() and call own menu functions for display_statusline, item_data_print and item_choice. Change boot order functionality should call eficonfig_process_common() to improve maintenanceability. This commit is a preparation to remove the change boot order specific implementation. The menu functions (display_statusline, item_data_print and item_choice) are added as argument of eficonfig_process_common(). The menu description string displayed at the bottom of the menu is also added as argument. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
32bab0ea |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Make use of CLI character processing Avoid duplicating some of the escape-sequence processing here and use the CLI function instead. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
d0ca98db |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Update bootmenu_loop() to return the code Use the return value to save having to pass around a pointer. This also resolves any ambiguity about what *key contains when the function is called. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
2da4a15e |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Rename KEY_... to BKEY_... This enum values conflict with linux/input.h so rename them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
64550274 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: avoid SetVariable between GetNextVariableName calls The current code calls efi_set_variable_int() to delete the invalid boot option between calls to efi_get_next_variable_name_int(), it may produce unpredictable results. This commit moves removal of the invalid boot option outside of the efi_get_next_variable_name_int() calls. EFI_NOT_FOUND returned from efi_get_next_variable_name_int() indicates we retrieved all EFI variables, it should be treated as EFI_SUCEESS. To address the checkpatch warning of too many leading tabs, combine two if statement into one. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
ce327084 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: carve out efi_get_next_variable_name_int calls To retrieve the EFI variable name by efi_get_next_variable_name_int(), the sequence of alloc -> efi_get_next_variable_name_int -> realloc -> efi_get_next_variable_name_int is required. In current code, this sequence repeatedly appears in the several functions. It should be curved out a common function. This commit also fixes the missing free() of var_name16 in eficonfig_delete_invalid_boot_option(). Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
140a8959 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use efi_get_next_variable_name_int() eficonfig command reads all possible UEFI load options from 0x0000 to 0xFFFF to construct the menu. This takes too much time in some environment. This commit uses efi_get_next_variable_name_int() to read all existing UEFI load options to significantlly reduce the count of efi_get_var() call. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
78b1ccc4 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use u16_strsize() to get u16 string buffer size Use u16_strsize() to simplify the u16 string buffer size calculation. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c67d3c9e |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix going one directory up issue The directory name in eficonfig menu entry contains the '\' separator. strcmp() argument ".." is wrong and one directory up handling does not work correctly. strcmp() argument must include '\' separator. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c3b5af63 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add UEFI Secure Boot Key enrollment interface This commit adds the menu-driven UEFI Secure Boot Key enrollment interface. User can enroll PK, KEK, db and dbx by selecting file. Only the signed EFI Signature List(s) with an authenticated header, typically '.auth' file, is accepted. To clear the PK, KEK, db and dbx, user needs to enroll the null key signed by PK or KEK. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
21faf4ef |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use protocol interface for file selection EFI_SIMPLE_FILE_SYSTEM_PROTOCOL is not always provided by U-Boot. Use protocol interface functions instead of U-Boot internal functions. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d6566113 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose eficonfig_create_device_path() Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use eficonfig_create_device_path() to construct the full device path from device path of the volume and file path, so move it out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d571f9b2 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation All the eficonfig menus other than "Change Boot Order" use 'eficonfig_entry' structure for each menu entry. This commit refactors change boot order implementation to use 'eficonfig_entry' structure same as other menus to have consistent menu handling. This commit also simplifies the data->active handling when KEY_SPACE is pressed, and sizeof() parameter. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
8961e93e |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose append entry function Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use append_entry() and append_quit_entry() to construct the menu, so move them out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
a84040ab |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor file selection handling eficonfig_select_file_handler() is commonly used to select the file. eficonfig_display_select_file_option() adds an additional menu to clear the selected file. eficonfig_display_select_file_option() is not always necessary for the file selection process, so it must be outside of eficonfig_select_file_handler(). This commit also renames the following functions to avoid confusion. eficonfig_select_file_handler() -> eficonfig_process_select_file() eficonfig_select_file() -> eficonfig_show_file_selection() eficonfig_display_select_file_option() -> eficonfig_process_show_file_option() Finally, test_eficonfig.py need to be updated to get aligned with the above modification. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
1167e88a |
|
14-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix missing variable initialization The 'ret' variable must be initialized before use in eficonfig_delete_invalid_boot_option(). Fixes: c416f1c0bc ("bootmenu: add removable media entries") Addresses-Coverity: 376207 ("Uninitialized variables") Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
3d595ac5 |
|
09-Nov-2022 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: remove superfluous if in eficonfig_edit_boot_option Goto for an immediately succeeding label is superfluous. Fixes: 87d791423ac6 ("eficonfig: menu-driven addition of UEFI boot option") Addresses-Coverity: 376202 ("Identical code for different branches") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
f19171c9 |
|
08-Jan-2024 |
Ilias Apalodimas <ilias.apalodimas@linaro.org> |
efi_loader: Clean up efi_dp_append and efi_dp_concat Looking back at the initrd storing functionality, we introduced three functions, efi_dp_append_or_concatenate(), efi_dp_append/concat(). In hindsight we could have simplified that by a lot. First of all none of the functions append anything. They all allocate a new device path and concatenate the contents of two device paths in one. A boolean parameter controls the final device path -- if that's true an end node is injected between the two device paths. So let's rewrite this and make it a bit easier to read. Get rid of efi_dp_append(), efi_dp_concat() and rename efi_dp_append_or_concatenate() to efi_dp_concat(). This is far more intuitive and the only adjustment that is needed is an extra boolean argument on all callsites. Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
64658007 |
|
17-Nov-2023 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: eficonfig: create shortened boot options The boot options created by eficonfig should use shortened device-paths to avoid problems if drives are enumerated in a different sequence. Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
9945bc4f |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Fix incorrect return code of boot option update Correct the return code for out-of-memory and no boot option found Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
339b527b |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Move bootorder and bootoption apis to lib Rename and move bootorder and bootoption apis from cmd to lib for re-use between eficonfig and bootmgr Fix 'unexpected indentation' when 'make htmldocs' after functions are moved Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
2c0b0c31 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_SECURE_BOOT This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_SECURE_BOOT defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
83f3d121 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_MM_COMM_TEE This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_MM_COMM_TEE defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
88df3634 |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: CTRL+S to save the boot order 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>
|
#
45f5319f |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
menu: remove CTRL+C to quit On the sandbox called without "--terminal raw" CTRL+C leaves U-Boot, "ESC/CTRL+C to quit" is misleading. Let's remove CTRL+C to quit key handling from bootmenu and eficonfig menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
|
#
8dbd0a0f |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add vertical scroll support The current eficonfig menu does not support vertical scroll, so it can not display the menu entries greater than the console row size. This commit add the vertial scroll support. The console size is retrieved by SIMPLE_TEXT_OUTPUT_PROTOCOL.QueryMode() service, then calculates the row size for menu entry by subtracting menu header and description row size from the console row size. "start" and "end" are added in the efimenu structure. "start" keeps the menu entry index at the top, "end" keeps the bottom menu entry index. item_data_print() menu function only draws the menu entry between "start" and "end". This commit also fixes the issue that "Save" and "Quit" entries can be moved by BKEY_PLUS in change boot order menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
0d590852 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation This commit removes the change boot order specific menu implementation. The change boot order implementation calls eficonfig_process_common() same as other menus. The change boot order menu requires own item_data_print and item_choice implementation, but display_statusline function can be a same function as other menus. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
cd160b27 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor eficonfig_process_common function Current change boot order implementation does not call eficonfig_process_common() and call own menu functions for display_statusline, item_data_print and item_choice. Change boot order functionality should call eficonfig_process_common() to improve maintenanceability. This commit is a preparation to remove the change boot order specific implementation. The menu functions (display_statusline, item_data_print and item_choice) are added as argument of eficonfig_process_common(). The menu description string displayed at the bottom of the menu is also added as argument. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
32bab0ea |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Make use of CLI character processing Avoid duplicating some of the escape-sequence processing here and use the CLI function instead. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
d0ca98db |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Update bootmenu_loop() to return the code Use the return value to save having to pass around a pointer. This also resolves any ambiguity about what *key contains when the function is called. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
2da4a15e |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Rename KEY_... to BKEY_... This enum values conflict with linux/input.h so rename them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
64550274 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: avoid SetVariable between GetNextVariableName calls The current code calls efi_set_variable_int() to delete the invalid boot option between calls to efi_get_next_variable_name_int(), it may produce unpredictable results. This commit moves removal of the invalid boot option outside of the efi_get_next_variable_name_int() calls. EFI_NOT_FOUND returned from efi_get_next_variable_name_int() indicates we retrieved all EFI variables, it should be treated as EFI_SUCEESS. To address the checkpatch warning of too many leading tabs, combine two if statement into one. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
ce327084 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: carve out efi_get_next_variable_name_int calls To retrieve the EFI variable name by efi_get_next_variable_name_int(), the sequence of alloc -> efi_get_next_variable_name_int -> realloc -> efi_get_next_variable_name_int is required. In current code, this sequence repeatedly appears in the several functions. It should be curved out a common function. This commit also fixes the missing free() of var_name16 in eficonfig_delete_invalid_boot_option(). Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
140a8959 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use efi_get_next_variable_name_int() eficonfig command reads all possible UEFI load options from 0x0000 to 0xFFFF to construct the menu. This takes too much time in some environment. This commit uses efi_get_next_variable_name_int() to read all existing UEFI load options to significantlly reduce the count of efi_get_var() call. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
78b1ccc4 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use u16_strsize() to get u16 string buffer size Use u16_strsize() to simplify the u16 string buffer size calculation. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c67d3c9e |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix going one directory up issue The directory name in eficonfig menu entry contains the '\' separator. strcmp() argument ".." is wrong and one directory up handling does not work correctly. strcmp() argument must include '\' separator. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c3b5af63 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add UEFI Secure Boot Key enrollment interface This commit adds the menu-driven UEFI Secure Boot Key enrollment interface. User can enroll PK, KEK, db and dbx by selecting file. Only the signed EFI Signature List(s) with an authenticated header, typically '.auth' file, is accepted. To clear the PK, KEK, db and dbx, user needs to enroll the null key signed by PK or KEK. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
21faf4ef |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use protocol interface for file selection EFI_SIMPLE_FILE_SYSTEM_PROTOCOL is not always provided by U-Boot. Use protocol interface functions instead of U-Boot internal functions. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d6566113 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose eficonfig_create_device_path() Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use eficonfig_create_device_path() to construct the full device path from device path of the volume and file path, so move it out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d571f9b2 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation All the eficonfig menus other than "Change Boot Order" use 'eficonfig_entry' structure for each menu entry. This commit refactors change boot order implementation to use 'eficonfig_entry' structure same as other menus to have consistent menu handling. This commit also simplifies the data->active handling when KEY_SPACE is pressed, and sizeof() parameter. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
8961e93e |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose append entry function Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use append_entry() and append_quit_entry() to construct the menu, so move them out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
a84040ab |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor file selection handling eficonfig_select_file_handler() is commonly used to select the file. eficonfig_display_select_file_option() adds an additional menu to clear the selected file. eficonfig_display_select_file_option() is not always necessary for the file selection process, so it must be outside of eficonfig_select_file_handler(). This commit also renames the following functions to avoid confusion. eficonfig_select_file_handler() -> eficonfig_process_select_file() eficonfig_select_file() -> eficonfig_show_file_selection() eficonfig_display_select_file_option() -> eficonfig_process_show_file_option() Finally, test_eficonfig.py need to be updated to get aligned with the above modification. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
1167e88a |
|
14-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix missing variable initialization The 'ret' variable must be initialized before use in eficonfig_delete_invalid_boot_option(). Fixes: c416f1c0bc ("bootmenu: add removable media entries") Addresses-Coverity: 376207 ("Uninitialized variables") Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
3d595ac5 |
|
09-Nov-2022 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: remove superfluous if in eficonfig_edit_boot_option Goto for an immediately succeeding label is superfluous. Fixes: 87d791423ac6 ("eficonfig: menu-driven addition of UEFI boot option") Addresses-Coverity: 376202 ("Identical code for different branches") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
f19171c9 |
|
08-Jan-2024 |
Ilias Apalodimas <ilias.apalodimas@linaro.org> |
efi_loader: Clean up efi_dp_append and efi_dp_concat Looking back at the initrd storing functionality, we introduced three functions, efi_dp_append_or_concatenate(), efi_dp_append/concat(). In hindsight we could have simplified that by a lot. First of all none of the functions append anything. They all allocate a new device path and concatenate the contents of two device paths in one. A boolean parameter controls the final device path -- if that's true an end node is injected between the two device paths. So let's rewrite this and make it a bit easier to read. Get rid of efi_dp_append(), efi_dp_concat() and rename efi_dp_append_or_concatenate() to efi_dp_concat(). This is far more intuitive and the only adjustment that is needed is an extra boolean argument on all callsites. Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
64658007 |
|
17-Nov-2023 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: eficonfig: create shortened boot options The boot options created by eficonfig should use shortened device-paths to avoid problems if drives are enumerated in a different sequence. Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
9945bc4f |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Fix incorrect return code of boot option update Correct the return code for out-of-memory and no boot option found Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
339b527b |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Move bootorder and bootoption apis to lib Rename and move bootorder and bootoption apis from cmd to lib for re-use between eficonfig and bootmgr Fix 'unexpected indentation' when 'make htmldocs' after functions are moved Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
2c0b0c31 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_SECURE_BOOT This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_SECURE_BOOT defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
83f3d121 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_MM_COMM_TEE This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_MM_COMM_TEE defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
88df3634 |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: CTRL+S to save the boot order 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>
|
#
45f5319f |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
menu: remove CTRL+C to quit On the sandbox called without "--terminal raw" CTRL+C leaves U-Boot, "ESC/CTRL+C to quit" is misleading. Let's remove CTRL+C to quit key handling from bootmenu and eficonfig menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
|
#
8dbd0a0f |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add vertical scroll support The current eficonfig menu does not support vertical scroll, so it can not display the menu entries greater than the console row size. This commit add the vertial scroll support. The console size is retrieved by SIMPLE_TEXT_OUTPUT_PROTOCOL.QueryMode() service, then calculates the row size for menu entry by subtracting menu header and description row size from the console row size. "start" and "end" are added in the efimenu structure. "start" keeps the menu entry index at the top, "end" keeps the bottom menu entry index. item_data_print() menu function only draws the menu entry between "start" and "end". This commit also fixes the issue that "Save" and "Quit" entries can be moved by BKEY_PLUS in change boot order menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
0d590852 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation This commit removes the change boot order specific menu implementation. The change boot order implementation calls eficonfig_process_common() same as other menus. The change boot order menu requires own item_data_print and item_choice implementation, but display_statusline function can be a same function as other menus. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
cd160b27 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor eficonfig_process_common function Current change boot order implementation does not call eficonfig_process_common() and call own menu functions for display_statusline, item_data_print and item_choice. Change boot order functionality should call eficonfig_process_common() to improve maintenanceability. This commit is a preparation to remove the change boot order specific implementation. The menu functions (display_statusline, item_data_print and item_choice) are added as argument of eficonfig_process_common(). The menu description string displayed at the bottom of the menu is also added as argument. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
32bab0ea |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Make use of CLI character processing Avoid duplicating some of the escape-sequence processing here and use the CLI function instead. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
d0ca98db |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Update bootmenu_loop() to return the code Use the return value to save having to pass around a pointer. This also resolves any ambiguity about what *key contains when the function is called. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
2da4a15e |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Rename KEY_... to BKEY_... This enum values conflict with linux/input.h so rename them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
64550274 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: avoid SetVariable between GetNextVariableName calls The current code calls efi_set_variable_int() to delete the invalid boot option between calls to efi_get_next_variable_name_int(), it may produce unpredictable results. This commit moves removal of the invalid boot option outside of the efi_get_next_variable_name_int() calls. EFI_NOT_FOUND returned from efi_get_next_variable_name_int() indicates we retrieved all EFI variables, it should be treated as EFI_SUCEESS. To address the checkpatch warning of too many leading tabs, combine two if statement into one. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
ce327084 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: carve out efi_get_next_variable_name_int calls To retrieve the EFI variable name by efi_get_next_variable_name_int(), the sequence of alloc -> efi_get_next_variable_name_int -> realloc -> efi_get_next_variable_name_int is required. In current code, this sequence repeatedly appears in the several functions. It should be curved out a common function. This commit also fixes the missing free() of var_name16 in eficonfig_delete_invalid_boot_option(). Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
140a8959 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use efi_get_next_variable_name_int() eficonfig command reads all possible UEFI load options from 0x0000 to 0xFFFF to construct the menu. This takes too much time in some environment. This commit uses efi_get_next_variable_name_int() to read all existing UEFI load options to significantlly reduce the count of efi_get_var() call. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
78b1ccc4 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use u16_strsize() to get u16 string buffer size Use u16_strsize() to simplify the u16 string buffer size calculation. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c67d3c9e |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix going one directory up issue The directory name in eficonfig menu entry contains the '\' separator. strcmp() argument ".." is wrong and one directory up handling does not work correctly. strcmp() argument must include '\' separator. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c3b5af63 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add UEFI Secure Boot Key enrollment interface This commit adds the menu-driven UEFI Secure Boot Key enrollment interface. User can enroll PK, KEK, db and dbx by selecting file. Only the signed EFI Signature List(s) with an authenticated header, typically '.auth' file, is accepted. To clear the PK, KEK, db and dbx, user needs to enroll the null key signed by PK or KEK. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
21faf4ef |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use protocol interface for file selection EFI_SIMPLE_FILE_SYSTEM_PROTOCOL is not always provided by U-Boot. Use protocol interface functions instead of U-Boot internal functions. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d6566113 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose eficonfig_create_device_path() Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use eficonfig_create_device_path() to construct the full device path from device path of the volume and file path, so move it out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d571f9b2 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation All the eficonfig menus other than "Change Boot Order" use 'eficonfig_entry' structure for each menu entry. This commit refactors change boot order implementation to use 'eficonfig_entry' structure same as other menus to have consistent menu handling. This commit also simplifies the data->active handling when KEY_SPACE is pressed, and sizeof() parameter. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
8961e93e |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose append entry function Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use append_entry() and append_quit_entry() to construct the menu, so move them out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
a84040ab |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor file selection handling eficonfig_select_file_handler() is commonly used to select the file. eficonfig_display_select_file_option() adds an additional menu to clear the selected file. eficonfig_display_select_file_option() is not always necessary for the file selection process, so it must be outside of eficonfig_select_file_handler(). This commit also renames the following functions to avoid confusion. eficonfig_select_file_handler() -> eficonfig_process_select_file() eficonfig_select_file() -> eficonfig_show_file_selection() eficonfig_display_select_file_option() -> eficonfig_process_show_file_option() Finally, test_eficonfig.py need to be updated to get aligned with the above modification. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
1167e88a |
|
14-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix missing variable initialization The 'ret' variable must be initialized before use in eficonfig_delete_invalid_boot_option(). Fixes: c416f1c0bc ("bootmenu: add removable media entries") Addresses-Coverity: 376207 ("Uninitialized variables") Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
3d595ac5 |
|
09-Nov-2022 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: remove superfluous if in eficonfig_edit_boot_option Goto for an immediately succeeding label is superfluous. Fixes: 87d791423ac6 ("eficonfig: menu-driven addition of UEFI boot option") Addresses-Coverity: 376202 ("Identical code for different branches") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
f19171c9 |
|
08-Jan-2024 |
Ilias Apalodimas <ilias.apalodimas@linaro.org> |
efi_loader: Clean up efi_dp_append and efi_dp_concat Looking back at the initrd storing functionality, we introduced three functions, efi_dp_append_or_concatenate(), efi_dp_append/concat(). In hindsight we could have simplified that by a lot. First of all none of the functions append anything. They all allocate a new device path and concatenate the contents of two device paths in one. A boolean parameter controls the final device path -- if that's true an end node is injected between the two device paths. So let's rewrite this and make it a bit easier to read. Get rid of efi_dp_append(), efi_dp_concat() and rename efi_dp_append_or_concatenate() to efi_dp_concat(). This is far more intuitive and the only adjustment that is needed is an extra boolean argument on all callsites. Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
64658007 |
|
17-Nov-2023 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: eficonfig: create shortened boot options The boot options created by eficonfig should use shortened device-paths to avoid problems if drives are enumerated in a different sequence. Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
9945bc4f |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Fix incorrect return code of boot option update Correct the return code for out-of-memory and no boot option found Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
339b527b |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Move bootorder and bootoption apis to lib Rename and move bootorder and bootoption apis from cmd to lib for re-use between eficonfig and bootmgr Fix 'unexpected indentation' when 'make htmldocs' after functions are moved Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
2c0b0c31 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_SECURE_BOOT This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_SECURE_BOOT defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
83f3d121 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_MM_COMM_TEE This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_MM_COMM_TEE defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
88df3634 |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: CTRL+S to save the boot order 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>
|
#
45f5319f |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
menu: remove CTRL+C to quit On the sandbox called without "--terminal raw" CTRL+C leaves U-Boot, "ESC/CTRL+C to quit" is misleading. Let's remove CTRL+C to quit key handling from bootmenu and eficonfig menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
|
#
8dbd0a0f |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add vertical scroll support The current eficonfig menu does not support vertical scroll, so it can not display the menu entries greater than the console row size. This commit add the vertial scroll support. The console size is retrieved by SIMPLE_TEXT_OUTPUT_PROTOCOL.QueryMode() service, then calculates the row size for menu entry by subtracting menu header and description row size from the console row size. "start" and "end" are added in the efimenu structure. "start" keeps the menu entry index at the top, "end" keeps the bottom menu entry index. item_data_print() menu function only draws the menu entry between "start" and "end". This commit also fixes the issue that "Save" and "Quit" entries can be moved by BKEY_PLUS in change boot order menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
0d590852 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation This commit removes the change boot order specific menu implementation. The change boot order implementation calls eficonfig_process_common() same as other menus. The change boot order menu requires own item_data_print and item_choice implementation, but display_statusline function can be a same function as other menus. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
cd160b27 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor eficonfig_process_common function Current change boot order implementation does not call eficonfig_process_common() and call own menu functions for display_statusline, item_data_print and item_choice. Change boot order functionality should call eficonfig_process_common() to improve maintenanceability. This commit is a preparation to remove the change boot order specific implementation. The menu functions (display_statusline, item_data_print and item_choice) are added as argument of eficonfig_process_common(). The menu description string displayed at the bottom of the menu is also added as argument. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
32bab0ea |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Make use of CLI character processing Avoid duplicating some of the escape-sequence processing here and use the CLI function instead. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
d0ca98db |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Update bootmenu_loop() to return the code Use the return value to save having to pass around a pointer. This also resolves any ambiguity about what *key contains when the function is called. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
2da4a15e |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Rename KEY_... to BKEY_... This enum values conflict with linux/input.h so rename them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
64550274 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: avoid SetVariable between GetNextVariableName calls The current code calls efi_set_variable_int() to delete the invalid boot option between calls to efi_get_next_variable_name_int(), it may produce unpredictable results. This commit moves removal of the invalid boot option outside of the efi_get_next_variable_name_int() calls. EFI_NOT_FOUND returned from efi_get_next_variable_name_int() indicates we retrieved all EFI variables, it should be treated as EFI_SUCEESS. To address the checkpatch warning of too many leading tabs, combine two if statement into one. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
ce327084 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: carve out efi_get_next_variable_name_int calls To retrieve the EFI variable name by efi_get_next_variable_name_int(), the sequence of alloc -> efi_get_next_variable_name_int -> realloc -> efi_get_next_variable_name_int is required. In current code, this sequence repeatedly appears in the several functions. It should be curved out a common function. This commit also fixes the missing free() of var_name16 in eficonfig_delete_invalid_boot_option(). Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
140a8959 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use efi_get_next_variable_name_int() eficonfig command reads all possible UEFI load options from 0x0000 to 0xFFFF to construct the menu. This takes too much time in some environment. This commit uses efi_get_next_variable_name_int() to read all existing UEFI load options to significantlly reduce the count of efi_get_var() call. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
78b1ccc4 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use u16_strsize() to get u16 string buffer size Use u16_strsize() to simplify the u16 string buffer size calculation. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c67d3c9e |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix going one directory up issue The directory name in eficonfig menu entry contains the '\' separator. strcmp() argument ".." is wrong and one directory up handling does not work correctly. strcmp() argument must include '\' separator. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c3b5af63 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add UEFI Secure Boot Key enrollment interface This commit adds the menu-driven UEFI Secure Boot Key enrollment interface. User can enroll PK, KEK, db and dbx by selecting file. Only the signed EFI Signature List(s) with an authenticated header, typically '.auth' file, is accepted. To clear the PK, KEK, db and dbx, user needs to enroll the null key signed by PK or KEK. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
21faf4ef |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use protocol interface for file selection EFI_SIMPLE_FILE_SYSTEM_PROTOCOL is not always provided by U-Boot. Use protocol interface functions instead of U-Boot internal functions. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d6566113 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose eficonfig_create_device_path() Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use eficonfig_create_device_path() to construct the full device path from device path of the volume and file path, so move it out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d571f9b2 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation All the eficonfig menus other than "Change Boot Order" use 'eficonfig_entry' structure for each menu entry. This commit refactors change boot order implementation to use 'eficonfig_entry' structure same as other menus to have consistent menu handling. This commit also simplifies the data->active handling when KEY_SPACE is pressed, and sizeof() parameter. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
8961e93e |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose append entry function Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use append_entry() and append_quit_entry() to construct the menu, so move them out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
a84040ab |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor file selection handling eficonfig_select_file_handler() is commonly used to select the file. eficonfig_display_select_file_option() adds an additional menu to clear the selected file. eficonfig_display_select_file_option() is not always necessary for the file selection process, so it must be outside of eficonfig_select_file_handler(). This commit also renames the following functions to avoid confusion. eficonfig_select_file_handler() -> eficonfig_process_select_file() eficonfig_select_file() -> eficonfig_show_file_selection() eficonfig_display_select_file_option() -> eficonfig_process_show_file_option() Finally, test_eficonfig.py need to be updated to get aligned with the above modification. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
1167e88a |
|
14-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix missing variable initialization The 'ret' variable must be initialized before use in eficonfig_delete_invalid_boot_option(). Fixes: c416f1c0bc ("bootmenu: add removable media entries") Addresses-Coverity: 376207 ("Uninitialized variables") Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
3d595ac5 |
|
09-Nov-2022 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: remove superfluous if in eficonfig_edit_boot_option Goto for an immediately succeeding label is superfluous. Fixes: 87d791423ac6 ("eficonfig: menu-driven addition of UEFI boot option") Addresses-Coverity: 376202 ("Identical code for different branches") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
f19171c9 |
|
08-Jan-2024 |
Ilias Apalodimas <ilias.apalodimas@linaro.org> |
efi_loader: Clean up efi_dp_append and efi_dp_concat Looking back at the initrd storing functionality, we introduced three functions, efi_dp_append_or_concatenate(), efi_dp_append/concat(). In hindsight we could have simplified that by a lot. First of all none of the functions append anything. They all allocate a new device path and concatenate the contents of two device paths in one. A boolean parameter controls the final device path -- if that's true an end node is injected between the two device paths. So let's rewrite this and make it a bit easier to read. Get rid of efi_dp_append(), efi_dp_concat() and rename efi_dp_append_or_concatenate() to efi_dp_concat(). This is far more intuitive and the only adjustment that is needed is an extra boolean argument on all callsites. Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
64658007 |
|
17-Nov-2023 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: eficonfig: create shortened boot options The boot options created by eficonfig should use shortened device-paths to avoid problems if drives are enumerated in a different sequence. Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
9945bc4f |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Fix incorrect return code of boot option update Correct the return code for out-of-memory and no boot option found Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
339b527b |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Move bootorder and bootoption apis to lib Rename and move bootorder and bootoption apis from cmd to lib for re-use between eficonfig and bootmgr Fix 'unexpected indentation' when 'make htmldocs' after functions are moved Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
2c0b0c31 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_SECURE_BOOT This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_SECURE_BOOT defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
83f3d121 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_MM_COMM_TEE This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_MM_COMM_TEE defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
88df3634 |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: CTRL+S to save the boot order 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>
|
#
45f5319f |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
menu: remove CTRL+C to quit On the sandbox called without "--terminal raw" CTRL+C leaves U-Boot, "ESC/CTRL+C to quit" is misleading. Let's remove CTRL+C to quit key handling from bootmenu and eficonfig menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
|
#
8dbd0a0f |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add vertical scroll support The current eficonfig menu does not support vertical scroll, so it can not display the menu entries greater than the console row size. This commit add the vertial scroll support. The console size is retrieved by SIMPLE_TEXT_OUTPUT_PROTOCOL.QueryMode() service, then calculates the row size for menu entry by subtracting menu header and description row size from the console row size. "start" and "end" are added in the efimenu structure. "start" keeps the menu entry index at the top, "end" keeps the bottom menu entry index. item_data_print() menu function only draws the menu entry between "start" and "end". This commit also fixes the issue that "Save" and "Quit" entries can be moved by BKEY_PLUS in change boot order menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
0d590852 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation This commit removes the change boot order specific menu implementation. The change boot order implementation calls eficonfig_process_common() same as other menus. The change boot order menu requires own item_data_print and item_choice implementation, but display_statusline function can be a same function as other menus. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
cd160b27 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor eficonfig_process_common function Current change boot order implementation does not call eficonfig_process_common() and call own menu functions for display_statusline, item_data_print and item_choice. Change boot order functionality should call eficonfig_process_common() to improve maintenanceability. This commit is a preparation to remove the change boot order specific implementation. The menu functions (display_statusline, item_data_print and item_choice) are added as argument of eficonfig_process_common(). The menu description string displayed at the bottom of the menu is also added as argument. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
32bab0ea |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Make use of CLI character processing Avoid duplicating some of the escape-sequence processing here and use the CLI function instead. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
d0ca98db |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Update bootmenu_loop() to return the code Use the return value to save having to pass around a pointer. This also resolves any ambiguity about what *key contains when the function is called. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
2da4a15e |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Rename KEY_... to BKEY_... This enum values conflict with linux/input.h so rename them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
64550274 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: avoid SetVariable between GetNextVariableName calls The current code calls efi_set_variable_int() to delete the invalid boot option between calls to efi_get_next_variable_name_int(), it may produce unpredictable results. This commit moves removal of the invalid boot option outside of the efi_get_next_variable_name_int() calls. EFI_NOT_FOUND returned from efi_get_next_variable_name_int() indicates we retrieved all EFI variables, it should be treated as EFI_SUCEESS. To address the checkpatch warning of too many leading tabs, combine two if statement into one. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
ce327084 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: carve out efi_get_next_variable_name_int calls To retrieve the EFI variable name by efi_get_next_variable_name_int(), the sequence of alloc -> efi_get_next_variable_name_int -> realloc -> efi_get_next_variable_name_int is required. In current code, this sequence repeatedly appears in the several functions. It should be curved out a common function. This commit also fixes the missing free() of var_name16 in eficonfig_delete_invalid_boot_option(). Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
140a8959 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use efi_get_next_variable_name_int() eficonfig command reads all possible UEFI load options from 0x0000 to 0xFFFF to construct the menu. This takes too much time in some environment. This commit uses efi_get_next_variable_name_int() to read all existing UEFI load options to significantlly reduce the count of efi_get_var() call. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
78b1ccc4 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use u16_strsize() to get u16 string buffer size Use u16_strsize() to simplify the u16 string buffer size calculation. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c67d3c9e |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix going one directory up issue The directory name in eficonfig menu entry contains the '\' separator. strcmp() argument ".." is wrong and one directory up handling does not work correctly. strcmp() argument must include '\' separator. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c3b5af63 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add UEFI Secure Boot Key enrollment interface This commit adds the menu-driven UEFI Secure Boot Key enrollment interface. User can enroll PK, KEK, db and dbx by selecting file. Only the signed EFI Signature List(s) with an authenticated header, typically '.auth' file, is accepted. To clear the PK, KEK, db and dbx, user needs to enroll the null key signed by PK or KEK. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
21faf4ef |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use protocol interface for file selection EFI_SIMPLE_FILE_SYSTEM_PROTOCOL is not always provided by U-Boot. Use protocol interface functions instead of U-Boot internal functions. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d6566113 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose eficonfig_create_device_path() Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use eficonfig_create_device_path() to construct the full device path from device path of the volume and file path, so move it out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d571f9b2 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation All the eficonfig menus other than "Change Boot Order" use 'eficonfig_entry' structure for each menu entry. This commit refactors change boot order implementation to use 'eficonfig_entry' structure same as other menus to have consistent menu handling. This commit also simplifies the data->active handling when KEY_SPACE is pressed, and sizeof() parameter. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
8961e93e |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose append entry function Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use append_entry() and append_quit_entry() to construct the menu, so move them out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
a84040ab |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor file selection handling eficonfig_select_file_handler() is commonly used to select the file. eficonfig_display_select_file_option() adds an additional menu to clear the selected file. eficonfig_display_select_file_option() is not always necessary for the file selection process, so it must be outside of eficonfig_select_file_handler(). This commit also renames the following functions to avoid confusion. eficonfig_select_file_handler() -> eficonfig_process_select_file() eficonfig_select_file() -> eficonfig_show_file_selection() eficonfig_display_select_file_option() -> eficonfig_process_show_file_option() Finally, test_eficonfig.py need to be updated to get aligned with the above modification. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
1167e88a |
|
14-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix missing variable initialization The 'ret' variable must be initialized before use in eficonfig_delete_invalid_boot_option(). Fixes: c416f1c0bc ("bootmenu: add removable media entries") Addresses-Coverity: 376207 ("Uninitialized variables") Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
3d595ac5 |
|
09-Nov-2022 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: remove superfluous if in eficonfig_edit_boot_option Goto for an immediately succeeding label is superfluous. Fixes: 87d791423ac6 ("eficonfig: menu-driven addition of UEFI boot option") Addresses-Coverity: 376202 ("Identical code for different branches") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
f19171c9 |
|
08-Jan-2024 |
Ilias Apalodimas <ilias.apalodimas@linaro.org> |
efi_loader: Clean up efi_dp_append and efi_dp_concat Looking back at the initrd storing functionality, we introduced three functions, efi_dp_append_or_concatenate(), efi_dp_append/concat(). In hindsight we could have simplified that by a lot. First of all none of the functions append anything. They all allocate a new device path and concatenate the contents of two device paths in one. A boolean parameter controls the final device path -- if that's true an end node is injected between the two device paths. So let's rewrite this and make it a bit easier to read. Get rid of efi_dp_append(), efi_dp_concat() and rename efi_dp_append_or_concatenate() to efi_dp_concat(). This is far more intuitive and the only adjustment that is needed is an extra boolean argument on all callsites. Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
64658007 |
|
17-Nov-2023 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: eficonfig: create shortened boot options The boot options created by eficonfig should use shortened device-paths to avoid problems if drives are enumerated in a different sequence. Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
9945bc4f |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Fix incorrect return code of boot option update Correct the return code for out-of-memory and no boot option found Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
339b527b |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Move bootorder and bootoption apis to lib Rename and move bootorder and bootoption apis from cmd to lib for re-use between eficonfig and bootmgr Fix 'unexpected indentation' when 'make htmldocs' after functions are moved Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
2c0b0c31 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_SECURE_BOOT This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_SECURE_BOOT defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
83f3d121 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_MM_COMM_TEE This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_MM_COMM_TEE defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
88df3634 |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: CTRL+S to save the boot order 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>
|
#
45f5319f |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
menu: remove CTRL+C to quit On the sandbox called without "--terminal raw" CTRL+C leaves U-Boot, "ESC/CTRL+C to quit" is misleading. Let's remove CTRL+C to quit key handling from bootmenu and eficonfig menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
|
#
8dbd0a0f |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add vertical scroll support The current eficonfig menu does not support vertical scroll, so it can not display the menu entries greater than the console row size. This commit add the vertial scroll support. The console size is retrieved by SIMPLE_TEXT_OUTPUT_PROTOCOL.QueryMode() service, then calculates the row size for menu entry by subtracting menu header and description row size from the console row size. "start" and "end" are added in the efimenu structure. "start" keeps the menu entry index at the top, "end" keeps the bottom menu entry index. item_data_print() menu function only draws the menu entry between "start" and "end". This commit also fixes the issue that "Save" and "Quit" entries can be moved by BKEY_PLUS in change boot order menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
0d590852 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation This commit removes the change boot order specific menu implementation. The change boot order implementation calls eficonfig_process_common() same as other menus. The change boot order menu requires own item_data_print and item_choice implementation, but display_statusline function can be a same function as other menus. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
cd160b27 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor eficonfig_process_common function Current change boot order implementation does not call eficonfig_process_common() and call own menu functions for display_statusline, item_data_print and item_choice. Change boot order functionality should call eficonfig_process_common() to improve maintenanceability. This commit is a preparation to remove the change boot order specific implementation. The menu functions (display_statusline, item_data_print and item_choice) are added as argument of eficonfig_process_common(). The menu description string displayed at the bottom of the menu is also added as argument. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
32bab0ea |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Make use of CLI character processing Avoid duplicating some of the escape-sequence processing here and use the CLI function instead. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
d0ca98db |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Update bootmenu_loop() to return the code Use the return value to save having to pass around a pointer. This also resolves any ambiguity about what *key contains when the function is called. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
2da4a15e |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Rename KEY_... to BKEY_... This enum values conflict with linux/input.h so rename them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
64550274 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: avoid SetVariable between GetNextVariableName calls The current code calls efi_set_variable_int() to delete the invalid boot option between calls to efi_get_next_variable_name_int(), it may produce unpredictable results. This commit moves removal of the invalid boot option outside of the efi_get_next_variable_name_int() calls. EFI_NOT_FOUND returned from efi_get_next_variable_name_int() indicates we retrieved all EFI variables, it should be treated as EFI_SUCEESS. To address the checkpatch warning of too many leading tabs, combine two if statement into one. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
ce327084 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: carve out efi_get_next_variable_name_int calls To retrieve the EFI variable name by efi_get_next_variable_name_int(), the sequence of alloc -> efi_get_next_variable_name_int -> realloc -> efi_get_next_variable_name_int is required. In current code, this sequence repeatedly appears in the several functions. It should be curved out a common function. This commit also fixes the missing free() of var_name16 in eficonfig_delete_invalid_boot_option(). Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
140a8959 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use efi_get_next_variable_name_int() eficonfig command reads all possible UEFI load options from 0x0000 to 0xFFFF to construct the menu. This takes too much time in some environment. This commit uses efi_get_next_variable_name_int() to read all existing UEFI load options to significantlly reduce the count of efi_get_var() call. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
78b1ccc4 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use u16_strsize() to get u16 string buffer size Use u16_strsize() to simplify the u16 string buffer size calculation. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c67d3c9e |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix going one directory up issue The directory name in eficonfig menu entry contains the '\' separator. strcmp() argument ".." is wrong and one directory up handling does not work correctly. strcmp() argument must include '\' separator. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c3b5af63 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add UEFI Secure Boot Key enrollment interface This commit adds the menu-driven UEFI Secure Boot Key enrollment interface. User can enroll PK, KEK, db and dbx by selecting file. Only the signed EFI Signature List(s) with an authenticated header, typically '.auth' file, is accepted. To clear the PK, KEK, db and dbx, user needs to enroll the null key signed by PK or KEK. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
21faf4ef |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use protocol interface for file selection EFI_SIMPLE_FILE_SYSTEM_PROTOCOL is not always provided by U-Boot. Use protocol interface functions instead of U-Boot internal functions. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d6566113 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose eficonfig_create_device_path() Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use eficonfig_create_device_path() to construct the full device path from device path of the volume and file path, so move it out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d571f9b2 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation All the eficonfig menus other than "Change Boot Order" use 'eficonfig_entry' structure for each menu entry. This commit refactors change boot order implementation to use 'eficonfig_entry' structure same as other menus to have consistent menu handling. This commit also simplifies the data->active handling when KEY_SPACE is pressed, and sizeof() parameter. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
8961e93e |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose append entry function Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use append_entry() and append_quit_entry() to construct the menu, so move them out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
a84040ab |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor file selection handling eficonfig_select_file_handler() is commonly used to select the file. eficonfig_display_select_file_option() adds an additional menu to clear the selected file. eficonfig_display_select_file_option() is not always necessary for the file selection process, so it must be outside of eficonfig_select_file_handler(). This commit also renames the following functions to avoid confusion. eficonfig_select_file_handler() -> eficonfig_process_select_file() eficonfig_select_file() -> eficonfig_show_file_selection() eficonfig_display_select_file_option() -> eficonfig_process_show_file_option() Finally, test_eficonfig.py need to be updated to get aligned with the above modification. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
1167e88a |
|
14-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix missing variable initialization The 'ret' variable must be initialized before use in eficonfig_delete_invalid_boot_option(). Fixes: c416f1c0bc ("bootmenu: add removable media entries") Addresses-Coverity: 376207 ("Uninitialized variables") Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
3d595ac5 |
|
09-Nov-2022 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: remove superfluous if in eficonfig_edit_boot_option Goto for an immediately succeeding label is superfluous. Fixes: 87d791423ac6 ("eficonfig: menu-driven addition of UEFI boot option") Addresses-Coverity: 376202 ("Identical code for different branches") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
64658007 |
|
17-Nov-2023 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: eficonfig: create shortened boot options The boot options created by eficonfig should use shortened device-paths to avoid problems if drives are enumerated in a different sequence. Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
9945bc4f |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Fix incorrect return code of boot option update Correct the return code for out-of-memory and no boot option found Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
339b527b |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Move bootorder and bootoption apis to lib Rename and move bootorder and bootoption apis from cmd to lib for re-use between eficonfig and bootmgr Fix 'unexpected indentation' when 'make htmldocs' after functions are moved Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
2c0b0c31 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_SECURE_BOOT This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_SECURE_BOOT defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
83f3d121 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_MM_COMM_TEE This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_MM_COMM_TEE defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
88df3634 |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: CTRL+S to save the boot order 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>
|
#
45f5319f |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
menu: remove CTRL+C to quit On the sandbox called without "--terminal raw" CTRL+C leaves U-Boot, "ESC/CTRL+C to quit" is misleading. Let's remove CTRL+C to quit key handling from bootmenu and eficonfig menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
|
#
8dbd0a0f |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add vertical scroll support The current eficonfig menu does not support vertical scroll, so it can not display the menu entries greater than the console row size. This commit add the vertial scroll support. The console size is retrieved by SIMPLE_TEXT_OUTPUT_PROTOCOL.QueryMode() service, then calculates the row size for menu entry by subtracting menu header and description row size from the console row size. "start" and "end" are added in the efimenu structure. "start" keeps the menu entry index at the top, "end" keeps the bottom menu entry index. item_data_print() menu function only draws the menu entry between "start" and "end". This commit also fixes the issue that "Save" and "Quit" entries can be moved by BKEY_PLUS in change boot order menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
0d590852 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation This commit removes the change boot order specific menu implementation. The change boot order implementation calls eficonfig_process_common() same as other menus. The change boot order menu requires own item_data_print and item_choice implementation, but display_statusline function can be a same function as other menus. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
cd160b27 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor eficonfig_process_common function Current change boot order implementation does not call eficonfig_process_common() and call own menu functions for display_statusline, item_data_print and item_choice. Change boot order functionality should call eficonfig_process_common() to improve maintenanceability. This commit is a preparation to remove the change boot order specific implementation. The menu functions (display_statusline, item_data_print and item_choice) are added as argument of eficonfig_process_common(). The menu description string displayed at the bottom of the menu is also added as argument. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
32bab0ea |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Make use of CLI character processing Avoid duplicating some of the escape-sequence processing here and use the CLI function instead. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
d0ca98db |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Update bootmenu_loop() to return the code Use the return value to save having to pass around a pointer. This also resolves any ambiguity about what *key contains when the function is called. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
2da4a15e |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Rename KEY_... to BKEY_... This enum values conflict with linux/input.h so rename them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
64550274 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: avoid SetVariable between GetNextVariableName calls The current code calls efi_set_variable_int() to delete the invalid boot option between calls to efi_get_next_variable_name_int(), it may produce unpredictable results. This commit moves removal of the invalid boot option outside of the efi_get_next_variable_name_int() calls. EFI_NOT_FOUND returned from efi_get_next_variable_name_int() indicates we retrieved all EFI variables, it should be treated as EFI_SUCEESS. To address the checkpatch warning of too many leading tabs, combine two if statement into one. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
ce327084 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: carve out efi_get_next_variable_name_int calls To retrieve the EFI variable name by efi_get_next_variable_name_int(), the sequence of alloc -> efi_get_next_variable_name_int -> realloc -> efi_get_next_variable_name_int is required. In current code, this sequence repeatedly appears in the several functions. It should be curved out a common function. This commit also fixes the missing free() of var_name16 in eficonfig_delete_invalid_boot_option(). Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
140a8959 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use efi_get_next_variable_name_int() eficonfig command reads all possible UEFI load options from 0x0000 to 0xFFFF to construct the menu. This takes too much time in some environment. This commit uses efi_get_next_variable_name_int() to read all existing UEFI load options to significantlly reduce the count of efi_get_var() call. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
78b1ccc4 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use u16_strsize() to get u16 string buffer size Use u16_strsize() to simplify the u16 string buffer size calculation. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c67d3c9e |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix going one directory up issue The directory name in eficonfig menu entry contains the '\' separator. strcmp() argument ".." is wrong and one directory up handling does not work correctly. strcmp() argument must include '\' separator. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c3b5af63 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add UEFI Secure Boot Key enrollment interface This commit adds the menu-driven UEFI Secure Boot Key enrollment interface. User can enroll PK, KEK, db and dbx by selecting file. Only the signed EFI Signature List(s) with an authenticated header, typically '.auth' file, is accepted. To clear the PK, KEK, db and dbx, user needs to enroll the null key signed by PK or KEK. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
21faf4ef |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use protocol interface for file selection EFI_SIMPLE_FILE_SYSTEM_PROTOCOL is not always provided by U-Boot. Use protocol interface functions instead of U-Boot internal functions. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d6566113 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose eficonfig_create_device_path() Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use eficonfig_create_device_path() to construct the full device path from device path of the volume and file path, so move it out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d571f9b2 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation All the eficonfig menus other than "Change Boot Order" use 'eficonfig_entry' structure for each menu entry. This commit refactors change boot order implementation to use 'eficonfig_entry' structure same as other menus to have consistent menu handling. This commit also simplifies the data->active handling when KEY_SPACE is pressed, and sizeof() parameter. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
8961e93e |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose append entry function Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use append_entry() and append_quit_entry() to construct the menu, so move them out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
a84040ab |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor file selection handling eficonfig_select_file_handler() is commonly used to select the file. eficonfig_display_select_file_option() adds an additional menu to clear the selected file. eficonfig_display_select_file_option() is not always necessary for the file selection process, so it must be outside of eficonfig_select_file_handler(). This commit also renames the following functions to avoid confusion. eficonfig_select_file_handler() -> eficonfig_process_select_file() eficonfig_select_file() -> eficonfig_show_file_selection() eficonfig_display_select_file_option() -> eficonfig_process_show_file_option() Finally, test_eficonfig.py need to be updated to get aligned with the above modification. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
1167e88a |
|
14-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix missing variable initialization The 'ret' variable must be initialized before use in eficonfig_delete_invalid_boot_option(). Fixes: c416f1c0bc ("bootmenu: add removable media entries") Addresses-Coverity: 376207 ("Uninitialized variables") Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
3d595ac5 |
|
09-Nov-2022 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: remove superfluous if in eficonfig_edit_boot_option Goto for an immediately succeeding label is superfluous. Fixes: 87d791423ac6 ("eficonfig: menu-driven addition of UEFI boot option") Addresses-Coverity: 376202 ("Identical code for different branches") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
64658007 |
|
17-Nov-2023 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: eficonfig: create shortened boot options The boot options created by eficonfig should use shortened device-paths to avoid problems if drives are enumerated in a different sequence. Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
9945bc4f |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Fix incorrect return code of boot option update Correct the return code for out-of-memory and no boot option found Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
339b527b |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Move bootorder and bootoption apis to lib Rename and move bootorder and bootoption apis from cmd to lib for re-use between eficonfig and bootmgr Fix 'unexpected indentation' when 'make htmldocs' after functions are moved Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
2c0b0c31 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_SECURE_BOOT This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_SECURE_BOOT defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
83f3d121 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_MM_COMM_TEE This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_MM_COMM_TEE defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
88df3634 |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: CTRL+S to save the boot order 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>
|
#
45f5319f |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
menu: remove CTRL+C to quit On the sandbox called without "--terminal raw" CTRL+C leaves U-Boot, "ESC/CTRL+C to quit" is misleading. Let's remove CTRL+C to quit key handling from bootmenu and eficonfig menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
|
#
8dbd0a0f |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add vertical scroll support The current eficonfig menu does not support vertical scroll, so it can not display the menu entries greater than the console row size. This commit add the vertial scroll support. The console size is retrieved by SIMPLE_TEXT_OUTPUT_PROTOCOL.QueryMode() service, then calculates the row size for menu entry by subtracting menu header and description row size from the console row size. "start" and "end" are added in the efimenu structure. "start" keeps the menu entry index at the top, "end" keeps the bottom menu entry index. item_data_print() menu function only draws the menu entry between "start" and "end". This commit also fixes the issue that "Save" and "Quit" entries can be moved by BKEY_PLUS in change boot order menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
0d590852 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation This commit removes the change boot order specific menu implementation. The change boot order implementation calls eficonfig_process_common() same as other menus. The change boot order menu requires own item_data_print and item_choice implementation, but display_statusline function can be a same function as other menus. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
cd160b27 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor eficonfig_process_common function Current change boot order implementation does not call eficonfig_process_common() and call own menu functions for display_statusline, item_data_print and item_choice. Change boot order functionality should call eficonfig_process_common() to improve maintenanceability. This commit is a preparation to remove the change boot order specific implementation. The menu functions (display_statusline, item_data_print and item_choice) are added as argument of eficonfig_process_common(). The menu description string displayed at the bottom of the menu is also added as argument. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
32bab0ea |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Make use of CLI character processing Avoid duplicating some of the escape-sequence processing here and use the CLI function instead. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
d0ca98db |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Update bootmenu_loop() to return the code Use the return value to save having to pass around a pointer. This also resolves any ambiguity about what *key contains when the function is called. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
2da4a15e |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Rename KEY_... to BKEY_... This enum values conflict with linux/input.h so rename them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
64550274 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: avoid SetVariable between GetNextVariableName calls The current code calls efi_set_variable_int() to delete the invalid boot option between calls to efi_get_next_variable_name_int(), it may produce unpredictable results. This commit moves removal of the invalid boot option outside of the efi_get_next_variable_name_int() calls. EFI_NOT_FOUND returned from efi_get_next_variable_name_int() indicates we retrieved all EFI variables, it should be treated as EFI_SUCEESS. To address the checkpatch warning of too many leading tabs, combine two if statement into one. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
ce327084 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: carve out efi_get_next_variable_name_int calls To retrieve the EFI variable name by efi_get_next_variable_name_int(), the sequence of alloc -> efi_get_next_variable_name_int -> realloc -> efi_get_next_variable_name_int is required. In current code, this sequence repeatedly appears in the several functions. It should be curved out a common function. This commit also fixes the missing free() of var_name16 in eficonfig_delete_invalid_boot_option(). Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
140a8959 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use efi_get_next_variable_name_int() eficonfig command reads all possible UEFI load options from 0x0000 to 0xFFFF to construct the menu. This takes too much time in some environment. This commit uses efi_get_next_variable_name_int() to read all existing UEFI load options to significantlly reduce the count of efi_get_var() call. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
78b1ccc4 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use u16_strsize() to get u16 string buffer size Use u16_strsize() to simplify the u16 string buffer size calculation. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c67d3c9e |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix going one directory up issue The directory name in eficonfig menu entry contains the '\' separator. strcmp() argument ".." is wrong and one directory up handling does not work correctly. strcmp() argument must include '\' separator. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c3b5af63 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add UEFI Secure Boot Key enrollment interface This commit adds the menu-driven UEFI Secure Boot Key enrollment interface. User can enroll PK, KEK, db and dbx by selecting file. Only the signed EFI Signature List(s) with an authenticated header, typically '.auth' file, is accepted. To clear the PK, KEK, db and dbx, user needs to enroll the null key signed by PK or KEK. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
21faf4ef |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use protocol interface for file selection EFI_SIMPLE_FILE_SYSTEM_PROTOCOL is not always provided by U-Boot. Use protocol interface functions instead of U-Boot internal functions. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d6566113 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose eficonfig_create_device_path() Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use eficonfig_create_device_path() to construct the full device path from device path of the volume and file path, so move it out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d571f9b2 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation All the eficonfig menus other than "Change Boot Order" use 'eficonfig_entry' structure for each menu entry. This commit refactors change boot order implementation to use 'eficonfig_entry' structure same as other menus to have consistent menu handling. This commit also simplifies the data->active handling when KEY_SPACE is pressed, and sizeof() parameter. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
8961e93e |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose append entry function Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use append_entry() and append_quit_entry() to construct the menu, so move them out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
a84040ab |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor file selection handling eficonfig_select_file_handler() is commonly used to select the file. eficonfig_display_select_file_option() adds an additional menu to clear the selected file. eficonfig_display_select_file_option() is not always necessary for the file selection process, so it must be outside of eficonfig_select_file_handler(). This commit also renames the following functions to avoid confusion. eficonfig_select_file_handler() -> eficonfig_process_select_file() eficonfig_select_file() -> eficonfig_show_file_selection() eficonfig_display_select_file_option() -> eficonfig_process_show_file_option() Finally, test_eficonfig.py need to be updated to get aligned with the above modification. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
1167e88a |
|
14-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix missing variable initialization The 'ret' variable must be initialized before use in eficonfig_delete_invalid_boot_option(). Fixes: c416f1c0bc ("bootmenu: add removable media entries") Addresses-Coverity: 376207 ("Uninitialized variables") Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
3d595ac5 |
|
09-Nov-2022 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: remove superfluous if in eficonfig_edit_boot_option Goto for an immediately succeeding label is superfluous. Fixes: 87d791423ac6 ("eficonfig: menu-driven addition of UEFI boot option") Addresses-Coverity: 376202 ("Identical code for different branches") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
64658007 |
|
17-Nov-2023 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: eficonfig: create shortened boot options The boot options created by eficonfig should use shortened device-paths to avoid problems if drives are enumerated in a different sequence. Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
9945bc4f |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Fix incorrect return code of boot option update Correct the return code for out-of-memory and no boot option found Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
339b527b |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Move bootorder and bootoption apis to lib Rename and move bootorder and bootoption apis from cmd to lib for re-use between eficonfig and bootmgr Fix 'unexpected indentation' when 'make htmldocs' after functions are moved Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
2c0b0c31 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_SECURE_BOOT This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_SECURE_BOOT defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
83f3d121 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_MM_COMM_TEE This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_MM_COMM_TEE defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
88df3634 |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: CTRL+S to save the boot order 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>
|
#
45f5319f |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
menu: remove CTRL+C to quit On the sandbox called without "--terminal raw" CTRL+C leaves U-Boot, "ESC/CTRL+C to quit" is misleading. Let's remove CTRL+C to quit key handling from bootmenu and eficonfig menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
|
#
8dbd0a0f |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add vertical scroll support The current eficonfig menu does not support vertical scroll, so it can not display the menu entries greater than the console row size. This commit add the vertial scroll support. The console size is retrieved by SIMPLE_TEXT_OUTPUT_PROTOCOL.QueryMode() service, then calculates the row size for menu entry by subtracting menu header and description row size from the console row size. "start" and "end" are added in the efimenu structure. "start" keeps the menu entry index at the top, "end" keeps the bottom menu entry index. item_data_print() menu function only draws the menu entry between "start" and "end". This commit also fixes the issue that "Save" and "Quit" entries can be moved by BKEY_PLUS in change boot order menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
0d590852 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation This commit removes the change boot order specific menu implementation. The change boot order implementation calls eficonfig_process_common() same as other menus. The change boot order menu requires own item_data_print and item_choice implementation, but display_statusline function can be a same function as other menus. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
cd160b27 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor eficonfig_process_common function Current change boot order implementation does not call eficonfig_process_common() and call own menu functions for display_statusline, item_data_print and item_choice. Change boot order functionality should call eficonfig_process_common() to improve maintenanceability. This commit is a preparation to remove the change boot order specific implementation. The menu functions (display_statusline, item_data_print and item_choice) are added as argument of eficonfig_process_common(). The menu description string displayed at the bottom of the menu is also added as argument. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
32bab0ea |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Make use of CLI character processing Avoid duplicating some of the escape-sequence processing here and use the CLI function instead. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
d0ca98db |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Update bootmenu_loop() to return the code Use the return value to save having to pass around a pointer. This also resolves any ambiguity about what *key contains when the function is called. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
2da4a15e |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Rename KEY_... to BKEY_... This enum values conflict with linux/input.h so rename them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
64550274 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: avoid SetVariable between GetNextVariableName calls The current code calls efi_set_variable_int() to delete the invalid boot option between calls to efi_get_next_variable_name_int(), it may produce unpredictable results. This commit moves removal of the invalid boot option outside of the efi_get_next_variable_name_int() calls. EFI_NOT_FOUND returned from efi_get_next_variable_name_int() indicates we retrieved all EFI variables, it should be treated as EFI_SUCEESS. To address the checkpatch warning of too many leading tabs, combine two if statement into one. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
ce327084 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: carve out efi_get_next_variable_name_int calls To retrieve the EFI variable name by efi_get_next_variable_name_int(), the sequence of alloc -> efi_get_next_variable_name_int -> realloc -> efi_get_next_variable_name_int is required. In current code, this sequence repeatedly appears in the several functions. It should be curved out a common function. This commit also fixes the missing free() of var_name16 in eficonfig_delete_invalid_boot_option(). Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
140a8959 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use efi_get_next_variable_name_int() eficonfig command reads all possible UEFI load options from 0x0000 to 0xFFFF to construct the menu. This takes too much time in some environment. This commit uses efi_get_next_variable_name_int() to read all existing UEFI load options to significantlly reduce the count of efi_get_var() call. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
78b1ccc4 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use u16_strsize() to get u16 string buffer size Use u16_strsize() to simplify the u16 string buffer size calculation. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c67d3c9e |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix going one directory up issue The directory name in eficonfig menu entry contains the '\' separator. strcmp() argument ".." is wrong and one directory up handling does not work correctly. strcmp() argument must include '\' separator. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c3b5af63 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add UEFI Secure Boot Key enrollment interface This commit adds the menu-driven UEFI Secure Boot Key enrollment interface. User can enroll PK, KEK, db and dbx by selecting file. Only the signed EFI Signature List(s) with an authenticated header, typically '.auth' file, is accepted. To clear the PK, KEK, db and dbx, user needs to enroll the null key signed by PK or KEK. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
21faf4ef |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use protocol interface for file selection EFI_SIMPLE_FILE_SYSTEM_PROTOCOL is not always provided by U-Boot. Use protocol interface functions instead of U-Boot internal functions. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d6566113 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose eficonfig_create_device_path() Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use eficonfig_create_device_path() to construct the full device path from device path of the volume and file path, so move it out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d571f9b2 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation All the eficonfig menus other than "Change Boot Order" use 'eficonfig_entry' structure for each menu entry. This commit refactors change boot order implementation to use 'eficonfig_entry' structure same as other menus to have consistent menu handling. This commit also simplifies the data->active handling when KEY_SPACE is pressed, and sizeof() parameter. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
8961e93e |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose append entry function Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use append_entry() and append_quit_entry() to construct the menu, so move them out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
a84040ab |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor file selection handling eficonfig_select_file_handler() is commonly used to select the file. eficonfig_display_select_file_option() adds an additional menu to clear the selected file. eficonfig_display_select_file_option() is not always necessary for the file selection process, so it must be outside of eficonfig_select_file_handler(). This commit also renames the following functions to avoid confusion. eficonfig_select_file_handler() -> eficonfig_process_select_file() eficonfig_select_file() -> eficonfig_show_file_selection() eficonfig_display_select_file_option() -> eficonfig_process_show_file_option() Finally, test_eficonfig.py need to be updated to get aligned with the above modification. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
1167e88a |
|
14-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix missing variable initialization The 'ret' variable must be initialized before use in eficonfig_delete_invalid_boot_option(). Fixes: c416f1c0bc ("bootmenu: add removable media entries") Addresses-Coverity: 376207 ("Uninitialized variables") Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
3d595ac5 |
|
09-Nov-2022 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: remove superfluous if in eficonfig_edit_boot_option Goto for an immediately succeeding label is superfluous. Fixes: 87d791423ac6 ("eficonfig: menu-driven addition of UEFI boot option") Addresses-Coverity: 376202 ("Identical code for different branches") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
64658007 |
|
17-Nov-2023 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: eficonfig: create shortened boot options The boot options created by eficonfig should use shortened device-paths to avoid problems if drives are enumerated in a different sequence. Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
9945bc4f |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Fix incorrect return code of boot option update Correct the return code for out-of-memory and no boot option found Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
339b527b |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Move bootorder and bootoption apis to lib Rename and move bootorder and bootoption apis from cmd to lib for re-use between eficonfig and bootmgr Fix 'unexpected indentation' when 'make htmldocs' after functions are moved Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
2c0b0c31 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_SECURE_BOOT This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_SECURE_BOOT defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
83f3d121 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_MM_COMM_TEE This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_MM_COMM_TEE defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
88df3634 |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: CTRL+S to save the boot order 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>
|
#
45f5319f |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
menu: remove CTRL+C to quit On the sandbox called without "--terminal raw" CTRL+C leaves U-Boot, "ESC/CTRL+C to quit" is misleading. Let's remove CTRL+C to quit key handling from bootmenu and eficonfig menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
|
#
8dbd0a0f |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add vertical scroll support The current eficonfig menu does not support vertical scroll, so it can not display the menu entries greater than the console row size. This commit add the vertial scroll support. The console size is retrieved by SIMPLE_TEXT_OUTPUT_PROTOCOL.QueryMode() service, then calculates the row size for menu entry by subtracting menu header and description row size from the console row size. "start" and "end" are added in the efimenu structure. "start" keeps the menu entry index at the top, "end" keeps the bottom menu entry index. item_data_print() menu function only draws the menu entry between "start" and "end". This commit also fixes the issue that "Save" and "Quit" entries can be moved by BKEY_PLUS in change boot order menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
0d590852 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation This commit removes the change boot order specific menu implementation. The change boot order implementation calls eficonfig_process_common() same as other menus. The change boot order menu requires own item_data_print and item_choice implementation, but display_statusline function can be a same function as other menus. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
cd160b27 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor eficonfig_process_common function Current change boot order implementation does not call eficonfig_process_common() and call own menu functions for display_statusline, item_data_print and item_choice. Change boot order functionality should call eficonfig_process_common() to improve maintenanceability. This commit is a preparation to remove the change boot order specific implementation. The menu functions (display_statusline, item_data_print and item_choice) are added as argument of eficonfig_process_common(). The menu description string displayed at the bottom of the menu is also added as argument. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
32bab0ea |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Make use of CLI character processing Avoid duplicating some of the escape-sequence processing here and use the CLI function instead. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
d0ca98db |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Update bootmenu_loop() to return the code Use the return value to save having to pass around a pointer. This also resolves any ambiguity about what *key contains when the function is called. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
2da4a15e |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Rename KEY_... to BKEY_... This enum values conflict with linux/input.h so rename them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
64550274 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: avoid SetVariable between GetNextVariableName calls The current code calls efi_set_variable_int() to delete the invalid boot option between calls to efi_get_next_variable_name_int(), it may produce unpredictable results. This commit moves removal of the invalid boot option outside of the efi_get_next_variable_name_int() calls. EFI_NOT_FOUND returned from efi_get_next_variable_name_int() indicates we retrieved all EFI variables, it should be treated as EFI_SUCEESS. To address the checkpatch warning of too many leading tabs, combine two if statement into one. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
ce327084 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: carve out efi_get_next_variable_name_int calls To retrieve the EFI variable name by efi_get_next_variable_name_int(), the sequence of alloc -> efi_get_next_variable_name_int -> realloc -> efi_get_next_variable_name_int is required. In current code, this sequence repeatedly appears in the several functions. It should be curved out a common function. This commit also fixes the missing free() of var_name16 in eficonfig_delete_invalid_boot_option(). Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
140a8959 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use efi_get_next_variable_name_int() eficonfig command reads all possible UEFI load options from 0x0000 to 0xFFFF to construct the menu. This takes too much time in some environment. This commit uses efi_get_next_variable_name_int() to read all existing UEFI load options to significantlly reduce the count of efi_get_var() call. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
78b1ccc4 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use u16_strsize() to get u16 string buffer size Use u16_strsize() to simplify the u16 string buffer size calculation. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c67d3c9e |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix going one directory up issue The directory name in eficonfig menu entry contains the '\' separator. strcmp() argument ".." is wrong and one directory up handling does not work correctly. strcmp() argument must include '\' separator. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c3b5af63 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add UEFI Secure Boot Key enrollment interface This commit adds the menu-driven UEFI Secure Boot Key enrollment interface. User can enroll PK, KEK, db and dbx by selecting file. Only the signed EFI Signature List(s) with an authenticated header, typically '.auth' file, is accepted. To clear the PK, KEK, db and dbx, user needs to enroll the null key signed by PK or KEK. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
21faf4ef |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use protocol interface for file selection EFI_SIMPLE_FILE_SYSTEM_PROTOCOL is not always provided by U-Boot. Use protocol interface functions instead of U-Boot internal functions. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d6566113 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose eficonfig_create_device_path() Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use eficonfig_create_device_path() to construct the full device path from device path of the volume and file path, so move it out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d571f9b2 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation All the eficonfig menus other than "Change Boot Order" use 'eficonfig_entry' structure for each menu entry. This commit refactors change boot order implementation to use 'eficonfig_entry' structure same as other menus to have consistent menu handling. This commit also simplifies the data->active handling when KEY_SPACE is pressed, and sizeof() parameter. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
8961e93e |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose append entry function Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use append_entry() and append_quit_entry() to construct the menu, so move them out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
a84040ab |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor file selection handling eficonfig_select_file_handler() is commonly used to select the file. eficonfig_display_select_file_option() adds an additional menu to clear the selected file. eficonfig_display_select_file_option() is not always necessary for the file selection process, so it must be outside of eficonfig_select_file_handler(). This commit also renames the following functions to avoid confusion. eficonfig_select_file_handler() -> eficonfig_process_select_file() eficonfig_select_file() -> eficonfig_show_file_selection() eficonfig_display_select_file_option() -> eficonfig_process_show_file_option() Finally, test_eficonfig.py need to be updated to get aligned with the above modification. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
1167e88a |
|
14-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix missing variable initialization The 'ret' variable must be initialized before use in eficonfig_delete_invalid_boot_option(). Fixes: c416f1c0bc ("bootmenu: add removable media entries") Addresses-Coverity: 376207 ("Uninitialized variables") Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
3d595ac5 |
|
09-Nov-2022 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: remove superfluous if in eficonfig_edit_boot_option Goto for an immediately succeeding label is superfluous. Fixes: 87d791423ac6 ("eficonfig: menu-driven addition of UEFI boot option") Addresses-Coverity: 376202 ("Identical code for different branches") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
64658007 |
|
17-Nov-2023 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: eficonfig: create shortened boot options The boot options created by eficonfig should use shortened device-paths to avoid problems if drives are enumerated in a different sequence. Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
9945bc4f |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Fix incorrect return code of boot option update Correct the return code for out-of-memory and no boot option found Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
339b527b |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Move bootorder and bootoption apis to lib Rename and move bootorder and bootoption apis from cmd to lib for re-use between eficonfig and bootmgr Fix 'unexpected indentation' when 'make htmldocs' after functions are moved Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
2c0b0c31 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_SECURE_BOOT This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_SECURE_BOOT defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
83f3d121 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_MM_COMM_TEE This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_MM_COMM_TEE defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
88df3634 |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: CTRL+S to save the boot order 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>
|
#
45f5319f |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
menu: remove CTRL+C to quit On the sandbox called without "--terminal raw" CTRL+C leaves U-Boot, "ESC/CTRL+C to quit" is misleading. Let's remove CTRL+C to quit key handling from bootmenu and eficonfig menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
|
#
8dbd0a0f |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add vertical scroll support The current eficonfig menu does not support vertical scroll, so it can not display the menu entries greater than the console row size. This commit add the vertial scroll support. The console size is retrieved by SIMPLE_TEXT_OUTPUT_PROTOCOL.QueryMode() service, then calculates the row size for menu entry by subtracting menu header and description row size from the console row size. "start" and "end" are added in the efimenu structure. "start" keeps the menu entry index at the top, "end" keeps the bottom menu entry index. item_data_print() menu function only draws the menu entry between "start" and "end". This commit also fixes the issue that "Save" and "Quit" entries can be moved by BKEY_PLUS in change boot order menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
0d590852 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation This commit removes the change boot order specific menu implementation. The change boot order implementation calls eficonfig_process_common() same as other menus. The change boot order menu requires own item_data_print and item_choice implementation, but display_statusline function can be a same function as other menus. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
cd160b27 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor eficonfig_process_common function Current change boot order implementation does not call eficonfig_process_common() and call own menu functions for display_statusline, item_data_print and item_choice. Change boot order functionality should call eficonfig_process_common() to improve maintenanceability. This commit is a preparation to remove the change boot order specific implementation. The menu functions (display_statusline, item_data_print and item_choice) are added as argument of eficonfig_process_common(). The menu description string displayed at the bottom of the menu is also added as argument. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
32bab0ea |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Make use of CLI character processing Avoid duplicating some of the escape-sequence processing here and use the CLI function instead. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
d0ca98db |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Update bootmenu_loop() to return the code Use the return value to save having to pass around a pointer. This also resolves any ambiguity about what *key contains when the function is called. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
2da4a15e |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Rename KEY_... to BKEY_... This enum values conflict with linux/input.h so rename them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
64550274 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: avoid SetVariable between GetNextVariableName calls The current code calls efi_set_variable_int() to delete the invalid boot option between calls to efi_get_next_variable_name_int(), it may produce unpredictable results. This commit moves removal of the invalid boot option outside of the efi_get_next_variable_name_int() calls. EFI_NOT_FOUND returned from efi_get_next_variable_name_int() indicates we retrieved all EFI variables, it should be treated as EFI_SUCEESS. To address the checkpatch warning of too many leading tabs, combine two if statement into one. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
ce327084 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: carve out efi_get_next_variable_name_int calls To retrieve the EFI variable name by efi_get_next_variable_name_int(), the sequence of alloc -> efi_get_next_variable_name_int -> realloc -> efi_get_next_variable_name_int is required. In current code, this sequence repeatedly appears in the several functions. It should be curved out a common function. This commit also fixes the missing free() of var_name16 in eficonfig_delete_invalid_boot_option(). Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
140a8959 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use efi_get_next_variable_name_int() eficonfig command reads all possible UEFI load options from 0x0000 to 0xFFFF to construct the menu. This takes too much time in some environment. This commit uses efi_get_next_variable_name_int() to read all existing UEFI load options to significantlly reduce the count of efi_get_var() call. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
78b1ccc4 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use u16_strsize() to get u16 string buffer size Use u16_strsize() to simplify the u16 string buffer size calculation. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c67d3c9e |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix going one directory up issue The directory name in eficonfig menu entry contains the '\' separator. strcmp() argument ".." is wrong and one directory up handling does not work correctly. strcmp() argument must include '\' separator. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c3b5af63 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add UEFI Secure Boot Key enrollment interface This commit adds the menu-driven UEFI Secure Boot Key enrollment interface. User can enroll PK, KEK, db and dbx by selecting file. Only the signed EFI Signature List(s) with an authenticated header, typically '.auth' file, is accepted. To clear the PK, KEK, db and dbx, user needs to enroll the null key signed by PK or KEK. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
21faf4ef |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use protocol interface for file selection EFI_SIMPLE_FILE_SYSTEM_PROTOCOL is not always provided by U-Boot. Use protocol interface functions instead of U-Boot internal functions. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d6566113 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose eficonfig_create_device_path() Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use eficonfig_create_device_path() to construct the full device path from device path of the volume and file path, so move it out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d571f9b2 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation All the eficonfig menus other than "Change Boot Order" use 'eficonfig_entry' structure for each menu entry. This commit refactors change boot order implementation to use 'eficonfig_entry' structure same as other menus to have consistent menu handling. This commit also simplifies the data->active handling when KEY_SPACE is pressed, and sizeof() parameter. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
8961e93e |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose append entry function Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use append_entry() and append_quit_entry() to construct the menu, so move them out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
a84040ab |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor file selection handling eficonfig_select_file_handler() is commonly used to select the file. eficonfig_display_select_file_option() adds an additional menu to clear the selected file. eficonfig_display_select_file_option() is not always necessary for the file selection process, so it must be outside of eficonfig_select_file_handler(). This commit also renames the following functions to avoid confusion. eficonfig_select_file_handler() -> eficonfig_process_select_file() eficonfig_select_file() -> eficonfig_show_file_selection() eficonfig_display_select_file_option() -> eficonfig_process_show_file_option() Finally, test_eficonfig.py need to be updated to get aligned with the above modification. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
1167e88a |
|
14-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix missing variable initialization The 'ret' variable must be initialized before use in eficonfig_delete_invalid_boot_option(). Fixes: c416f1c0bc ("bootmenu: add removable media entries") Addresses-Coverity: 376207 ("Uninitialized variables") Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
3d595ac5 |
|
09-Nov-2022 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: remove superfluous if in eficonfig_edit_boot_option Goto for an immediately succeeding label is superfluous. Fixes: 87d791423ac6 ("eficonfig: menu-driven addition of UEFI boot option") Addresses-Coverity: 376202 ("Identical code for different branches") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
64658007 |
|
17-Nov-2023 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: eficonfig: create shortened boot options The boot options created by eficonfig should use shortened device-paths to avoid problems if drives are enumerated in a different sequence. Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
9945bc4f |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Fix incorrect return code of boot option update Correct the return code for out-of-memory and no boot option found Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
339b527b |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Move bootorder and bootoption apis to lib Rename and move bootorder and bootoption apis from cmd to lib for re-use between eficonfig and bootmgr Fix 'unexpected indentation' when 'make htmldocs' after functions are moved Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
2c0b0c31 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_SECURE_BOOT This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_SECURE_BOOT defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
83f3d121 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_MM_COMM_TEE This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_MM_COMM_TEE defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
88df3634 |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: CTRL+S to save the boot order 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>
|
#
45f5319f |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
menu: remove CTRL+C to quit On the sandbox called without "--terminal raw" CTRL+C leaves U-Boot, "ESC/CTRL+C to quit" is misleading. Let's remove CTRL+C to quit key handling from bootmenu and eficonfig menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
|
#
8dbd0a0f |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add vertical scroll support The current eficonfig menu does not support vertical scroll, so it can not display the menu entries greater than the console row size. This commit add the vertial scroll support. The console size is retrieved by SIMPLE_TEXT_OUTPUT_PROTOCOL.QueryMode() service, then calculates the row size for menu entry by subtracting menu header and description row size from the console row size. "start" and "end" are added in the efimenu structure. "start" keeps the menu entry index at the top, "end" keeps the bottom menu entry index. item_data_print() menu function only draws the menu entry between "start" and "end". This commit also fixes the issue that "Save" and "Quit" entries can be moved by BKEY_PLUS in change boot order menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
0d590852 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation This commit removes the change boot order specific menu implementation. The change boot order implementation calls eficonfig_process_common() same as other menus. The change boot order menu requires own item_data_print and item_choice implementation, but display_statusline function can be a same function as other menus. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
cd160b27 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor eficonfig_process_common function Current change boot order implementation does not call eficonfig_process_common() and call own menu functions for display_statusline, item_data_print and item_choice. Change boot order functionality should call eficonfig_process_common() to improve maintenanceability. This commit is a preparation to remove the change boot order specific implementation. The menu functions (display_statusline, item_data_print and item_choice) are added as argument of eficonfig_process_common(). The menu description string displayed at the bottom of the menu is also added as argument. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
32bab0ea |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Make use of CLI character processing Avoid duplicating some of the escape-sequence processing here and use the CLI function instead. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
d0ca98db |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Update bootmenu_loop() to return the code Use the return value to save having to pass around a pointer. This also resolves any ambiguity about what *key contains when the function is called. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
2da4a15e |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Rename KEY_... to BKEY_... This enum values conflict with linux/input.h so rename them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
64550274 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: avoid SetVariable between GetNextVariableName calls The current code calls efi_set_variable_int() to delete the invalid boot option between calls to efi_get_next_variable_name_int(), it may produce unpredictable results. This commit moves removal of the invalid boot option outside of the efi_get_next_variable_name_int() calls. EFI_NOT_FOUND returned from efi_get_next_variable_name_int() indicates we retrieved all EFI variables, it should be treated as EFI_SUCEESS. To address the checkpatch warning of too many leading tabs, combine two if statement into one. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
ce327084 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: carve out efi_get_next_variable_name_int calls To retrieve the EFI variable name by efi_get_next_variable_name_int(), the sequence of alloc -> efi_get_next_variable_name_int -> realloc -> efi_get_next_variable_name_int is required. In current code, this sequence repeatedly appears in the several functions. It should be curved out a common function. This commit also fixes the missing free() of var_name16 in eficonfig_delete_invalid_boot_option(). Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
140a8959 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use efi_get_next_variable_name_int() eficonfig command reads all possible UEFI load options from 0x0000 to 0xFFFF to construct the menu. This takes too much time in some environment. This commit uses efi_get_next_variable_name_int() to read all existing UEFI load options to significantlly reduce the count of efi_get_var() call. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
78b1ccc4 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use u16_strsize() to get u16 string buffer size Use u16_strsize() to simplify the u16 string buffer size calculation. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c67d3c9e |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix going one directory up issue The directory name in eficonfig menu entry contains the '\' separator. strcmp() argument ".." is wrong and one directory up handling does not work correctly. strcmp() argument must include '\' separator. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c3b5af63 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add UEFI Secure Boot Key enrollment interface This commit adds the menu-driven UEFI Secure Boot Key enrollment interface. User can enroll PK, KEK, db and dbx by selecting file. Only the signed EFI Signature List(s) with an authenticated header, typically '.auth' file, is accepted. To clear the PK, KEK, db and dbx, user needs to enroll the null key signed by PK or KEK. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
21faf4ef |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use protocol interface for file selection EFI_SIMPLE_FILE_SYSTEM_PROTOCOL is not always provided by U-Boot. Use protocol interface functions instead of U-Boot internal functions. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d6566113 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose eficonfig_create_device_path() Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use eficonfig_create_device_path() to construct the full device path from device path of the volume and file path, so move it out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d571f9b2 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation All the eficonfig menus other than "Change Boot Order" use 'eficonfig_entry' structure for each menu entry. This commit refactors change boot order implementation to use 'eficonfig_entry' structure same as other menus to have consistent menu handling. This commit also simplifies the data->active handling when KEY_SPACE is pressed, and sizeof() parameter. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
8961e93e |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose append entry function Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use append_entry() and append_quit_entry() to construct the menu, so move them out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
a84040ab |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor file selection handling eficonfig_select_file_handler() is commonly used to select the file. eficonfig_display_select_file_option() adds an additional menu to clear the selected file. eficonfig_display_select_file_option() is not always necessary for the file selection process, so it must be outside of eficonfig_select_file_handler(). This commit also renames the following functions to avoid confusion. eficonfig_select_file_handler() -> eficonfig_process_select_file() eficonfig_select_file() -> eficonfig_show_file_selection() eficonfig_display_select_file_option() -> eficonfig_process_show_file_option() Finally, test_eficonfig.py need to be updated to get aligned with the above modification. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
1167e88a |
|
14-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix missing variable initialization The 'ret' variable must be initialized before use in eficonfig_delete_invalid_boot_option(). Fixes: c416f1c0bc ("bootmenu: add removable media entries") Addresses-Coverity: 376207 ("Uninitialized variables") Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
3d595ac5 |
|
09-Nov-2022 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: remove superfluous if in eficonfig_edit_boot_option Goto for an immediately succeeding label is superfluous. Fixes: 87d791423ac6 ("eficonfig: menu-driven addition of UEFI boot option") Addresses-Coverity: 376202 ("Identical code for different branches") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
64658007 |
|
17-Nov-2023 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: eficonfig: create shortened boot options The boot options created by eficonfig should use shortened device-paths to avoid problems if drives are enumerated in a different sequence. Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
9945bc4f |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Fix incorrect return code of boot option update Correct the return code for out-of-memory and no boot option found Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
339b527b |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Move bootorder and bootoption apis to lib Rename and move bootorder and bootoption apis from cmd to lib for re-use between eficonfig and bootmgr Fix 'unexpected indentation' when 'make htmldocs' after functions are moved Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
2c0b0c31 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_SECURE_BOOT This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_SECURE_BOOT defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
83f3d121 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_MM_COMM_TEE This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_MM_COMM_TEE defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
88df3634 |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: CTRL+S to save the boot order 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>
|
#
45f5319f |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
menu: remove CTRL+C to quit On the sandbox called without "--terminal raw" CTRL+C leaves U-Boot, "ESC/CTRL+C to quit" is misleading. Let's remove CTRL+C to quit key handling from bootmenu and eficonfig menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
|
#
8dbd0a0f |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add vertical scroll support The current eficonfig menu does not support vertical scroll, so it can not display the menu entries greater than the console row size. This commit add the vertial scroll support. The console size is retrieved by SIMPLE_TEXT_OUTPUT_PROTOCOL.QueryMode() service, then calculates the row size for menu entry by subtracting menu header and description row size from the console row size. "start" and "end" are added in the efimenu structure. "start" keeps the menu entry index at the top, "end" keeps the bottom menu entry index. item_data_print() menu function only draws the menu entry between "start" and "end". This commit also fixes the issue that "Save" and "Quit" entries can be moved by BKEY_PLUS in change boot order menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
0d590852 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation This commit removes the change boot order specific menu implementation. The change boot order implementation calls eficonfig_process_common() same as other menus. The change boot order menu requires own item_data_print and item_choice implementation, but display_statusline function can be a same function as other menus. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
cd160b27 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor eficonfig_process_common function Current change boot order implementation does not call eficonfig_process_common() and call own menu functions for display_statusline, item_data_print and item_choice. Change boot order functionality should call eficonfig_process_common() to improve maintenanceability. This commit is a preparation to remove the change boot order specific implementation. The menu functions (display_statusline, item_data_print and item_choice) are added as argument of eficonfig_process_common(). The menu description string displayed at the bottom of the menu is also added as argument. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
32bab0ea |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Make use of CLI character processing Avoid duplicating some of the escape-sequence processing here and use the CLI function instead. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
d0ca98db |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Update bootmenu_loop() to return the code Use the return value to save having to pass around a pointer. This also resolves any ambiguity about what *key contains when the function is called. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
2da4a15e |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Rename KEY_... to BKEY_... This enum values conflict with linux/input.h so rename them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
64550274 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: avoid SetVariable between GetNextVariableName calls The current code calls efi_set_variable_int() to delete the invalid boot option between calls to efi_get_next_variable_name_int(), it may produce unpredictable results. This commit moves removal of the invalid boot option outside of the efi_get_next_variable_name_int() calls. EFI_NOT_FOUND returned from efi_get_next_variable_name_int() indicates we retrieved all EFI variables, it should be treated as EFI_SUCEESS. To address the checkpatch warning of too many leading tabs, combine two if statement into one. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
ce327084 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: carve out efi_get_next_variable_name_int calls To retrieve the EFI variable name by efi_get_next_variable_name_int(), the sequence of alloc -> efi_get_next_variable_name_int -> realloc -> efi_get_next_variable_name_int is required. In current code, this sequence repeatedly appears in the several functions. It should be curved out a common function. This commit also fixes the missing free() of var_name16 in eficonfig_delete_invalid_boot_option(). Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
140a8959 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use efi_get_next_variable_name_int() eficonfig command reads all possible UEFI load options from 0x0000 to 0xFFFF to construct the menu. This takes too much time in some environment. This commit uses efi_get_next_variable_name_int() to read all existing UEFI load options to significantlly reduce the count of efi_get_var() call. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
78b1ccc4 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use u16_strsize() to get u16 string buffer size Use u16_strsize() to simplify the u16 string buffer size calculation. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c67d3c9e |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix going one directory up issue The directory name in eficonfig menu entry contains the '\' separator. strcmp() argument ".." is wrong and one directory up handling does not work correctly. strcmp() argument must include '\' separator. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c3b5af63 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add UEFI Secure Boot Key enrollment interface This commit adds the menu-driven UEFI Secure Boot Key enrollment interface. User can enroll PK, KEK, db and dbx by selecting file. Only the signed EFI Signature List(s) with an authenticated header, typically '.auth' file, is accepted. To clear the PK, KEK, db and dbx, user needs to enroll the null key signed by PK or KEK. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
21faf4ef |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use protocol interface for file selection EFI_SIMPLE_FILE_SYSTEM_PROTOCOL is not always provided by U-Boot. Use protocol interface functions instead of U-Boot internal functions. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d6566113 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose eficonfig_create_device_path() Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use eficonfig_create_device_path() to construct the full device path from device path of the volume and file path, so move it out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d571f9b2 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation All the eficonfig menus other than "Change Boot Order" use 'eficonfig_entry' structure for each menu entry. This commit refactors change boot order implementation to use 'eficonfig_entry' structure same as other menus to have consistent menu handling. This commit also simplifies the data->active handling when KEY_SPACE is pressed, and sizeof() parameter. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
8961e93e |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose append entry function Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use append_entry() and append_quit_entry() to construct the menu, so move them out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
a84040ab |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor file selection handling eficonfig_select_file_handler() is commonly used to select the file. eficonfig_display_select_file_option() adds an additional menu to clear the selected file. eficonfig_display_select_file_option() is not always necessary for the file selection process, so it must be outside of eficonfig_select_file_handler(). This commit also renames the following functions to avoid confusion. eficonfig_select_file_handler() -> eficonfig_process_select_file() eficonfig_select_file() -> eficonfig_show_file_selection() eficonfig_display_select_file_option() -> eficonfig_process_show_file_option() Finally, test_eficonfig.py need to be updated to get aligned with the above modification. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
1167e88a |
|
14-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix missing variable initialization The 'ret' variable must be initialized before use in eficonfig_delete_invalid_boot_option(). Fixes: c416f1c0bc ("bootmenu: add removable media entries") Addresses-Coverity: 376207 ("Uninitialized variables") Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
3d595ac5 |
|
09-Nov-2022 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: remove superfluous if in eficonfig_edit_boot_option Goto for an immediately succeeding label is superfluous. Fixes: 87d791423ac6 ("eficonfig: menu-driven addition of UEFI boot option") Addresses-Coverity: 376202 ("Identical code for different branches") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
64658007 |
|
17-Nov-2023 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: eficonfig: create shortened boot options The boot options created by eficonfig should use shortened device-paths to avoid problems if drives are enumerated in a different sequence. Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
9945bc4f |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Fix incorrect return code of boot option update Correct the return code for out-of-memory and no boot option found Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
339b527b |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Move bootorder and bootoption apis to lib Rename and move bootorder and bootoption apis from cmd to lib for re-use between eficonfig and bootmgr Fix 'unexpected indentation' when 'make htmldocs' after functions are moved Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
2c0b0c31 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_SECURE_BOOT This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_SECURE_BOOT defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
83f3d121 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_MM_COMM_TEE This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_MM_COMM_TEE defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
88df3634 |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: CTRL+S to save the boot order 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>
|
#
45f5319f |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
menu: remove CTRL+C to quit On the sandbox called without "--terminal raw" CTRL+C leaves U-Boot, "ESC/CTRL+C to quit" is misleading. Let's remove CTRL+C to quit key handling from bootmenu and eficonfig menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
|
#
8dbd0a0f |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add vertical scroll support The current eficonfig menu does not support vertical scroll, so it can not display the menu entries greater than the console row size. This commit add the vertial scroll support. The console size is retrieved by SIMPLE_TEXT_OUTPUT_PROTOCOL.QueryMode() service, then calculates the row size for menu entry by subtracting menu header and description row size from the console row size. "start" and "end" are added in the efimenu structure. "start" keeps the menu entry index at the top, "end" keeps the bottom menu entry index. item_data_print() menu function only draws the menu entry between "start" and "end". This commit also fixes the issue that "Save" and "Quit" entries can be moved by BKEY_PLUS in change boot order menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
0d590852 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation This commit removes the change boot order specific menu implementation. The change boot order implementation calls eficonfig_process_common() same as other menus. The change boot order menu requires own item_data_print and item_choice implementation, but display_statusline function can be a same function as other menus. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
cd160b27 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor eficonfig_process_common function Current change boot order implementation does not call eficonfig_process_common() and call own menu functions for display_statusline, item_data_print and item_choice. Change boot order functionality should call eficonfig_process_common() to improve maintenanceability. This commit is a preparation to remove the change boot order specific implementation. The menu functions (display_statusline, item_data_print and item_choice) are added as argument of eficonfig_process_common(). The menu description string displayed at the bottom of the menu is also added as argument. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
32bab0ea |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Make use of CLI character processing Avoid duplicating some of the escape-sequence processing here and use the CLI function instead. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
d0ca98db |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Update bootmenu_loop() to return the code Use the return value to save having to pass around a pointer. This also resolves any ambiguity about what *key contains when the function is called. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
2da4a15e |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Rename KEY_... to BKEY_... This enum values conflict with linux/input.h so rename them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
64550274 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: avoid SetVariable between GetNextVariableName calls The current code calls efi_set_variable_int() to delete the invalid boot option between calls to efi_get_next_variable_name_int(), it may produce unpredictable results. This commit moves removal of the invalid boot option outside of the efi_get_next_variable_name_int() calls. EFI_NOT_FOUND returned from efi_get_next_variable_name_int() indicates we retrieved all EFI variables, it should be treated as EFI_SUCEESS. To address the checkpatch warning of too many leading tabs, combine two if statement into one. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
ce327084 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: carve out efi_get_next_variable_name_int calls To retrieve the EFI variable name by efi_get_next_variable_name_int(), the sequence of alloc -> efi_get_next_variable_name_int -> realloc -> efi_get_next_variable_name_int is required. In current code, this sequence repeatedly appears in the several functions. It should be curved out a common function. This commit also fixes the missing free() of var_name16 in eficonfig_delete_invalid_boot_option(). Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
140a8959 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use efi_get_next_variable_name_int() eficonfig command reads all possible UEFI load options from 0x0000 to 0xFFFF to construct the menu. This takes too much time in some environment. This commit uses efi_get_next_variable_name_int() to read all existing UEFI load options to significantlly reduce the count of efi_get_var() call. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
78b1ccc4 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use u16_strsize() to get u16 string buffer size Use u16_strsize() to simplify the u16 string buffer size calculation. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c67d3c9e |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix going one directory up issue The directory name in eficonfig menu entry contains the '\' separator. strcmp() argument ".." is wrong and one directory up handling does not work correctly. strcmp() argument must include '\' separator. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c3b5af63 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add UEFI Secure Boot Key enrollment interface This commit adds the menu-driven UEFI Secure Boot Key enrollment interface. User can enroll PK, KEK, db and dbx by selecting file. Only the signed EFI Signature List(s) with an authenticated header, typically '.auth' file, is accepted. To clear the PK, KEK, db and dbx, user needs to enroll the null key signed by PK or KEK. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
21faf4ef |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use protocol interface for file selection EFI_SIMPLE_FILE_SYSTEM_PROTOCOL is not always provided by U-Boot. Use protocol interface functions instead of U-Boot internal functions. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d6566113 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose eficonfig_create_device_path() Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use eficonfig_create_device_path() to construct the full device path from device path of the volume and file path, so move it out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d571f9b2 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation All the eficonfig menus other than "Change Boot Order" use 'eficonfig_entry' structure for each menu entry. This commit refactors change boot order implementation to use 'eficonfig_entry' structure same as other menus to have consistent menu handling. This commit also simplifies the data->active handling when KEY_SPACE is pressed, and sizeof() parameter. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
8961e93e |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose append entry function Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use append_entry() and append_quit_entry() to construct the menu, so move them out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
a84040ab |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor file selection handling eficonfig_select_file_handler() is commonly used to select the file. eficonfig_display_select_file_option() adds an additional menu to clear the selected file. eficonfig_display_select_file_option() is not always necessary for the file selection process, so it must be outside of eficonfig_select_file_handler(). This commit also renames the following functions to avoid confusion. eficonfig_select_file_handler() -> eficonfig_process_select_file() eficonfig_select_file() -> eficonfig_show_file_selection() eficonfig_display_select_file_option() -> eficonfig_process_show_file_option() Finally, test_eficonfig.py need to be updated to get aligned with the above modification. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
1167e88a |
|
14-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix missing variable initialization The 'ret' variable must be initialized before use in eficonfig_delete_invalid_boot_option(). Fixes: c416f1c0bc ("bootmenu: add removable media entries") Addresses-Coverity: 376207 ("Uninitialized variables") Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
3d595ac5 |
|
09-Nov-2022 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: remove superfluous if in eficonfig_edit_boot_option Goto for an immediately succeeding label is superfluous. Fixes: 87d791423ac6 ("eficonfig: menu-driven addition of UEFI boot option") Addresses-Coverity: 376202 ("Identical code for different branches") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
64658007 |
|
17-Nov-2023 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: eficonfig: create shortened boot options The boot options created by eficonfig should use shortened device-paths to avoid problems if drives are enumerated in a different sequence. Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
9945bc4f |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Fix incorrect return code of boot option update Correct the return code for out-of-memory and no boot option found Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
339b527b |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Move bootorder and bootoption apis to lib Rename and move bootorder and bootoption apis from cmd to lib for re-use between eficonfig and bootmgr Fix 'unexpected indentation' when 'make htmldocs' after functions are moved Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
2c0b0c31 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_SECURE_BOOT This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_SECURE_BOOT defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
83f3d121 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_MM_COMM_TEE This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_MM_COMM_TEE defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
88df3634 |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: CTRL+S to save the boot order 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>
|
#
45f5319f |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
menu: remove CTRL+C to quit On the sandbox called without "--terminal raw" CTRL+C leaves U-Boot, "ESC/CTRL+C to quit" is misleading. Let's remove CTRL+C to quit key handling from bootmenu and eficonfig menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
|
#
8dbd0a0f |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add vertical scroll support The current eficonfig menu does not support vertical scroll, so it can not display the menu entries greater than the console row size. This commit add the vertial scroll support. The console size is retrieved by SIMPLE_TEXT_OUTPUT_PROTOCOL.QueryMode() service, then calculates the row size for menu entry by subtracting menu header and description row size from the console row size. "start" and "end" are added in the efimenu structure. "start" keeps the menu entry index at the top, "end" keeps the bottom menu entry index. item_data_print() menu function only draws the menu entry between "start" and "end". This commit also fixes the issue that "Save" and "Quit" entries can be moved by BKEY_PLUS in change boot order menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
0d590852 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation This commit removes the change boot order specific menu implementation. The change boot order implementation calls eficonfig_process_common() same as other menus. The change boot order menu requires own item_data_print and item_choice implementation, but display_statusline function can be a same function as other menus. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
cd160b27 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor eficonfig_process_common function Current change boot order implementation does not call eficonfig_process_common() and call own menu functions for display_statusline, item_data_print and item_choice. Change boot order functionality should call eficonfig_process_common() to improve maintenanceability. This commit is a preparation to remove the change boot order specific implementation. The menu functions (display_statusline, item_data_print and item_choice) are added as argument of eficonfig_process_common(). The menu description string displayed at the bottom of the menu is also added as argument. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
32bab0ea |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Make use of CLI character processing Avoid duplicating some of the escape-sequence processing here and use the CLI function instead. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
d0ca98db |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Update bootmenu_loop() to return the code Use the return value to save having to pass around a pointer. This also resolves any ambiguity about what *key contains when the function is called. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
2da4a15e |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Rename KEY_... to BKEY_... This enum values conflict with linux/input.h so rename them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
64550274 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: avoid SetVariable between GetNextVariableName calls The current code calls efi_set_variable_int() to delete the invalid boot option between calls to efi_get_next_variable_name_int(), it may produce unpredictable results. This commit moves removal of the invalid boot option outside of the efi_get_next_variable_name_int() calls. EFI_NOT_FOUND returned from efi_get_next_variable_name_int() indicates we retrieved all EFI variables, it should be treated as EFI_SUCEESS. To address the checkpatch warning of too many leading tabs, combine two if statement into one. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
ce327084 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: carve out efi_get_next_variable_name_int calls To retrieve the EFI variable name by efi_get_next_variable_name_int(), the sequence of alloc -> efi_get_next_variable_name_int -> realloc -> efi_get_next_variable_name_int is required. In current code, this sequence repeatedly appears in the several functions. It should be curved out a common function. This commit also fixes the missing free() of var_name16 in eficonfig_delete_invalid_boot_option(). Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
140a8959 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use efi_get_next_variable_name_int() eficonfig command reads all possible UEFI load options from 0x0000 to 0xFFFF to construct the menu. This takes too much time in some environment. This commit uses efi_get_next_variable_name_int() to read all existing UEFI load options to significantlly reduce the count of efi_get_var() call. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
78b1ccc4 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use u16_strsize() to get u16 string buffer size Use u16_strsize() to simplify the u16 string buffer size calculation. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c67d3c9e |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix going one directory up issue The directory name in eficonfig menu entry contains the '\' separator. strcmp() argument ".." is wrong and one directory up handling does not work correctly. strcmp() argument must include '\' separator. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c3b5af63 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add UEFI Secure Boot Key enrollment interface This commit adds the menu-driven UEFI Secure Boot Key enrollment interface. User can enroll PK, KEK, db and dbx by selecting file. Only the signed EFI Signature List(s) with an authenticated header, typically '.auth' file, is accepted. To clear the PK, KEK, db and dbx, user needs to enroll the null key signed by PK or KEK. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
21faf4ef |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use protocol interface for file selection EFI_SIMPLE_FILE_SYSTEM_PROTOCOL is not always provided by U-Boot. Use protocol interface functions instead of U-Boot internal functions. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d6566113 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose eficonfig_create_device_path() Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use eficonfig_create_device_path() to construct the full device path from device path of the volume and file path, so move it out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d571f9b2 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation All the eficonfig menus other than "Change Boot Order" use 'eficonfig_entry' structure for each menu entry. This commit refactors change boot order implementation to use 'eficonfig_entry' structure same as other menus to have consistent menu handling. This commit also simplifies the data->active handling when KEY_SPACE is pressed, and sizeof() parameter. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
8961e93e |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose append entry function Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use append_entry() and append_quit_entry() to construct the menu, so move them out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
a84040ab |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor file selection handling eficonfig_select_file_handler() is commonly used to select the file. eficonfig_display_select_file_option() adds an additional menu to clear the selected file. eficonfig_display_select_file_option() is not always necessary for the file selection process, so it must be outside of eficonfig_select_file_handler(). This commit also renames the following functions to avoid confusion. eficonfig_select_file_handler() -> eficonfig_process_select_file() eficonfig_select_file() -> eficonfig_show_file_selection() eficonfig_display_select_file_option() -> eficonfig_process_show_file_option() Finally, test_eficonfig.py need to be updated to get aligned with the above modification. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
1167e88a |
|
14-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix missing variable initialization The 'ret' variable must be initialized before use in eficonfig_delete_invalid_boot_option(). Fixes: c416f1c0bc ("bootmenu: add removable media entries") Addresses-Coverity: 376207 ("Uninitialized variables") Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
3d595ac5 |
|
09-Nov-2022 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: remove superfluous if in eficonfig_edit_boot_option Goto for an immediately succeeding label is superfluous. Fixes: 87d791423ac6 ("eficonfig: menu-driven addition of UEFI boot option") Addresses-Coverity: 376202 ("Identical code for different branches") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
64658007 |
|
17-Nov-2023 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: eficonfig: create shortened boot options The boot options created by eficonfig should use shortened device-paths to avoid problems if drives are enumerated in a different sequence. Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
9945bc4f |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Fix incorrect return code of boot option update Correct the return code for out-of-memory and no boot option found Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
339b527b |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Move bootorder and bootoption apis to lib Rename and move bootorder and bootoption apis from cmd to lib for re-use between eficonfig and bootmgr Fix 'unexpected indentation' when 'make htmldocs' after functions are moved Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
2c0b0c31 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_SECURE_BOOT This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_SECURE_BOOT defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
83f3d121 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_MM_COMM_TEE This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_MM_COMM_TEE defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
88df3634 |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: CTRL+S to save the boot order 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>
|
#
45f5319f |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
menu: remove CTRL+C to quit On the sandbox called without "--terminal raw" CTRL+C leaves U-Boot, "ESC/CTRL+C to quit" is misleading. Let's remove CTRL+C to quit key handling from bootmenu and eficonfig menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
|
#
8dbd0a0f |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add vertical scroll support The current eficonfig menu does not support vertical scroll, so it can not display the menu entries greater than the console row size. This commit add the vertial scroll support. The console size is retrieved by SIMPLE_TEXT_OUTPUT_PROTOCOL.QueryMode() service, then calculates the row size for menu entry by subtracting menu header and description row size from the console row size. "start" and "end" are added in the efimenu structure. "start" keeps the menu entry index at the top, "end" keeps the bottom menu entry index. item_data_print() menu function only draws the menu entry between "start" and "end". This commit also fixes the issue that "Save" and "Quit" entries can be moved by BKEY_PLUS in change boot order menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
0d590852 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation This commit removes the change boot order specific menu implementation. The change boot order implementation calls eficonfig_process_common() same as other menus. The change boot order menu requires own item_data_print and item_choice implementation, but display_statusline function can be a same function as other menus. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
cd160b27 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor eficonfig_process_common function Current change boot order implementation does not call eficonfig_process_common() and call own menu functions for display_statusline, item_data_print and item_choice. Change boot order functionality should call eficonfig_process_common() to improve maintenanceability. This commit is a preparation to remove the change boot order specific implementation. The menu functions (display_statusline, item_data_print and item_choice) are added as argument of eficonfig_process_common(). The menu description string displayed at the bottom of the menu is also added as argument. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
32bab0ea |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Make use of CLI character processing Avoid duplicating some of the escape-sequence processing here and use the CLI function instead. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
d0ca98db |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Update bootmenu_loop() to return the code Use the return value to save having to pass around a pointer. This also resolves any ambiguity about what *key contains when the function is called. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
2da4a15e |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Rename KEY_... to BKEY_... This enum values conflict with linux/input.h so rename them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
64550274 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: avoid SetVariable between GetNextVariableName calls The current code calls efi_set_variable_int() to delete the invalid boot option between calls to efi_get_next_variable_name_int(), it may produce unpredictable results. This commit moves removal of the invalid boot option outside of the efi_get_next_variable_name_int() calls. EFI_NOT_FOUND returned from efi_get_next_variable_name_int() indicates we retrieved all EFI variables, it should be treated as EFI_SUCEESS. To address the checkpatch warning of too many leading tabs, combine two if statement into one. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
ce327084 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: carve out efi_get_next_variable_name_int calls To retrieve the EFI variable name by efi_get_next_variable_name_int(), the sequence of alloc -> efi_get_next_variable_name_int -> realloc -> efi_get_next_variable_name_int is required. In current code, this sequence repeatedly appears in the several functions. It should be curved out a common function. This commit also fixes the missing free() of var_name16 in eficonfig_delete_invalid_boot_option(). Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
140a8959 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use efi_get_next_variable_name_int() eficonfig command reads all possible UEFI load options from 0x0000 to 0xFFFF to construct the menu. This takes too much time in some environment. This commit uses efi_get_next_variable_name_int() to read all existing UEFI load options to significantlly reduce the count of efi_get_var() call. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
78b1ccc4 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use u16_strsize() to get u16 string buffer size Use u16_strsize() to simplify the u16 string buffer size calculation. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c67d3c9e |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix going one directory up issue The directory name in eficonfig menu entry contains the '\' separator. strcmp() argument ".." is wrong and one directory up handling does not work correctly. strcmp() argument must include '\' separator. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c3b5af63 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add UEFI Secure Boot Key enrollment interface This commit adds the menu-driven UEFI Secure Boot Key enrollment interface. User can enroll PK, KEK, db and dbx by selecting file. Only the signed EFI Signature List(s) with an authenticated header, typically '.auth' file, is accepted. To clear the PK, KEK, db and dbx, user needs to enroll the null key signed by PK or KEK. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
21faf4ef |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use protocol interface for file selection EFI_SIMPLE_FILE_SYSTEM_PROTOCOL is not always provided by U-Boot. Use protocol interface functions instead of U-Boot internal functions. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d6566113 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose eficonfig_create_device_path() Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use eficonfig_create_device_path() to construct the full device path from device path of the volume and file path, so move it out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d571f9b2 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation All the eficonfig menus other than "Change Boot Order" use 'eficonfig_entry' structure for each menu entry. This commit refactors change boot order implementation to use 'eficonfig_entry' structure same as other menus to have consistent menu handling. This commit also simplifies the data->active handling when KEY_SPACE is pressed, and sizeof() parameter. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
8961e93e |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose append entry function Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use append_entry() and append_quit_entry() to construct the menu, so move them out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
a84040ab |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor file selection handling eficonfig_select_file_handler() is commonly used to select the file. eficonfig_display_select_file_option() adds an additional menu to clear the selected file. eficonfig_display_select_file_option() is not always necessary for the file selection process, so it must be outside of eficonfig_select_file_handler(). This commit also renames the following functions to avoid confusion. eficonfig_select_file_handler() -> eficonfig_process_select_file() eficonfig_select_file() -> eficonfig_show_file_selection() eficonfig_display_select_file_option() -> eficonfig_process_show_file_option() Finally, test_eficonfig.py need to be updated to get aligned with the above modification. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
1167e88a |
|
14-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix missing variable initialization The 'ret' variable must be initialized before use in eficonfig_delete_invalid_boot_option(). Fixes: c416f1c0bc ("bootmenu: add removable media entries") Addresses-Coverity: 376207 ("Uninitialized variables") Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
3d595ac5 |
|
09-Nov-2022 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: remove superfluous if in eficonfig_edit_boot_option Goto for an immediately succeeding label is superfluous. Fixes: 87d791423ac6 ("eficonfig: menu-driven addition of UEFI boot option") Addresses-Coverity: 376202 ("Identical code for different branches") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
64658007 |
|
17-Nov-2023 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: eficonfig: create shortened boot options The boot options created by eficonfig should use shortened device-paths to avoid problems if drives are enumerated in a different sequence. Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
9945bc4f |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Fix incorrect return code of boot option update Correct the return code for out-of-memory and no boot option found Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
339b527b |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Move bootorder and bootoption apis to lib Rename and move bootorder and bootoption apis from cmd to lib for re-use between eficonfig and bootmgr Fix 'unexpected indentation' when 'make htmldocs' after functions are moved Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
2c0b0c31 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_SECURE_BOOT This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_SECURE_BOOT defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
83f3d121 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_MM_COMM_TEE This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_MM_COMM_TEE defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
88df3634 |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: CTRL+S to save the boot order 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>
|
#
45f5319f |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
menu: remove CTRL+C to quit On the sandbox called without "--terminal raw" CTRL+C leaves U-Boot, "ESC/CTRL+C to quit" is misleading. Let's remove CTRL+C to quit key handling from bootmenu and eficonfig menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
|
#
8dbd0a0f |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add vertical scroll support The current eficonfig menu does not support vertical scroll, so it can not display the menu entries greater than the console row size. This commit add the vertial scroll support. The console size is retrieved by SIMPLE_TEXT_OUTPUT_PROTOCOL.QueryMode() service, then calculates the row size for menu entry by subtracting menu header and description row size from the console row size. "start" and "end" are added in the efimenu structure. "start" keeps the menu entry index at the top, "end" keeps the bottom menu entry index. item_data_print() menu function only draws the menu entry between "start" and "end". This commit also fixes the issue that "Save" and "Quit" entries can be moved by BKEY_PLUS in change boot order menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
0d590852 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation This commit removes the change boot order specific menu implementation. The change boot order implementation calls eficonfig_process_common() same as other menus. The change boot order menu requires own item_data_print and item_choice implementation, but display_statusline function can be a same function as other menus. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
cd160b27 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor eficonfig_process_common function Current change boot order implementation does not call eficonfig_process_common() and call own menu functions for display_statusline, item_data_print and item_choice. Change boot order functionality should call eficonfig_process_common() to improve maintenanceability. This commit is a preparation to remove the change boot order specific implementation. The menu functions (display_statusline, item_data_print and item_choice) are added as argument of eficonfig_process_common(). The menu description string displayed at the bottom of the menu is also added as argument. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
32bab0ea |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Make use of CLI character processing Avoid duplicating some of the escape-sequence processing here and use the CLI function instead. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
d0ca98db |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Update bootmenu_loop() to return the code Use the return value to save having to pass around a pointer. This also resolves any ambiguity about what *key contains when the function is called. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
2da4a15e |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Rename KEY_... to BKEY_... This enum values conflict with linux/input.h so rename them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
64550274 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: avoid SetVariable between GetNextVariableName calls The current code calls efi_set_variable_int() to delete the invalid boot option between calls to efi_get_next_variable_name_int(), it may produce unpredictable results. This commit moves removal of the invalid boot option outside of the efi_get_next_variable_name_int() calls. EFI_NOT_FOUND returned from efi_get_next_variable_name_int() indicates we retrieved all EFI variables, it should be treated as EFI_SUCEESS. To address the checkpatch warning of too many leading tabs, combine two if statement into one. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
ce327084 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: carve out efi_get_next_variable_name_int calls To retrieve the EFI variable name by efi_get_next_variable_name_int(), the sequence of alloc -> efi_get_next_variable_name_int -> realloc -> efi_get_next_variable_name_int is required. In current code, this sequence repeatedly appears in the several functions. It should be curved out a common function. This commit also fixes the missing free() of var_name16 in eficonfig_delete_invalid_boot_option(). Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
140a8959 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use efi_get_next_variable_name_int() eficonfig command reads all possible UEFI load options from 0x0000 to 0xFFFF to construct the menu. This takes too much time in some environment. This commit uses efi_get_next_variable_name_int() to read all existing UEFI load options to significantlly reduce the count of efi_get_var() call. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
78b1ccc4 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use u16_strsize() to get u16 string buffer size Use u16_strsize() to simplify the u16 string buffer size calculation. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c67d3c9e |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix going one directory up issue The directory name in eficonfig menu entry contains the '\' separator. strcmp() argument ".." is wrong and one directory up handling does not work correctly. strcmp() argument must include '\' separator. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c3b5af63 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add UEFI Secure Boot Key enrollment interface This commit adds the menu-driven UEFI Secure Boot Key enrollment interface. User can enroll PK, KEK, db and dbx by selecting file. Only the signed EFI Signature List(s) with an authenticated header, typically '.auth' file, is accepted. To clear the PK, KEK, db and dbx, user needs to enroll the null key signed by PK or KEK. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
21faf4ef |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use protocol interface for file selection EFI_SIMPLE_FILE_SYSTEM_PROTOCOL is not always provided by U-Boot. Use protocol interface functions instead of U-Boot internal functions. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d6566113 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose eficonfig_create_device_path() Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use eficonfig_create_device_path() to construct the full device path from device path of the volume and file path, so move it out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d571f9b2 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation All the eficonfig menus other than "Change Boot Order" use 'eficonfig_entry' structure for each menu entry. This commit refactors change boot order implementation to use 'eficonfig_entry' structure same as other menus to have consistent menu handling. This commit also simplifies the data->active handling when KEY_SPACE is pressed, and sizeof() parameter. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
8961e93e |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose append entry function Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use append_entry() and append_quit_entry() to construct the menu, so move them out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
a84040ab |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor file selection handling eficonfig_select_file_handler() is commonly used to select the file. eficonfig_display_select_file_option() adds an additional menu to clear the selected file. eficonfig_display_select_file_option() is not always necessary for the file selection process, so it must be outside of eficonfig_select_file_handler(). This commit also renames the following functions to avoid confusion. eficonfig_select_file_handler() -> eficonfig_process_select_file() eficonfig_select_file() -> eficonfig_show_file_selection() eficonfig_display_select_file_option() -> eficonfig_process_show_file_option() Finally, test_eficonfig.py need to be updated to get aligned with the above modification. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
1167e88a |
|
14-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix missing variable initialization The 'ret' variable must be initialized before use in eficonfig_delete_invalid_boot_option(). Fixes: c416f1c0bc ("bootmenu: add removable media entries") Addresses-Coverity: 376207 ("Uninitialized variables") Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
3d595ac5 |
|
09-Nov-2022 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: remove superfluous if in eficonfig_edit_boot_option Goto for an immediately succeeding label is superfluous. Fixes: 87d791423ac6 ("eficonfig: menu-driven addition of UEFI boot option") Addresses-Coverity: 376202 ("Identical code for different branches") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
64658007 |
|
17-Nov-2023 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: eficonfig: create shortened boot options The boot options created by eficonfig should use shortened device-paths to avoid problems if drives are enumerated in a different sequence. Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
9945bc4f |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Fix incorrect return code of boot option update Correct the return code for out-of-memory and no boot option found Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
339b527b |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Move bootorder and bootoption apis to lib Rename and move bootorder and bootoption apis from cmd to lib for re-use between eficonfig and bootmgr Fix 'unexpected indentation' when 'make htmldocs' after functions are moved Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
2c0b0c31 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_SECURE_BOOT This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_SECURE_BOOT defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
83f3d121 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_MM_COMM_TEE This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_MM_COMM_TEE defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
88df3634 |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: CTRL+S to save the boot order 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>
|
#
45f5319f |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
menu: remove CTRL+C to quit On the sandbox called without "--terminal raw" CTRL+C leaves U-Boot, "ESC/CTRL+C to quit" is misleading. Let's remove CTRL+C to quit key handling from bootmenu and eficonfig menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
|
#
8dbd0a0f |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add vertical scroll support The current eficonfig menu does not support vertical scroll, so it can not display the menu entries greater than the console row size. This commit add the vertial scroll support. The console size is retrieved by SIMPLE_TEXT_OUTPUT_PROTOCOL.QueryMode() service, then calculates the row size for menu entry by subtracting menu header and description row size from the console row size. "start" and "end" are added in the efimenu structure. "start" keeps the menu entry index at the top, "end" keeps the bottom menu entry index. item_data_print() menu function only draws the menu entry between "start" and "end". This commit also fixes the issue that "Save" and "Quit" entries can be moved by BKEY_PLUS in change boot order menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
0d590852 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation This commit removes the change boot order specific menu implementation. The change boot order implementation calls eficonfig_process_common() same as other menus. The change boot order menu requires own item_data_print and item_choice implementation, but display_statusline function can be a same function as other menus. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
cd160b27 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor eficonfig_process_common function Current change boot order implementation does not call eficonfig_process_common() and call own menu functions for display_statusline, item_data_print and item_choice. Change boot order functionality should call eficonfig_process_common() to improve maintenanceability. This commit is a preparation to remove the change boot order specific implementation. The menu functions (display_statusline, item_data_print and item_choice) are added as argument of eficonfig_process_common(). The menu description string displayed at the bottom of the menu is also added as argument. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
32bab0ea |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Make use of CLI character processing Avoid duplicating some of the escape-sequence processing here and use the CLI function instead. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
d0ca98db |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Update bootmenu_loop() to return the code Use the return value to save having to pass around a pointer. This also resolves any ambiguity about what *key contains when the function is called. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
2da4a15e |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Rename KEY_... to BKEY_... This enum values conflict with linux/input.h so rename them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
64550274 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: avoid SetVariable between GetNextVariableName calls The current code calls efi_set_variable_int() to delete the invalid boot option between calls to efi_get_next_variable_name_int(), it may produce unpredictable results. This commit moves removal of the invalid boot option outside of the efi_get_next_variable_name_int() calls. EFI_NOT_FOUND returned from efi_get_next_variable_name_int() indicates we retrieved all EFI variables, it should be treated as EFI_SUCEESS. To address the checkpatch warning of too many leading tabs, combine two if statement into one. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
ce327084 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: carve out efi_get_next_variable_name_int calls To retrieve the EFI variable name by efi_get_next_variable_name_int(), the sequence of alloc -> efi_get_next_variable_name_int -> realloc -> efi_get_next_variable_name_int is required. In current code, this sequence repeatedly appears in the several functions. It should be curved out a common function. This commit also fixes the missing free() of var_name16 in eficonfig_delete_invalid_boot_option(). Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
140a8959 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use efi_get_next_variable_name_int() eficonfig command reads all possible UEFI load options from 0x0000 to 0xFFFF to construct the menu. This takes too much time in some environment. This commit uses efi_get_next_variable_name_int() to read all existing UEFI load options to significantlly reduce the count of efi_get_var() call. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
78b1ccc4 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use u16_strsize() to get u16 string buffer size Use u16_strsize() to simplify the u16 string buffer size calculation. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c67d3c9e |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix going one directory up issue The directory name in eficonfig menu entry contains the '\' separator. strcmp() argument ".." is wrong and one directory up handling does not work correctly. strcmp() argument must include '\' separator. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c3b5af63 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add UEFI Secure Boot Key enrollment interface This commit adds the menu-driven UEFI Secure Boot Key enrollment interface. User can enroll PK, KEK, db and dbx by selecting file. Only the signed EFI Signature List(s) with an authenticated header, typically '.auth' file, is accepted. To clear the PK, KEK, db and dbx, user needs to enroll the null key signed by PK or KEK. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
21faf4ef |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use protocol interface for file selection EFI_SIMPLE_FILE_SYSTEM_PROTOCOL is not always provided by U-Boot. Use protocol interface functions instead of U-Boot internal functions. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d6566113 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose eficonfig_create_device_path() Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use eficonfig_create_device_path() to construct the full device path from device path of the volume and file path, so move it out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d571f9b2 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation All the eficonfig menus other than "Change Boot Order" use 'eficonfig_entry' structure for each menu entry. This commit refactors change boot order implementation to use 'eficonfig_entry' structure same as other menus to have consistent menu handling. This commit also simplifies the data->active handling when KEY_SPACE is pressed, and sizeof() parameter. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
8961e93e |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose append entry function Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use append_entry() and append_quit_entry() to construct the menu, so move them out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
a84040ab |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor file selection handling eficonfig_select_file_handler() is commonly used to select the file. eficonfig_display_select_file_option() adds an additional menu to clear the selected file. eficonfig_display_select_file_option() is not always necessary for the file selection process, so it must be outside of eficonfig_select_file_handler(). This commit also renames the following functions to avoid confusion. eficonfig_select_file_handler() -> eficonfig_process_select_file() eficonfig_select_file() -> eficonfig_show_file_selection() eficonfig_display_select_file_option() -> eficonfig_process_show_file_option() Finally, test_eficonfig.py need to be updated to get aligned with the above modification. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
1167e88a |
|
14-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix missing variable initialization The 'ret' variable must be initialized before use in eficonfig_delete_invalid_boot_option(). Fixes: c416f1c0bc ("bootmenu: add removable media entries") Addresses-Coverity: 376207 ("Uninitialized variables") Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
3d595ac5 |
|
09-Nov-2022 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: remove superfluous if in eficonfig_edit_boot_option Goto for an immediately succeeding label is superfluous. Fixes: 87d791423ac6 ("eficonfig: menu-driven addition of UEFI boot option") Addresses-Coverity: 376202 ("Identical code for different branches") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
64658007 |
|
17-Nov-2023 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: eficonfig: create shortened boot options The boot options created by eficonfig should use shortened device-paths to avoid problems if drives are enumerated in a different sequence. Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
9945bc4f |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Fix incorrect return code of boot option update Correct the return code for out-of-memory and no boot option found Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
339b527b |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Move bootorder and bootoption apis to lib Rename and move bootorder and bootoption apis from cmd to lib for re-use between eficonfig and bootmgr Fix 'unexpected indentation' when 'make htmldocs' after functions are moved Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
2c0b0c31 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_SECURE_BOOT This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_SECURE_BOOT defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
83f3d121 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_MM_COMM_TEE This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_MM_COMM_TEE defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
88df3634 |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: CTRL+S to save the boot order 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>
|
#
45f5319f |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
menu: remove CTRL+C to quit On the sandbox called without "--terminal raw" CTRL+C leaves U-Boot, "ESC/CTRL+C to quit" is misleading. Let's remove CTRL+C to quit key handling from bootmenu and eficonfig menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
|
#
8dbd0a0f |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add vertical scroll support The current eficonfig menu does not support vertical scroll, so it can not display the menu entries greater than the console row size. This commit add the vertial scroll support. The console size is retrieved by SIMPLE_TEXT_OUTPUT_PROTOCOL.QueryMode() service, then calculates the row size for menu entry by subtracting menu header and description row size from the console row size. "start" and "end" are added in the efimenu structure. "start" keeps the menu entry index at the top, "end" keeps the bottom menu entry index. item_data_print() menu function only draws the menu entry between "start" and "end". This commit also fixes the issue that "Save" and "Quit" entries can be moved by BKEY_PLUS in change boot order menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
0d590852 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation This commit removes the change boot order specific menu implementation. The change boot order implementation calls eficonfig_process_common() same as other menus. The change boot order menu requires own item_data_print and item_choice implementation, but display_statusline function can be a same function as other menus. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
cd160b27 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor eficonfig_process_common function Current change boot order implementation does not call eficonfig_process_common() and call own menu functions for display_statusline, item_data_print and item_choice. Change boot order functionality should call eficonfig_process_common() to improve maintenanceability. This commit is a preparation to remove the change boot order specific implementation. The menu functions (display_statusline, item_data_print and item_choice) are added as argument of eficonfig_process_common(). The menu description string displayed at the bottom of the menu is also added as argument. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
32bab0ea |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Make use of CLI character processing Avoid duplicating some of the escape-sequence processing here and use the CLI function instead. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
d0ca98db |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Update bootmenu_loop() to return the code Use the return value to save having to pass around a pointer. This also resolves any ambiguity about what *key contains when the function is called. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
2da4a15e |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Rename KEY_... to BKEY_... This enum values conflict with linux/input.h so rename them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
64550274 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: avoid SetVariable between GetNextVariableName calls The current code calls efi_set_variable_int() to delete the invalid boot option between calls to efi_get_next_variable_name_int(), it may produce unpredictable results. This commit moves removal of the invalid boot option outside of the efi_get_next_variable_name_int() calls. EFI_NOT_FOUND returned from efi_get_next_variable_name_int() indicates we retrieved all EFI variables, it should be treated as EFI_SUCEESS. To address the checkpatch warning of too many leading tabs, combine two if statement into one. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
ce327084 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: carve out efi_get_next_variable_name_int calls To retrieve the EFI variable name by efi_get_next_variable_name_int(), the sequence of alloc -> efi_get_next_variable_name_int -> realloc -> efi_get_next_variable_name_int is required. In current code, this sequence repeatedly appears in the several functions. It should be curved out a common function. This commit also fixes the missing free() of var_name16 in eficonfig_delete_invalid_boot_option(). Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
140a8959 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use efi_get_next_variable_name_int() eficonfig command reads all possible UEFI load options from 0x0000 to 0xFFFF to construct the menu. This takes too much time in some environment. This commit uses efi_get_next_variable_name_int() to read all existing UEFI load options to significantlly reduce the count of efi_get_var() call. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
78b1ccc4 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use u16_strsize() to get u16 string buffer size Use u16_strsize() to simplify the u16 string buffer size calculation. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c67d3c9e |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix going one directory up issue The directory name in eficonfig menu entry contains the '\' separator. strcmp() argument ".." is wrong and one directory up handling does not work correctly. strcmp() argument must include '\' separator. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c3b5af63 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add UEFI Secure Boot Key enrollment interface This commit adds the menu-driven UEFI Secure Boot Key enrollment interface. User can enroll PK, KEK, db and dbx by selecting file. Only the signed EFI Signature List(s) with an authenticated header, typically '.auth' file, is accepted. To clear the PK, KEK, db and dbx, user needs to enroll the null key signed by PK or KEK. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
21faf4ef |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use protocol interface for file selection EFI_SIMPLE_FILE_SYSTEM_PROTOCOL is not always provided by U-Boot. Use protocol interface functions instead of U-Boot internal functions. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d6566113 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose eficonfig_create_device_path() Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use eficonfig_create_device_path() to construct the full device path from device path of the volume and file path, so move it out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d571f9b2 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation All the eficonfig menus other than "Change Boot Order" use 'eficonfig_entry' structure for each menu entry. This commit refactors change boot order implementation to use 'eficonfig_entry' structure same as other menus to have consistent menu handling. This commit also simplifies the data->active handling when KEY_SPACE is pressed, and sizeof() parameter. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
8961e93e |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose append entry function Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use append_entry() and append_quit_entry() to construct the menu, so move them out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
a84040ab |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor file selection handling eficonfig_select_file_handler() is commonly used to select the file. eficonfig_display_select_file_option() adds an additional menu to clear the selected file. eficonfig_display_select_file_option() is not always necessary for the file selection process, so it must be outside of eficonfig_select_file_handler(). This commit also renames the following functions to avoid confusion. eficonfig_select_file_handler() -> eficonfig_process_select_file() eficonfig_select_file() -> eficonfig_show_file_selection() eficonfig_display_select_file_option() -> eficonfig_process_show_file_option() Finally, test_eficonfig.py need to be updated to get aligned with the above modification. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
1167e88a |
|
14-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix missing variable initialization The 'ret' variable must be initialized before use in eficonfig_delete_invalid_boot_option(). Fixes: c416f1c0bc ("bootmenu: add removable media entries") Addresses-Coverity: 376207 ("Uninitialized variables") Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
3d595ac5 |
|
09-Nov-2022 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: remove superfluous if in eficonfig_edit_boot_option Goto for an immediately succeeding label is superfluous. Fixes: 87d791423ac6 ("eficonfig: menu-driven addition of UEFI boot option") Addresses-Coverity: 376202 ("Identical code for different branches") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
64658007 |
|
17-Nov-2023 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: eficonfig: create shortened boot options The boot options created by eficonfig should use shortened device-paths to avoid problems if drives are enumerated in a different sequence. Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
9945bc4f |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Fix incorrect return code of boot option update Correct the return code for out-of-memory and no boot option found Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
339b527b |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Move bootorder and bootoption apis to lib Rename and move bootorder and bootoption apis from cmd to lib for re-use between eficonfig and bootmgr Fix 'unexpected indentation' when 'make htmldocs' after functions are moved Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
2c0b0c31 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_SECURE_BOOT This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_SECURE_BOOT defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
83f3d121 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_MM_COMM_TEE This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_MM_COMM_TEE defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
88df3634 |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: CTRL+S to save the boot order 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>
|
#
45f5319f |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
menu: remove CTRL+C to quit On the sandbox called without "--terminal raw" CTRL+C leaves U-Boot, "ESC/CTRL+C to quit" is misleading. Let's remove CTRL+C to quit key handling from bootmenu and eficonfig menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
|
#
8dbd0a0f |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add vertical scroll support The current eficonfig menu does not support vertical scroll, so it can not display the menu entries greater than the console row size. This commit add the vertial scroll support. The console size is retrieved by SIMPLE_TEXT_OUTPUT_PROTOCOL.QueryMode() service, then calculates the row size for menu entry by subtracting menu header and description row size from the console row size. "start" and "end" are added in the efimenu structure. "start" keeps the menu entry index at the top, "end" keeps the bottom menu entry index. item_data_print() menu function only draws the menu entry between "start" and "end". This commit also fixes the issue that "Save" and "Quit" entries can be moved by BKEY_PLUS in change boot order menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
0d590852 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation This commit removes the change boot order specific menu implementation. The change boot order implementation calls eficonfig_process_common() same as other menus. The change boot order menu requires own item_data_print and item_choice implementation, but display_statusline function can be a same function as other menus. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
cd160b27 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor eficonfig_process_common function Current change boot order implementation does not call eficonfig_process_common() and call own menu functions for display_statusline, item_data_print and item_choice. Change boot order functionality should call eficonfig_process_common() to improve maintenanceability. This commit is a preparation to remove the change boot order specific implementation. The menu functions (display_statusline, item_data_print and item_choice) are added as argument of eficonfig_process_common(). The menu description string displayed at the bottom of the menu is also added as argument. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
32bab0ea |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Make use of CLI character processing Avoid duplicating some of the escape-sequence processing here and use the CLI function instead. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
d0ca98db |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Update bootmenu_loop() to return the code Use the return value to save having to pass around a pointer. This also resolves any ambiguity about what *key contains when the function is called. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
2da4a15e |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Rename KEY_... to BKEY_... This enum values conflict with linux/input.h so rename them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
64550274 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: avoid SetVariable between GetNextVariableName calls The current code calls efi_set_variable_int() to delete the invalid boot option between calls to efi_get_next_variable_name_int(), it may produce unpredictable results. This commit moves removal of the invalid boot option outside of the efi_get_next_variable_name_int() calls. EFI_NOT_FOUND returned from efi_get_next_variable_name_int() indicates we retrieved all EFI variables, it should be treated as EFI_SUCEESS. To address the checkpatch warning of too many leading tabs, combine two if statement into one. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
ce327084 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: carve out efi_get_next_variable_name_int calls To retrieve the EFI variable name by efi_get_next_variable_name_int(), the sequence of alloc -> efi_get_next_variable_name_int -> realloc -> efi_get_next_variable_name_int is required. In current code, this sequence repeatedly appears in the several functions. It should be curved out a common function. This commit also fixes the missing free() of var_name16 in eficonfig_delete_invalid_boot_option(). Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
140a8959 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use efi_get_next_variable_name_int() eficonfig command reads all possible UEFI load options from 0x0000 to 0xFFFF to construct the menu. This takes too much time in some environment. This commit uses efi_get_next_variable_name_int() to read all existing UEFI load options to significantlly reduce the count of efi_get_var() call. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
78b1ccc4 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use u16_strsize() to get u16 string buffer size Use u16_strsize() to simplify the u16 string buffer size calculation. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c67d3c9e |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix going one directory up issue The directory name in eficonfig menu entry contains the '\' separator. strcmp() argument ".." is wrong and one directory up handling does not work correctly. strcmp() argument must include '\' separator. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c3b5af63 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add UEFI Secure Boot Key enrollment interface This commit adds the menu-driven UEFI Secure Boot Key enrollment interface. User can enroll PK, KEK, db and dbx by selecting file. Only the signed EFI Signature List(s) with an authenticated header, typically '.auth' file, is accepted. To clear the PK, KEK, db and dbx, user needs to enroll the null key signed by PK or KEK. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
21faf4ef |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use protocol interface for file selection EFI_SIMPLE_FILE_SYSTEM_PROTOCOL is not always provided by U-Boot. Use protocol interface functions instead of U-Boot internal functions. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d6566113 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose eficonfig_create_device_path() Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use eficonfig_create_device_path() to construct the full device path from device path of the volume and file path, so move it out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d571f9b2 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation All the eficonfig menus other than "Change Boot Order" use 'eficonfig_entry' structure for each menu entry. This commit refactors change boot order implementation to use 'eficonfig_entry' structure same as other menus to have consistent menu handling. This commit also simplifies the data->active handling when KEY_SPACE is pressed, and sizeof() parameter. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
8961e93e |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose append entry function Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use append_entry() and append_quit_entry() to construct the menu, so move them out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
a84040ab |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor file selection handling eficonfig_select_file_handler() is commonly used to select the file. eficonfig_display_select_file_option() adds an additional menu to clear the selected file. eficonfig_display_select_file_option() is not always necessary for the file selection process, so it must be outside of eficonfig_select_file_handler(). This commit also renames the following functions to avoid confusion. eficonfig_select_file_handler() -> eficonfig_process_select_file() eficonfig_select_file() -> eficonfig_show_file_selection() eficonfig_display_select_file_option() -> eficonfig_process_show_file_option() Finally, test_eficonfig.py need to be updated to get aligned with the above modification. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
1167e88a |
|
14-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix missing variable initialization The 'ret' variable must be initialized before use in eficonfig_delete_invalid_boot_option(). Fixes: c416f1c0bc ("bootmenu: add removable media entries") Addresses-Coverity: 376207 ("Uninitialized variables") Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
3d595ac5 |
|
09-Nov-2022 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: remove superfluous if in eficonfig_edit_boot_option Goto for an immediately succeeding label is superfluous. Fixes: 87d791423ac6 ("eficonfig: menu-driven addition of UEFI boot option") Addresses-Coverity: 376202 ("Identical code for different branches") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
64658007 |
|
17-Nov-2023 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: eficonfig: create shortened boot options The boot options created by eficonfig should use shortened device-paths to avoid problems if drives are enumerated in a different sequence. Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
9945bc4f |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Fix incorrect return code of boot option update Correct the return code for out-of-memory and no boot option found Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
339b527b |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Move bootorder and bootoption apis to lib Rename and move bootorder and bootoption apis from cmd to lib for re-use between eficonfig and bootmgr Fix 'unexpected indentation' when 'make htmldocs' after functions are moved Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
2c0b0c31 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_SECURE_BOOT This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_SECURE_BOOT defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
83f3d121 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_MM_COMM_TEE This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_MM_COMM_TEE defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
88df3634 |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: CTRL+S to save the boot order 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>
|
#
45f5319f |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
menu: remove CTRL+C to quit On the sandbox called without "--terminal raw" CTRL+C leaves U-Boot, "ESC/CTRL+C to quit" is misleading. Let's remove CTRL+C to quit key handling from bootmenu and eficonfig menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
|
#
8dbd0a0f |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add vertical scroll support The current eficonfig menu does not support vertical scroll, so it can not display the menu entries greater than the console row size. This commit add the vertial scroll support. The console size is retrieved by SIMPLE_TEXT_OUTPUT_PROTOCOL.QueryMode() service, then calculates the row size for menu entry by subtracting menu header and description row size from the console row size. "start" and "end" are added in the efimenu structure. "start" keeps the menu entry index at the top, "end" keeps the bottom menu entry index. item_data_print() menu function only draws the menu entry between "start" and "end". This commit also fixes the issue that "Save" and "Quit" entries can be moved by BKEY_PLUS in change boot order menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
0d590852 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation This commit removes the change boot order specific menu implementation. The change boot order implementation calls eficonfig_process_common() same as other menus. The change boot order menu requires own item_data_print and item_choice implementation, but display_statusline function can be a same function as other menus. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
cd160b27 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor eficonfig_process_common function Current change boot order implementation does not call eficonfig_process_common() and call own menu functions for display_statusline, item_data_print and item_choice. Change boot order functionality should call eficonfig_process_common() to improve maintenanceability. This commit is a preparation to remove the change boot order specific implementation. The menu functions (display_statusline, item_data_print and item_choice) are added as argument of eficonfig_process_common(). The menu description string displayed at the bottom of the menu is also added as argument. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
32bab0ea |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Make use of CLI character processing Avoid duplicating some of the escape-sequence processing here and use the CLI function instead. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
d0ca98db |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Update bootmenu_loop() to return the code Use the return value to save having to pass around a pointer. This also resolves any ambiguity about what *key contains when the function is called. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
2da4a15e |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Rename KEY_... to BKEY_... This enum values conflict with linux/input.h so rename them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
64550274 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: avoid SetVariable between GetNextVariableName calls The current code calls efi_set_variable_int() to delete the invalid boot option between calls to efi_get_next_variable_name_int(), it may produce unpredictable results. This commit moves removal of the invalid boot option outside of the efi_get_next_variable_name_int() calls. EFI_NOT_FOUND returned from efi_get_next_variable_name_int() indicates we retrieved all EFI variables, it should be treated as EFI_SUCEESS. To address the checkpatch warning of too many leading tabs, combine two if statement into one. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
ce327084 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: carve out efi_get_next_variable_name_int calls To retrieve the EFI variable name by efi_get_next_variable_name_int(), the sequence of alloc -> efi_get_next_variable_name_int -> realloc -> efi_get_next_variable_name_int is required. In current code, this sequence repeatedly appears in the several functions. It should be curved out a common function. This commit also fixes the missing free() of var_name16 in eficonfig_delete_invalid_boot_option(). Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
140a8959 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use efi_get_next_variable_name_int() eficonfig command reads all possible UEFI load options from 0x0000 to 0xFFFF to construct the menu. This takes too much time in some environment. This commit uses efi_get_next_variable_name_int() to read all existing UEFI load options to significantlly reduce the count of efi_get_var() call. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
78b1ccc4 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use u16_strsize() to get u16 string buffer size Use u16_strsize() to simplify the u16 string buffer size calculation. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c67d3c9e |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix going one directory up issue The directory name in eficonfig menu entry contains the '\' separator. strcmp() argument ".." is wrong and one directory up handling does not work correctly. strcmp() argument must include '\' separator. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c3b5af63 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add UEFI Secure Boot Key enrollment interface This commit adds the menu-driven UEFI Secure Boot Key enrollment interface. User can enroll PK, KEK, db and dbx by selecting file. Only the signed EFI Signature List(s) with an authenticated header, typically '.auth' file, is accepted. To clear the PK, KEK, db and dbx, user needs to enroll the null key signed by PK or KEK. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
21faf4ef |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use protocol interface for file selection EFI_SIMPLE_FILE_SYSTEM_PROTOCOL is not always provided by U-Boot. Use protocol interface functions instead of U-Boot internal functions. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d6566113 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose eficonfig_create_device_path() Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use eficonfig_create_device_path() to construct the full device path from device path of the volume and file path, so move it out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d571f9b2 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation All the eficonfig menus other than "Change Boot Order" use 'eficonfig_entry' structure for each menu entry. This commit refactors change boot order implementation to use 'eficonfig_entry' structure same as other menus to have consistent menu handling. This commit also simplifies the data->active handling when KEY_SPACE is pressed, and sizeof() parameter. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
8961e93e |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose append entry function Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use append_entry() and append_quit_entry() to construct the menu, so move them out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
a84040ab |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor file selection handling eficonfig_select_file_handler() is commonly used to select the file. eficonfig_display_select_file_option() adds an additional menu to clear the selected file. eficonfig_display_select_file_option() is not always necessary for the file selection process, so it must be outside of eficonfig_select_file_handler(). This commit also renames the following functions to avoid confusion. eficonfig_select_file_handler() -> eficonfig_process_select_file() eficonfig_select_file() -> eficonfig_show_file_selection() eficonfig_display_select_file_option() -> eficonfig_process_show_file_option() Finally, test_eficonfig.py need to be updated to get aligned with the above modification. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
1167e88a |
|
14-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix missing variable initialization The 'ret' variable must be initialized before use in eficonfig_delete_invalid_boot_option(). Fixes: c416f1c0bc ("bootmenu: add removable media entries") Addresses-Coverity: 376207 ("Uninitialized variables") Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
3d595ac5 |
|
09-Nov-2022 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: remove superfluous if in eficonfig_edit_boot_option Goto for an immediately succeeding label is superfluous. Fixes: 87d791423ac6 ("eficonfig: menu-driven addition of UEFI boot option") Addresses-Coverity: 376202 ("Identical code for different branches") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
64658007 |
|
17-Nov-2023 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: eficonfig: create shortened boot options The boot options created by eficonfig should use shortened device-paths to avoid problems if drives are enumerated in a different sequence. Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
9945bc4f |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Fix incorrect return code of boot option update Correct the return code for out-of-memory and no boot option found Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
339b527b |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Move bootorder and bootoption apis to lib Rename and move bootorder and bootoption apis from cmd to lib for re-use between eficonfig and bootmgr Fix 'unexpected indentation' when 'make htmldocs' after functions are moved Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
2c0b0c31 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_SECURE_BOOT This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_SECURE_BOOT defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
83f3d121 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_MM_COMM_TEE This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_MM_COMM_TEE defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
88df3634 |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: CTRL+S to save the boot order 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>
|
#
45f5319f |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
menu: remove CTRL+C to quit On the sandbox called without "--terminal raw" CTRL+C leaves U-Boot, "ESC/CTRL+C to quit" is misleading. Let's remove CTRL+C to quit key handling from bootmenu and eficonfig menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
|
#
8dbd0a0f |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add vertical scroll support The current eficonfig menu does not support vertical scroll, so it can not display the menu entries greater than the console row size. This commit add the vertial scroll support. The console size is retrieved by SIMPLE_TEXT_OUTPUT_PROTOCOL.QueryMode() service, then calculates the row size for menu entry by subtracting menu header and description row size from the console row size. "start" and "end" are added in the efimenu structure. "start" keeps the menu entry index at the top, "end" keeps the bottom menu entry index. item_data_print() menu function only draws the menu entry between "start" and "end". This commit also fixes the issue that "Save" and "Quit" entries can be moved by BKEY_PLUS in change boot order menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
0d590852 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation This commit removes the change boot order specific menu implementation. The change boot order implementation calls eficonfig_process_common() same as other menus. The change boot order menu requires own item_data_print and item_choice implementation, but display_statusline function can be a same function as other menus. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
cd160b27 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor eficonfig_process_common function Current change boot order implementation does not call eficonfig_process_common() and call own menu functions for display_statusline, item_data_print and item_choice. Change boot order functionality should call eficonfig_process_common() to improve maintenanceability. This commit is a preparation to remove the change boot order specific implementation. The menu functions (display_statusline, item_data_print and item_choice) are added as argument of eficonfig_process_common(). The menu description string displayed at the bottom of the menu is also added as argument. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
32bab0ea |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Make use of CLI character processing Avoid duplicating some of the escape-sequence processing here and use the CLI function instead. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
d0ca98db |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Update bootmenu_loop() to return the code Use the return value to save having to pass around a pointer. This also resolves any ambiguity about what *key contains when the function is called. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
2da4a15e |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Rename KEY_... to BKEY_... This enum values conflict with linux/input.h so rename them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
64550274 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: avoid SetVariable between GetNextVariableName calls The current code calls efi_set_variable_int() to delete the invalid boot option between calls to efi_get_next_variable_name_int(), it may produce unpredictable results. This commit moves removal of the invalid boot option outside of the efi_get_next_variable_name_int() calls. EFI_NOT_FOUND returned from efi_get_next_variable_name_int() indicates we retrieved all EFI variables, it should be treated as EFI_SUCEESS. To address the checkpatch warning of too many leading tabs, combine two if statement into one. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
ce327084 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: carve out efi_get_next_variable_name_int calls To retrieve the EFI variable name by efi_get_next_variable_name_int(), the sequence of alloc -> efi_get_next_variable_name_int -> realloc -> efi_get_next_variable_name_int is required. In current code, this sequence repeatedly appears in the several functions. It should be curved out a common function. This commit also fixes the missing free() of var_name16 in eficonfig_delete_invalid_boot_option(). Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
140a8959 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use efi_get_next_variable_name_int() eficonfig command reads all possible UEFI load options from 0x0000 to 0xFFFF to construct the menu. This takes too much time in some environment. This commit uses efi_get_next_variable_name_int() to read all existing UEFI load options to significantlly reduce the count of efi_get_var() call. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
78b1ccc4 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use u16_strsize() to get u16 string buffer size Use u16_strsize() to simplify the u16 string buffer size calculation. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c67d3c9e |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix going one directory up issue The directory name in eficonfig menu entry contains the '\' separator. strcmp() argument ".." is wrong and one directory up handling does not work correctly. strcmp() argument must include '\' separator. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c3b5af63 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add UEFI Secure Boot Key enrollment interface This commit adds the menu-driven UEFI Secure Boot Key enrollment interface. User can enroll PK, KEK, db and dbx by selecting file. Only the signed EFI Signature List(s) with an authenticated header, typically '.auth' file, is accepted. To clear the PK, KEK, db and dbx, user needs to enroll the null key signed by PK or KEK. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
21faf4ef |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use protocol interface for file selection EFI_SIMPLE_FILE_SYSTEM_PROTOCOL is not always provided by U-Boot. Use protocol interface functions instead of U-Boot internal functions. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d6566113 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose eficonfig_create_device_path() Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use eficonfig_create_device_path() to construct the full device path from device path of the volume and file path, so move it out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d571f9b2 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation All the eficonfig menus other than "Change Boot Order" use 'eficonfig_entry' structure for each menu entry. This commit refactors change boot order implementation to use 'eficonfig_entry' structure same as other menus to have consistent menu handling. This commit also simplifies the data->active handling when KEY_SPACE is pressed, and sizeof() parameter. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
8961e93e |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose append entry function Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use append_entry() and append_quit_entry() to construct the menu, so move them out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
a84040ab |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor file selection handling eficonfig_select_file_handler() is commonly used to select the file. eficonfig_display_select_file_option() adds an additional menu to clear the selected file. eficonfig_display_select_file_option() is not always necessary for the file selection process, so it must be outside of eficonfig_select_file_handler(). This commit also renames the following functions to avoid confusion. eficonfig_select_file_handler() -> eficonfig_process_select_file() eficonfig_select_file() -> eficonfig_show_file_selection() eficonfig_display_select_file_option() -> eficonfig_process_show_file_option() Finally, test_eficonfig.py need to be updated to get aligned with the above modification. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
1167e88a |
|
14-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix missing variable initialization The 'ret' variable must be initialized before use in eficonfig_delete_invalid_boot_option(). Fixes: c416f1c0bc ("bootmenu: add removable media entries") Addresses-Coverity: 376207 ("Uninitialized variables") Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
3d595ac5 |
|
09-Nov-2022 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: remove superfluous if in eficonfig_edit_boot_option Goto for an immediately succeeding label is superfluous. Fixes: 87d791423ac6 ("eficonfig: menu-driven addition of UEFI boot option") Addresses-Coverity: 376202 ("Identical code for different branches") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
64658007 |
|
17-Nov-2023 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: eficonfig: create shortened boot options The boot options created by eficonfig should use shortened device-paths to avoid problems if drives are enumerated in a different sequence. Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
9945bc4f |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Fix incorrect return code of boot option update Correct the return code for out-of-memory and no boot option found Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
339b527b |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Move bootorder and bootoption apis to lib Rename and move bootorder and bootoption apis from cmd to lib for re-use between eficonfig and bootmgr Fix 'unexpected indentation' when 'make htmldocs' after functions are moved Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
2c0b0c31 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_SECURE_BOOT This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_SECURE_BOOT defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
83f3d121 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_MM_COMM_TEE This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_MM_COMM_TEE defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
88df3634 |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: CTRL+S to save the boot order 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>
|
#
45f5319f |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
menu: remove CTRL+C to quit On the sandbox called without "--terminal raw" CTRL+C leaves U-Boot, "ESC/CTRL+C to quit" is misleading. Let's remove CTRL+C to quit key handling from bootmenu and eficonfig menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
|
#
8dbd0a0f |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add vertical scroll support The current eficonfig menu does not support vertical scroll, so it can not display the menu entries greater than the console row size. This commit add the vertial scroll support. The console size is retrieved by SIMPLE_TEXT_OUTPUT_PROTOCOL.QueryMode() service, then calculates the row size for menu entry by subtracting menu header and description row size from the console row size. "start" and "end" are added in the efimenu structure. "start" keeps the menu entry index at the top, "end" keeps the bottom menu entry index. item_data_print() menu function only draws the menu entry between "start" and "end". This commit also fixes the issue that "Save" and "Quit" entries can be moved by BKEY_PLUS in change boot order menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
0d590852 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation This commit removes the change boot order specific menu implementation. The change boot order implementation calls eficonfig_process_common() same as other menus. The change boot order menu requires own item_data_print and item_choice implementation, but display_statusline function can be a same function as other menus. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
cd160b27 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor eficonfig_process_common function Current change boot order implementation does not call eficonfig_process_common() and call own menu functions for display_statusline, item_data_print and item_choice. Change boot order functionality should call eficonfig_process_common() to improve maintenanceability. This commit is a preparation to remove the change boot order specific implementation. The menu functions (display_statusline, item_data_print and item_choice) are added as argument of eficonfig_process_common(). The menu description string displayed at the bottom of the menu is also added as argument. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
32bab0ea |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Make use of CLI character processing Avoid duplicating some of the escape-sequence processing here and use the CLI function instead. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
d0ca98db |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Update bootmenu_loop() to return the code Use the return value to save having to pass around a pointer. This also resolves any ambiguity about what *key contains when the function is called. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
2da4a15e |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Rename KEY_... to BKEY_... This enum values conflict with linux/input.h so rename them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
64550274 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: avoid SetVariable between GetNextVariableName calls The current code calls efi_set_variable_int() to delete the invalid boot option between calls to efi_get_next_variable_name_int(), it may produce unpredictable results. This commit moves removal of the invalid boot option outside of the efi_get_next_variable_name_int() calls. EFI_NOT_FOUND returned from efi_get_next_variable_name_int() indicates we retrieved all EFI variables, it should be treated as EFI_SUCEESS. To address the checkpatch warning of too many leading tabs, combine two if statement into one. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
ce327084 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: carve out efi_get_next_variable_name_int calls To retrieve the EFI variable name by efi_get_next_variable_name_int(), the sequence of alloc -> efi_get_next_variable_name_int -> realloc -> efi_get_next_variable_name_int is required. In current code, this sequence repeatedly appears in the several functions. It should be curved out a common function. This commit also fixes the missing free() of var_name16 in eficonfig_delete_invalid_boot_option(). Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
140a8959 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use efi_get_next_variable_name_int() eficonfig command reads all possible UEFI load options from 0x0000 to 0xFFFF to construct the menu. This takes too much time in some environment. This commit uses efi_get_next_variable_name_int() to read all existing UEFI load options to significantlly reduce the count of efi_get_var() call. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
78b1ccc4 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use u16_strsize() to get u16 string buffer size Use u16_strsize() to simplify the u16 string buffer size calculation. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c67d3c9e |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix going one directory up issue The directory name in eficonfig menu entry contains the '\' separator. strcmp() argument ".." is wrong and one directory up handling does not work correctly. strcmp() argument must include '\' separator. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c3b5af63 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add UEFI Secure Boot Key enrollment interface This commit adds the menu-driven UEFI Secure Boot Key enrollment interface. User can enroll PK, KEK, db and dbx by selecting file. Only the signed EFI Signature List(s) with an authenticated header, typically '.auth' file, is accepted. To clear the PK, KEK, db and dbx, user needs to enroll the null key signed by PK or KEK. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
21faf4ef |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use protocol interface for file selection EFI_SIMPLE_FILE_SYSTEM_PROTOCOL is not always provided by U-Boot. Use protocol interface functions instead of U-Boot internal functions. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d6566113 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose eficonfig_create_device_path() Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use eficonfig_create_device_path() to construct the full device path from device path of the volume and file path, so move it out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d571f9b2 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation All the eficonfig menus other than "Change Boot Order" use 'eficonfig_entry' structure for each menu entry. This commit refactors change boot order implementation to use 'eficonfig_entry' structure same as other menus to have consistent menu handling. This commit also simplifies the data->active handling when KEY_SPACE is pressed, and sizeof() parameter. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
8961e93e |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose append entry function Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use append_entry() and append_quit_entry() to construct the menu, so move them out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
a84040ab |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor file selection handling eficonfig_select_file_handler() is commonly used to select the file. eficonfig_display_select_file_option() adds an additional menu to clear the selected file. eficonfig_display_select_file_option() is not always necessary for the file selection process, so it must be outside of eficonfig_select_file_handler(). This commit also renames the following functions to avoid confusion. eficonfig_select_file_handler() -> eficonfig_process_select_file() eficonfig_select_file() -> eficonfig_show_file_selection() eficonfig_display_select_file_option() -> eficonfig_process_show_file_option() Finally, test_eficonfig.py need to be updated to get aligned with the above modification. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
1167e88a |
|
14-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix missing variable initialization The 'ret' variable must be initialized before use in eficonfig_delete_invalid_boot_option(). Fixes: c416f1c0bc ("bootmenu: add removable media entries") Addresses-Coverity: 376207 ("Uninitialized variables") Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
3d595ac5 |
|
09-Nov-2022 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: remove superfluous if in eficonfig_edit_boot_option Goto for an immediately succeeding label is superfluous. Fixes: 87d791423ac6 ("eficonfig: menu-driven addition of UEFI boot option") Addresses-Coverity: 376202 ("Identical code for different branches") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
64658007 |
|
17-Nov-2023 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: eficonfig: create shortened boot options The boot options created by eficonfig should use shortened device-paths to avoid problems if drives are enumerated in a different sequence. Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
9945bc4f |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Fix incorrect return code of boot option update Correct the return code for out-of-memory and no boot option found Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
339b527b |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Move bootorder and bootoption apis to lib Rename and move bootorder and bootoption apis from cmd to lib for re-use between eficonfig and bootmgr Fix 'unexpected indentation' when 'make htmldocs' after functions are moved Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
2c0b0c31 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_SECURE_BOOT This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_SECURE_BOOT defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
83f3d121 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_MM_COMM_TEE This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_MM_COMM_TEE defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
88df3634 |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: CTRL+S to save the boot order 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>
|
#
45f5319f |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
menu: remove CTRL+C to quit On the sandbox called without "--terminal raw" CTRL+C leaves U-Boot, "ESC/CTRL+C to quit" is misleading. Let's remove CTRL+C to quit key handling from bootmenu and eficonfig menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
|
#
8dbd0a0f |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add vertical scroll support The current eficonfig menu does not support vertical scroll, so it can not display the menu entries greater than the console row size. This commit add the vertial scroll support. The console size is retrieved by SIMPLE_TEXT_OUTPUT_PROTOCOL.QueryMode() service, then calculates the row size for menu entry by subtracting menu header and description row size from the console row size. "start" and "end" are added in the efimenu structure. "start" keeps the menu entry index at the top, "end" keeps the bottom menu entry index. item_data_print() menu function only draws the menu entry between "start" and "end". This commit also fixes the issue that "Save" and "Quit" entries can be moved by BKEY_PLUS in change boot order menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
0d590852 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation This commit removes the change boot order specific menu implementation. The change boot order implementation calls eficonfig_process_common() same as other menus. The change boot order menu requires own item_data_print and item_choice implementation, but display_statusline function can be a same function as other menus. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
cd160b27 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor eficonfig_process_common function Current change boot order implementation does not call eficonfig_process_common() and call own menu functions for display_statusline, item_data_print and item_choice. Change boot order functionality should call eficonfig_process_common() to improve maintenanceability. This commit is a preparation to remove the change boot order specific implementation. The menu functions (display_statusline, item_data_print and item_choice) are added as argument of eficonfig_process_common(). The menu description string displayed at the bottom of the menu is also added as argument. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
32bab0ea |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Make use of CLI character processing Avoid duplicating some of the escape-sequence processing here and use the CLI function instead. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
d0ca98db |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Update bootmenu_loop() to return the code Use the return value to save having to pass around a pointer. This also resolves any ambiguity about what *key contains when the function is called. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
2da4a15e |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Rename KEY_... to BKEY_... This enum values conflict with linux/input.h so rename them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
64550274 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: avoid SetVariable between GetNextVariableName calls The current code calls efi_set_variable_int() to delete the invalid boot option between calls to efi_get_next_variable_name_int(), it may produce unpredictable results. This commit moves removal of the invalid boot option outside of the efi_get_next_variable_name_int() calls. EFI_NOT_FOUND returned from efi_get_next_variable_name_int() indicates we retrieved all EFI variables, it should be treated as EFI_SUCEESS. To address the checkpatch warning of too many leading tabs, combine two if statement into one. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
ce327084 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: carve out efi_get_next_variable_name_int calls To retrieve the EFI variable name by efi_get_next_variable_name_int(), the sequence of alloc -> efi_get_next_variable_name_int -> realloc -> efi_get_next_variable_name_int is required. In current code, this sequence repeatedly appears in the several functions. It should be curved out a common function. This commit also fixes the missing free() of var_name16 in eficonfig_delete_invalid_boot_option(). Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
140a8959 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use efi_get_next_variable_name_int() eficonfig command reads all possible UEFI load options from 0x0000 to 0xFFFF to construct the menu. This takes too much time in some environment. This commit uses efi_get_next_variable_name_int() to read all existing UEFI load options to significantlly reduce the count of efi_get_var() call. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
78b1ccc4 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use u16_strsize() to get u16 string buffer size Use u16_strsize() to simplify the u16 string buffer size calculation. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c67d3c9e |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix going one directory up issue The directory name in eficonfig menu entry contains the '\' separator. strcmp() argument ".." is wrong and one directory up handling does not work correctly. strcmp() argument must include '\' separator. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c3b5af63 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add UEFI Secure Boot Key enrollment interface This commit adds the menu-driven UEFI Secure Boot Key enrollment interface. User can enroll PK, KEK, db and dbx by selecting file. Only the signed EFI Signature List(s) with an authenticated header, typically '.auth' file, is accepted. To clear the PK, KEK, db and dbx, user needs to enroll the null key signed by PK or KEK. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
21faf4ef |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use protocol interface for file selection EFI_SIMPLE_FILE_SYSTEM_PROTOCOL is not always provided by U-Boot. Use protocol interface functions instead of U-Boot internal functions. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d6566113 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose eficonfig_create_device_path() Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use eficonfig_create_device_path() to construct the full device path from device path of the volume and file path, so move it out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d571f9b2 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation All the eficonfig menus other than "Change Boot Order" use 'eficonfig_entry' structure for each menu entry. This commit refactors change boot order implementation to use 'eficonfig_entry' structure same as other menus to have consistent menu handling. This commit also simplifies the data->active handling when KEY_SPACE is pressed, and sizeof() parameter. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
8961e93e |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose append entry function Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use append_entry() and append_quit_entry() to construct the menu, so move them out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
a84040ab |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor file selection handling eficonfig_select_file_handler() is commonly used to select the file. eficonfig_display_select_file_option() adds an additional menu to clear the selected file. eficonfig_display_select_file_option() is not always necessary for the file selection process, so it must be outside of eficonfig_select_file_handler(). This commit also renames the following functions to avoid confusion. eficonfig_select_file_handler() -> eficonfig_process_select_file() eficonfig_select_file() -> eficonfig_show_file_selection() eficonfig_display_select_file_option() -> eficonfig_process_show_file_option() Finally, test_eficonfig.py need to be updated to get aligned with the above modification. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
1167e88a |
|
14-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix missing variable initialization The 'ret' variable must be initialized before use in eficonfig_delete_invalid_boot_option(). Fixes: c416f1c0bc ("bootmenu: add removable media entries") Addresses-Coverity: 376207 ("Uninitialized variables") Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
3d595ac5 |
|
09-Nov-2022 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: remove superfluous if in eficonfig_edit_boot_option Goto for an immediately succeeding label is superfluous. Fixes: 87d791423ac6 ("eficonfig: menu-driven addition of UEFI boot option") Addresses-Coverity: 376202 ("Identical code for different branches") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
64658007 |
|
17-Nov-2023 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: eficonfig: create shortened boot options The boot options created by eficonfig should use shortened device-paths to avoid problems if drives are enumerated in a different sequence. Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
9945bc4f |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Fix incorrect return code of boot option update Correct the return code for out-of-memory and no boot option found Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
339b527b |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Move bootorder and bootoption apis to lib Rename and move bootorder and bootoption apis from cmd to lib for re-use between eficonfig and bootmgr Fix 'unexpected indentation' when 'make htmldocs' after functions are moved Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
2c0b0c31 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_SECURE_BOOT This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_SECURE_BOOT defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
83f3d121 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_MM_COMM_TEE This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_MM_COMM_TEE defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
88df3634 |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: CTRL+S to save the boot order 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>
|
#
45f5319f |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
menu: remove CTRL+C to quit On the sandbox called without "--terminal raw" CTRL+C leaves U-Boot, "ESC/CTRL+C to quit" is misleading. Let's remove CTRL+C to quit key handling from bootmenu and eficonfig menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
|
#
8dbd0a0f |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add vertical scroll support The current eficonfig menu does not support vertical scroll, so it can not display the menu entries greater than the console row size. This commit add the vertial scroll support. The console size is retrieved by SIMPLE_TEXT_OUTPUT_PROTOCOL.QueryMode() service, then calculates the row size for menu entry by subtracting menu header and description row size from the console row size. "start" and "end" are added in the efimenu structure. "start" keeps the menu entry index at the top, "end" keeps the bottom menu entry index. item_data_print() menu function only draws the menu entry between "start" and "end". This commit also fixes the issue that "Save" and "Quit" entries can be moved by BKEY_PLUS in change boot order menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
0d590852 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation This commit removes the change boot order specific menu implementation. The change boot order implementation calls eficonfig_process_common() same as other menus. The change boot order menu requires own item_data_print and item_choice implementation, but display_statusline function can be a same function as other menus. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
cd160b27 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor eficonfig_process_common function Current change boot order implementation does not call eficonfig_process_common() and call own menu functions for display_statusline, item_data_print and item_choice. Change boot order functionality should call eficonfig_process_common() to improve maintenanceability. This commit is a preparation to remove the change boot order specific implementation. The menu functions (display_statusline, item_data_print and item_choice) are added as argument of eficonfig_process_common(). The menu description string displayed at the bottom of the menu is also added as argument. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
32bab0ea |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Make use of CLI character processing Avoid duplicating some of the escape-sequence processing here and use the CLI function instead. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
d0ca98db |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Update bootmenu_loop() to return the code Use the return value to save having to pass around a pointer. This also resolves any ambiguity about what *key contains when the function is called. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
2da4a15e |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Rename KEY_... to BKEY_... This enum values conflict with linux/input.h so rename them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
64550274 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: avoid SetVariable between GetNextVariableName calls The current code calls efi_set_variable_int() to delete the invalid boot option between calls to efi_get_next_variable_name_int(), it may produce unpredictable results. This commit moves removal of the invalid boot option outside of the efi_get_next_variable_name_int() calls. EFI_NOT_FOUND returned from efi_get_next_variable_name_int() indicates we retrieved all EFI variables, it should be treated as EFI_SUCEESS. To address the checkpatch warning of too many leading tabs, combine two if statement into one. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
ce327084 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: carve out efi_get_next_variable_name_int calls To retrieve the EFI variable name by efi_get_next_variable_name_int(), the sequence of alloc -> efi_get_next_variable_name_int -> realloc -> efi_get_next_variable_name_int is required. In current code, this sequence repeatedly appears in the several functions. It should be curved out a common function. This commit also fixes the missing free() of var_name16 in eficonfig_delete_invalid_boot_option(). Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
140a8959 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use efi_get_next_variable_name_int() eficonfig command reads all possible UEFI load options from 0x0000 to 0xFFFF to construct the menu. This takes too much time in some environment. This commit uses efi_get_next_variable_name_int() to read all existing UEFI load options to significantlly reduce the count of efi_get_var() call. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
78b1ccc4 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use u16_strsize() to get u16 string buffer size Use u16_strsize() to simplify the u16 string buffer size calculation. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c67d3c9e |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix going one directory up issue The directory name in eficonfig menu entry contains the '\' separator. strcmp() argument ".." is wrong and one directory up handling does not work correctly. strcmp() argument must include '\' separator. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c3b5af63 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add UEFI Secure Boot Key enrollment interface This commit adds the menu-driven UEFI Secure Boot Key enrollment interface. User can enroll PK, KEK, db and dbx by selecting file. Only the signed EFI Signature List(s) with an authenticated header, typically '.auth' file, is accepted. To clear the PK, KEK, db and dbx, user needs to enroll the null key signed by PK or KEK. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
21faf4ef |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use protocol interface for file selection EFI_SIMPLE_FILE_SYSTEM_PROTOCOL is not always provided by U-Boot. Use protocol interface functions instead of U-Boot internal functions. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d6566113 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose eficonfig_create_device_path() Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use eficonfig_create_device_path() to construct the full device path from device path of the volume and file path, so move it out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d571f9b2 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation All the eficonfig menus other than "Change Boot Order" use 'eficonfig_entry' structure for each menu entry. This commit refactors change boot order implementation to use 'eficonfig_entry' structure same as other menus to have consistent menu handling. This commit also simplifies the data->active handling when KEY_SPACE is pressed, and sizeof() parameter. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
8961e93e |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose append entry function Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use append_entry() and append_quit_entry() to construct the menu, so move them out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
a84040ab |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor file selection handling eficonfig_select_file_handler() is commonly used to select the file. eficonfig_display_select_file_option() adds an additional menu to clear the selected file. eficonfig_display_select_file_option() is not always necessary for the file selection process, so it must be outside of eficonfig_select_file_handler(). This commit also renames the following functions to avoid confusion. eficonfig_select_file_handler() -> eficonfig_process_select_file() eficonfig_select_file() -> eficonfig_show_file_selection() eficonfig_display_select_file_option() -> eficonfig_process_show_file_option() Finally, test_eficonfig.py need to be updated to get aligned with the above modification. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
1167e88a |
|
14-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix missing variable initialization The 'ret' variable must be initialized before use in eficonfig_delete_invalid_boot_option(). Fixes: c416f1c0bc ("bootmenu: add removable media entries") Addresses-Coverity: 376207 ("Uninitialized variables") Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
3d595ac5 |
|
09-Nov-2022 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: remove superfluous if in eficonfig_edit_boot_option Goto for an immediately succeeding label is superfluous. Fixes: 87d791423ac6 ("eficonfig: menu-driven addition of UEFI boot option") Addresses-Coverity: 376202 ("Identical code for different branches") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
64658007 |
|
17-Nov-2023 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: eficonfig: create shortened boot options The boot options created by eficonfig should use shortened device-paths to avoid problems if drives are enumerated in a different sequence. Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
9945bc4f |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Fix incorrect return code of boot option update Correct the return code for out-of-memory and no boot option found Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
339b527b |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Move bootorder and bootoption apis to lib Rename and move bootorder and bootoption apis from cmd to lib for re-use between eficonfig and bootmgr Fix 'unexpected indentation' when 'make htmldocs' after functions are moved Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
2c0b0c31 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_SECURE_BOOT This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_SECURE_BOOT defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
83f3d121 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_MM_COMM_TEE This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_MM_COMM_TEE defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
88df3634 |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: CTRL+S to save the boot order 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>
|
#
45f5319f |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
menu: remove CTRL+C to quit On the sandbox called without "--terminal raw" CTRL+C leaves U-Boot, "ESC/CTRL+C to quit" is misleading. Let's remove CTRL+C to quit key handling from bootmenu and eficonfig menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
|
#
8dbd0a0f |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add vertical scroll support The current eficonfig menu does not support vertical scroll, so it can not display the menu entries greater than the console row size. This commit add the vertial scroll support. The console size is retrieved by SIMPLE_TEXT_OUTPUT_PROTOCOL.QueryMode() service, then calculates the row size for menu entry by subtracting menu header and description row size from the console row size. "start" and "end" are added in the efimenu structure. "start" keeps the menu entry index at the top, "end" keeps the bottom menu entry index. item_data_print() menu function only draws the menu entry between "start" and "end". This commit also fixes the issue that "Save" and "Quit" entries can be moved by BKEY_PLUS in change boot order menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
0d590852 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation This commit removes the change boot order specific menu implementation. The change boot order implementation calls eficonfig_process_common() same as other menus. The change boot order menu requires own item_data_print and item_choice implementation, but display_statusline function can be a same function as other menus. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
cd160b27 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor eficonfig_process_common function Current change boot order implementation does not call eficonfig_process_common() and call own menu functions for display_statusline, item_data_print and item_choice. Change boot order functionality should call eficonfig_process_common() to improve maintenanceability. This commit is a preparation to remove the change boot order specific implementation. The menu functions (display_statusline, item_data_print and item_choice) are added as argument of eficonfig_process_common(). The menu description string displayed at the bottom of the menu is also added as argument. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
32bab0ea |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Make use of CLI character processing Avoid duplicating some of the escape-sequence processing here and use the CLI function instead. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
d0ca98db |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Update bootmenu_loop() to return the code Use the return value to save having to pass around a pointer. This also resolves any ambiguity about what *key contains when the function is called. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
2da4a15e |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Rename KEY_... to BKEY_... This enum values conflict with linux/input.h so rename them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
64550274 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: avoid SetVariable between GetNextVariableName calls The current code calls efi_set_variable_int() to delete the invalid boot option between calls to efi_get_next_variable_name_int(), it may produce unpredictable results. This commit moves removal of the invalid boot option outside of the efi_get_next_variable_name_int() calls. EFI_NOT_FOUND returned from efi_get_next_variable_name_int() indicates we retrieved all EFI variables, it should be treated as EFI_SUCEESS. To address the checkpatch warning of too many leading tabs, combine two if statement into one. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
ce327084 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: carve out efi_get_next_variable_name_int calls To retrieve the EFI variable name by efi_get_next_variable_name_int(), the sequence of alloc -> efi_get_next_variable_name_int -> realloc -> efi_get_next_variable_name_int is required. In current code, this sequence repeatedly appears in the several functions. It should be curved out a common function. This commit also fixes the missing free() of var_name16 in eficonfig_delete_invalid_boot_option(). Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
140a8959 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use efi_get_next_variable_name_int() eficonfig command reads all possible UEFI load options from 0x0000 to 0xFFFF to construct the menu. This takes too much time in some environment. This commit uses efi_get_next_variable_name_int() to read all existing UEFI load options to significantlly reduce the count of efi_get_var() call. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
78b1ccc4 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use u16_strsize() to get u16 string buffer size Use u16_strsize() to simplify the u16 string buffer size calculation. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c67d3c9e |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix going one directory up issue The directory name in eficonfig menu entry contains the '\' separator. strcmp() argument ".." is wrong and one directory up handling does not work correctly. strcmp() argument must include '\' separator. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c3b5af63 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add UEFI Secure Boot Key enrollment interface This commit adds the menu-driven UEFI Secure Boot Key enrollment interface. User can enroll PK, KEK, db and dbx by selecting file. Only the signed EFI Signature List(s) with an authenticated header, typically '.auth' file, is accepted. To clear the PK, KEK, db and dbx, user needs to enroll the null key signed by PK or KEK. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
21faf4ef |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use protocol interface for file selection EFI_SIMPLE_FILE_SYSTEM_PROTOCOL is not always provided by U-Boot. Use protocol interface functions instead of U-Boot internal functions. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d6566113 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose eficonfig_create_device_path() Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use eficonfig_create_device_path() to construct the full device path from device path of the volume and file path, so move it out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d571f9b2 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation All the eficonfig menus other than "Change Boot Order" use 'eficonfig_entry' structure for each menu entry. This commit refactors change boot order implementation to use 'eficonfig_entry' structure same as other menus to have consistent menu handling. This commit also simplifies the data->active handling when KEY_SPACE is pressed, and sizeof() parameter. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
8961e93e |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose append entry function Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use append_entry() and append_quit_entry() to construct the menu, so move them out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
a84040ab |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor file selection handling eficonfig_select_file_handler() is commonly used to select the file. eficonfig_display_select_file_option() adds an additional menu to clear the selected file. eficonfig_display_select_file_option() is not always necessary for the file selection process, so it must be outside of eficonfig_select_file_handler(). This commit also renames the following functions to avoid confusion. eficonfig_select_file_handler() -> eficonfig_process_select_file() eficonfig_select_file() -> eficonfig_show_file_selection() eficonfig_display_select_file_option() -> eficonfig_process_show_file_option() Finally, test_eficonfig.py need to be updated to get aligned with the above modification. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
1167e88a |
|
14-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix missing variable initialization The 'ret' variable must be initialized before use in eficonfig_delete_invalid_boot_option(). Fixes: c416f1c0bc ("bootmenu: add removable media entries") Addresses-Coverity: 376207 ("Uninitialized variables") Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
3d595ac5 |
|
09-Nov-2022 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: remove superfluous if in eficonfig_edit_boot_option Goto for an immediately succeeding label is superfluous. Fixes: 87d791423ac6 ("eficonfig: menu-driven addition of UEFI boot option") Addresses-Coverity: 376202 ("Identical code for different branches") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
64658007 |
|
17-Nov-2023 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: eficonfig: create shortened boot options The boot options created by eficonfig should use shortened device-paths to avoid problems if drives are enumerated in a different sequence. Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
9945bc4f |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Fix incorrect return code of boot option update Correct the return code for out-of-memory and no boot option found Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
339b527b |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Move bootorder and bootoption apis to lib Rename and move bootorder and bootoption apis from cmd to lib for re-use between eficonfig and bootmgr Fix 'unexpected indentation' when 'make htmldocs' after functions are moved Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
2c0b0c31 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_SECURE_BOOT This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_SECURE_BOOT defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
83f3d121 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_MM_COMM_TEE This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_MM_COMM_TEE defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
88df3634 |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: CTRL+S to save the boot order 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>
|
#
45f5319f |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
menu: remove CTRL+C to quit On the sandbox called without "--terminal raw" CTRL+C leaves U-Boot, "ESC/CTRL+C to quit" is misleading. Let's remove CTRL+C to quit key handling from bootmenu and eficonfig menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
|
#
8dbd0a0f |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add vertical scroll support The current eficonfig menu does not support vertical scroll, so it can not display the menu entries greater than the console row size. This commit add the vertial scroll support. The console size is retrieved by SIMPLE_TEXT_OUTPUT_PROTOCOL.QueryMode() service, then calculates the row size for menu entry by subtracting menu header and description row size from the console row size. "start" and "end" are added in the efimenu structure. "start" keeps the menu entry index at the top, "end" keeps the bottom menu entry index. item_data_print() menu function only draws the menu entry between "start" and "end". This commit also fixes the issue that "Save" and "Quit" entries can be moved by BKEY_PLUS in change boot order menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
0d590852 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation This commit removes the change boot order specific menu implementation. The change boot order implementation calls eficonfig_process_common() same as other menus. The change boot order menu requires own item_data_print and item_choice implementation, but display_statusline function can be a same function as other menus. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
cd160b27 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor eficonfig_process_common function Current change boot order implementation does not call eficonfig_process_common() and call own menu functions for display_statusline, item_data_print and item_choice. Change boot order functionality should call eficonfig_process_common() to improve maintenanceability. This commit is a preparation to remove the change boot order specific implementation. The menu functions (display_statusline, item_data_print and item_choice) are added as argument of eficonfig_process_common(). The menu description string displayed at the bottom of the menu is also added as argument. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
32bab0ea |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Make use of CLI character processing Avoid duplicating some of the escape-sequence processing here and use the CLI function instead. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
d0ca98db |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Update bootmenu_loop() to return the code Use the return value to save having to pass around a pointer. This also resolves any ambiguity about what *key contains when the function is called. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
2da4a15e |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Rename KEY_... to BKEY_... This enum values conflict with linux/input.h so rename them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
64550274 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: avoid SetVariable between GetNextVariableName calls The current code calls efi_set_variable_int() to delete the invalid boot option between calls to efi_get_next_variable_name_int(), it may produce unpredictable results. This commit moves removal of the invalid boot option outside of the efi_get_next_variable_name_int() calls. EFI_NOT_FOUND returned from efi_get_next_variable_name_int() indicates we retrieved all EFI variables, it should be treated as EFI_SUCEESS. To address the checkpatch warning of too many leading tabs, combine two if statement into one. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
ce327084 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: carve out efi_get_next_variable_name_int calls To retrieve the EFI variable name by efi_get_next_variable_name_int(), the sequence of alloc -> efi_get_next_variable_name_int -> realloc -> efi_get_next_variable_name_int is required. In current code, this sequence repeatedly appears in the several functions. It should be curved out a common function. This commit also fixes the missing free() of var_name16 in eficonfig_delete_invalid_boot_option(). Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
140a8959 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use efi_get_next_variable_name_int() eficonfig command reads all possible UEFI load options from 0x0000 to 0xFFFF to construct the menu. This takes too much time in some environment. This commit uses efi_get_next_variable_name_int() to read all existing UEFI load options to significantlly reduce the count of efi_get_var() call. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
78b1ccc4 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use u16_strsize() to get u16 string buffer size Use u16_strsize() to simplify the u16 string buffer size calculation. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c67d3c9e |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix going one directory up issue The directory name in eficonfig menu entry contains the '\' separator. strcmp() argument ".." is wrong and one directory up handling does not work correctly. strcmp() argument must include '\' separator. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c3b5af63 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add UEFI Secure Boot Key enrollment interface This commit adds the menu-driven UEFI Secure Boot Key enrollment interface. User can enroll PK, KEK, db and dbx by selecting file. Only the signed EFI Signature List(s) with an authenticated header, typically '.auth' file, is accepted. To clear the PK, KEK, db and dbx, user needs to enroll the null key signed by PK or KEK. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
21faf4ef |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use protocol interface for file selection EFI_SIMPLE_FILE_SYSTEM_PROTOCOL is not always provided by U-Boot. Use protocol interface functions instead of U-Boot internal functions. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d6566113 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose eficonfig_create_device_path() Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use eficonfig_create_device_path() to construct the full device path from device path of the volume and file path, so move it out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d571f9b2 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation All the eficonfig menus other than "Change Boot Order" use 'eficonfig_entry' structure for each menu entry. This commit refactors change boot order implementation to use 'eficonfig_entry' structure same as other menus to have consistent menu handling. This commit also simplifies the data->active handling when KEY_SPACE is pressed, and sizeof() parameter. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
8961e93e |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose append entry function Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use append_entry() and append_quit_entry() to construct the menu, so move them out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
a84040ab |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor file selection handling eficonfig_select_file_handler() is commonly used to select the file. eficonfig_display_select_file_option() adds an additional menu to clear the selected file. eficonfig_display_select_file_option() is not always necessary for the file selection process, so it must be outside of eficonfig_select_file_handler(). This commit also renames the following functions to avoid confusion. eficonfig_select_file_handler() -> eficonfig_process_select_file() eficonfig_select_file() -> eficonfig_show_file_selection() eficonfig_display_select_file_option() -> eficonfig_process_show_file_option() Finally, test_eficonfig.py need to be updated to get aligned with the above modification. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
1167e88a |
|
14-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix missing variable initialization The 'ret' variable must be initialized before use in eficonfig_delete_invalid_boot_option(). Fixes: c416f1c0bc ("bootmenu: add removable media entries") Addresses-Coverity: 376207 ("Uninitialized variables") Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
3d595ac5 |
|
09-Nov-2022 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: remove superfluous if in eficonfig_edit_boot_option Goto for an immediately succeeding label is superfluous. Fixes: 87d791423ac6 ("eficonfig: menu-driven addition of UEFI boot option") Addresses-Coverity: 376202 ("Identical code for different branches") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
64658007 |
|
17-Nov-2023 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: eficonfig: create shortened boot options The boot options created by eficonfig should use shortened device-paths to avoid problems if drives are enumerated in a different sequence. Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
9945bc4f |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Fix incorrect return code of boot option update Correct the return code for out-of-memory and no boot option found Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
339b527b |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Move bootorder and bootoption apis to lib Rename and move bootorder and bootoption apis from cmd to lib for re-use between eficonfig and bootmgr Fix 'unexpected indentation' when 'make htmldocs' after functions are moved Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
2c0b0c31 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_SECURE_BOOT This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_SECURE_BOOT defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
83f3d121 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_MM_COMM_TEE This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_MM_COMM_TEE defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
88df3634 |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: CTRL+S to save the boot order 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>
|
#
45f5319f |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
menu: remove CTRL+C to quit On the sandbox called without "--terminal raw" CTRL+C leaves U-Boot, "ESC/CTRL+C to quit" is misleading. Let's remove CTRL+C to quit key handling from bootmenu and eficonfig menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
|
#
8dbd0a0f |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add vertical scroll support The current eficonfig menu does not support vertical scroll, so it can not display the menu entries greater than the console row size. This commit add the vertial scroll support. The console size is retrieved by SIMPLE_TEXT_OUTPUT_PROTOCOL.QueryMode() service, then calculates the row size for menu entry by subtracting menu header and description row size from the console row size. "start" and "end" are added in the efimenu structure. "start" keeps the menu entry index at the top, "end" keeps the bottom menu entry index. item_data_print() menu function only draws the menu entry between "start" and "end". This commit also fixes the issue that "Save" and "Quit" entries can be moved by BKEY_PLUS in change boot order menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
0d590852 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation This commit removes the change boot order specific menu implementation. The change boot order implementation calls eficonfig_process_common() same as other menus. The change boot order menu requires own item_data_print and item_choice implementation, but display_statusline function can be a same function as other menus. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
cd160b27 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor eficonfig_process_common function Current change boot order implementation does not call eficonfig_process_common() and call own menu functions for display_statusline, item_data_print and item_choice. Change boot order functionality should call eficonfig_process_common() to improve maintenanceability. This commit is a preparation to remove the change boot order specific implementation. The menu functions (display_statusline, item_data_print and item_choice) are added as argument of eficonfig_process_common(). The menu description string displayed at the bottom of the menu is also added as argument. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
32bab0ea |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Make use of CLI character processing Avoid duplicating some of the escape-sequence processing here and use the CLI function instead. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
d0ca98db |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Update bootmenu_loop() to return the code Use the return value to save having to pass around a pointer. This also resolves any ambiguity about what *key contains when the function is called. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
2da4a15e |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Rename KEY_... to BKEY_... This enum values conflict with linux/input.h so rename them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
64550274 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: avoid SetVariable between GetNextVariableName calls The current code calls efi_set_variable_int() to delete the invalid boot option between calls to efi_get_next_variable_name_int(), it may produce unpredictable results. This commit moves removal of the invalid boot option outside of the efi_get_next_variable_name_int() calls. EFI_NOT_FOUND returned from efi_get_next_variable_name_int() indicates we retrieved all EFI variables, it should be treated as EFI_SUCEESS. To address the checkpatch warning of too many leading tabs, combine two if statement into one. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
ce327084 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: carve out efi_get_next_variable_name_int calls To retrieve the EFI variable name by efi_get_next_variable_name_int(), the sequence of alloc -> efi_get_next_variable_name_int -> realloc -> efi_get_next_variable_name_int is required. In current code, this sequence repeatedly appears in the several functions. It should be curved out a common function. This commit also fixes the missing free() of var_name16 in eficonfig_delete_invalid_boot_option(). Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
140a8959 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use efi_get_next_variable_name_int() eficonfig command reads all possible UEFI load options from 0x0000 to 0xFFFF to construct the menu. This takes too much time in some environment. This commit uses efi_get_next_variable_name_int() to read all existing UEFI load options to significantlly reduce the count of efi_get_var() call. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
78b1ccc4 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use u16_strsize() to get u16 string buffer size Use u16_strsize() to simplify the u16 string buffer size calculation. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c67d3c9e |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix going one directory up issue The directory name in eficonfig menu entry contains the '\' separator. strcmp() argument ".." is wrong and one directory up handling does not work correctly. strcmp() argument must include '\' separator. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c3b5af63 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add UEFI Secure Boot Key enrollment interface This commit adds the menu-driven UEFI Secure Boot Key enrollment interface. User can enroll PK, KEK, db and dbx by selecting file. Only the signed EFI Signature List(s) with an authenticated header, typically '.auth' file, is accepted. To clear the PK, KEK, db and dbx, user needs to enroll the null key signed by PK or KEK. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
21faf4ef |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use protocol interface for file selection EFI_SIMPLE_FILE_SYSTEM_PROTOCOL is not always provided by U-Boot. Use protocol interface functions instead of U-Boot internal functions. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d6566113 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose eficonfig_create_device_path() Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use eficonfig_create_device_path() to construct the full device path from device path of the volume and file path, so move it out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d571f9b2 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation All the eficonfig menus other than "Change Boot Order" use 'eficonfig_entry' structure for each menu entry. This commit refactors change boot order implementation to use 'eficonfig_entry' structure same as other menus to have consistent menu handling. This commit also simplifies the data->active handling when KEY_SPACE is pressed, and sizeof() parameter. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
8961e93e |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose append entry function Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use append_entry() and append_quit_entry() to construct the menu, so move them out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
a84040ab |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor file selection handling eficonfig_select_file_handler() is commonly used to select the file. eficonfig_display_select_file_option() adds an additional menu to clear the selected file. eficonfig_display_select_file_option() is not always necessary for the file selection process, so it must be outside of eficonfig_select_file_handler(). This commit also renames the following functions to avoid confusion. eficonfig_select_file_handler() -> eficonfig_process_select_file() eficonfig_select_file() -> eficonfig_show_file_selection() eficonfig_display_select_file_option() -> eficonfig_process_show_file_option() Finally, test_eficonfig.py need to be updated to get aligned with the above modification. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
1167e88a |
|
14-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix missing variable initialization The 'ret' variable must be initialized before use in eficonfig_delete_invalid_boot_option(). Fixes: c416f1c0bc ("bootmenu: add removable media entries") Addresses-Coverity: 376207 ("Uninitialized variables") Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
3d595ac5 |
|
09-Nov-2022 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: remove superfluous if in eficonfig_edit_boot_option Goto for an immediately succeeding label is superfluous. Fixes: 87d791423ac6 ("eficonfig: menu-driven addition of UEFI boot option") Addresses-Coverity: 376202 ("Identical code for different branches") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
64658007 |
|
17-Nov-2023 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: eficonfig: create shortened boot options The boot options created by eficonfig should use shortened device-paths to avoid problems if drives are enumerated in a different sequence. Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
9945bc4f |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Fix incorrect return code of boot option update Correct the return code for out-of-memory and no boot option found Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
339b527b |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Move bootorder and bootoption apis to lib Rename and move bootorder and bootoption apis from cmd to lib for re-use between eficonfig and bootmgr Fix 'unexpected indentation' when 'make htmldocs' after functions are moved Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
2c0b0c31 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_SECURE_BOOT This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_SECURE_BOOT defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
83f3d121 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_MM_COMM_TEE This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_MM_COMM_TEE defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
88df3634 |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: CTRL+S to save the boot order 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>
|
#
45f5319f |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
menu: remove CTRL+C to quit On the sandbox called without "--terminal raw" CTRL+C leaves U-Boot, "ESC/CTRL+C to quit" is misleading. Let's remove CTRL+C to quit key handling from bootmenu and eficonfig menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
|
#
8dbd0a0f |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add vertical scroll support The current eficonfig menu does not support vertical scroll, so it can not display the menu entries greater than the console row size. This commit add the vertial scroll support. The console size is retrieved by SIMPLE_TEXT_OUTPUT_PROTOCOL.QueryMode() service, then calculates the row size for menu entry by subtracting menu header and description row size from the console row size. "start" and "end" are added in the efimenu structure. "start" keeps the menu entry index at the top, "end" keeps the bottom menu entry index. item_data_print() menu function only draws the menu entry between "start" and "end". This commit also fixes the issue that "Save" and "Quit" entries can be moved by BKEY_PLUS in change boot order menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
0d590852 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation This commit removes the change boot order specific menu implementation. The change boot order implementation calls eficonfig_process_common() same as other menus. The change boot order menu requires own item_data_print and item_choice implementation, but display_statusline function can be a same function as other menus. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
cd160b27 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor eficonfig_process_common function Current change boot order implementation does not call eficonfig_process_common() and call own menu functions for display_statusline, item_data_print and item_choice. Change boot order functionality should call eficonfig_process_common() to improve maintenanceability. This commit is a preparation to remove the change boot order specific implementation. The menu functions (display_statusline, item_data_print and item_choice) are added as argument of eficonfig_process_common(). The menu description string displayed at the bottom of the menu is also added as argument. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
32bab0ea |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Make use of CLI character processing Avoid duplicating some of the escape-sequence processing here and use the CLI function instead. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
d0ca98db |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Update bootmenu_loop() to return the code Use the return value to save having to pass around a pointer. This also resolves any ambiguity about what *key contains when the function is called. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
2da4a15e |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Rename KEY_... to BKEY_... This enum values conflict with linux/input.h so rename them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
64550274 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: avoid SetVariable between GetNextVariableName calls The current code calls efi_set_variable_int() to delete the invalid boot option between calls to efi_get_next_variable_name_int(), it may produce unpredictable results. This commit moves removal of the invalid boot option outside of the efi_get_next_variable_name_int() calls. EFI_NOT_FOUND returned from efi_get_next_variable_name_int() indicates we retrieved all EFI variables, it should be treated as EFI_SUCEESS. To address the checkpatch warning of too many leading tabs, combine two if statement into one. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
ce327084 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: carve out efi_get_next_variable_name_int calls To retrieve the EFI variable name by efi_get_next_variable_name_int(), the sequence of alloc -> efi_get_next_variable_name_int -> realloc -> efi_get_next_variable_name_int is required. In current code, this sequence repeatedly appears in the several functions. It should be curved out a common function. This commit also fixes the missing free() of var_name16 in eficonfig_delete_invalid_boot_option(). Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
140a8959 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use efi_get_next_variable_name_int() eficonfig command reads all possible UEFI load options from 0x0000 to 0xFFFF to construct the menu. This takes too much time in some environment. This commit uses efi_get_next_variable_name_int() to read all existing UEFI load options to significantlly reduce the count of efi_get_var() call. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
78b1ccc4 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use u16_strsize() to get u16 string buffer size Use u16_strsize() to simplify the u16 string buffer size calculation. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c67d3c9e |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix going one directory up issue The directory name in eficonfig menu entry contains the '\' separator. strcmp() argument ".." is wrong and one directory up handling does not work correctly. strcmp() argument must include '\' separator. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c3b5af63 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add UEFI Secure Boot Key enrollment interface This commit adds the menu-driven UEFI Secure Boot Key enrollment interface. User can enroll PK, KEK, db and dbx by selecting file. Only the signed EFI Signature List(s) with an authenticated header, typically '.auth' file, is accepted. To clear the PK, KEK, db and dbx, user needs to enroll the null key signed by PK or KEK. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
21faf4ef |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use protocol interface for file selection EFI_SIMPLE_FILE_SYSTEM_PROTOCOL is not always provided by U-Boot. Use protocol interface functions instead of U-Boot internal functions. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d6566113 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose eficonfig_create_device_path() Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use eficonfig_create_device_path() to construct the full device path from device path of the volume and file path, so move it out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d571f9b2 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation All the eficonfig menus other than "Change Boot Order" use 'eficonfig_entry' structure for each menu entry. This commit refactors change boot order implementation to use 'eficonfig_entry' structure same as other menus to have consistent menu handling. This commit also simplifies the data->active handling when KEY_SPACE is pressed, and sizeof() parameter. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
8961e93e |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose append entry function Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use append_entry() and append_quit_entry() to construct the menu, so move them out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
a84040ab |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor file selection handling eficonfig_select_file_handler() is commonly used to select the file. eficonfig_display_select_file_option() adds an additional menu to clear the selected file. eficonfig_display_select_file_option() is not always necessary for the file selection process, so it must be outside of eficonfig_select_file_handler(). This commit also renames the following functions to avoid confusion. eficonfig_select_file_handler() -> eficonfig_process_select_file() eficonfig_select_file() -> eficonfig_show_file_selection() eficonfig_display_select_file_option() -> eficonfig_process_show_file_option() Finally, test_eficonfig.py need to be updated to get aligned with the above modification. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
1167e88a |
|
14-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix missing variable initialization The 'ret' variable must be initialized before use in eficonfig_delete_invalid_boot_option(). Fixes: c416f1c0bc ("bootmenu: add removable media entries") Addresses-Coverity: 376207 ("Uninitialized variables") Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
3d595ac5 |
|
09-Nov-2022 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: remove superfluous if in eficonfig_edit_boot_option Goto for an immediately succeeding label is superfluous. Fixes: 87d791423ac6 ("eficonfig: menu-driven addition of UEFI boot option") Addresses-Coverity: 376202 ("Identical code for different branches") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
64658007 |
|
17-Nov-2023 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: eficonfig: create shortened boot options The boot options created by eficonfig should use shortened device-paths to avoid problems if drives are enumerated in a different sequence. Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
9945bc4f |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Fix incorrect return code of boot option update Correct the return code for out-of-memory and no boot option found Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
339b527b |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Move bootorder and bootoption apis to lib Rename and move bootorder and bootoption apis from cmd to lib for re-use between eficonfig and bootmgr Fix 'unexpected indentation' when 'make htmldocs' after functions are moved Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
2c0b0c31 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_SECURE_BOOT This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_SECURE_BOOT defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
83f3d121 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_MM_COMM_TEE This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_MM_COMM_TEE defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
88df3634 |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: CTRL+S to save the boot order 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>
|
#
45f5319f |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
menu: remove CTRL+C to quit On the sandbox called without "--terminal raw" CTRL+C leaves U-Boot, "ESC/CTRL+C to quit" is misleading. Let's remove CTRL+C to quit key handling from bootmenu and eficonfig menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
|
#
8dbd0a0f |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add vertical scroll support The current eficonfig menu does not support vertical scroll, so it can not display the menu entries greater than the console row size. This commit add the vertial scroll support. The console size is retrieved by SIMPLE_TEXT_OUTPUT_PROTOCOL.QueryMode() service, then calculates the row size for menu entry by subtracting menu header and description row size from the console row size. "start" and "end" are added in the efimenu structure. "start" keeps the menu entry index at the top, "end" keeps the bottom menu entry index. item_data_print() menu function only draws the menu entry between "start" and "end". This commit also fixes the issue that "Save" and "Quit" entries can be moved by BKEY_PLUS in change boot order menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
0d590852 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation This commit removes the change boot order specific menu implementation. The change boot order implementation calls eficonfig_process_common() same as other menus. The change boot order menu requires own item_data_print and item_choice implementation, but display_statusline function can be a same function as other menus. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
cd160b27 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor eficonfig_process_common function Current change boot order implementation does not call eficonfig_process_common() and call own menu functions for display_statusline, item_data_print and item_choice. Change boot order functionality should call eficonfig_process_common() to improve maintenanceability. This commit is a preparation to remove the change boot order specific implementation. The menu functions (display_statusline, item_data_print and item_choice) are added as argument of eficonfig_process_common(). The menu description string displayed at the bottom of the menu is also added as argument. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
32bab0ea |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Make use of CLI character processing Avoid duplicating some of the escape-sequence processing here and use the CLI function instead. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
d0ca98db |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Update bootmenu_loop() to return the code Use the return value to save having to pass around a pointer. This also resolves any ambiguity about what *key contains when the function is called. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
2da4a15e |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Rename KEY_... to BKEY_... This enum values conflict with linux/input.h so rename them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
64550274 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: avoid SetVariable between GetNextVariableName calls The current code calls efi_set_variable_int() to delete the invalid boot option between calls to efi_get_next_variable_name_int(), it may produce unpredictable results. This commit moves removal of the invalid boot option outside of the efi_get_next_variable_name_int() calls. EFI_NOT_FOUND returned from efi_get_next_variable_name_int() indicates we retrieved all EFI variables, it should be treated as EFI_SUCEESS. To address the checkpatch warning of too many leading tabs, combine two if statement into one. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
ce327084 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: carve out efi_get_next_variable_name_int calls To retrieve the EFI variable name by efi_get_next_variable_name_int(), the sequence of alloc -> efi_get_next_variable_name_int -> realloc -> efi_get_next_variable_name_int is required. In current code, this sequence repeatedly appears in the several functions. It should be curved out a common function. This commit also fixes the missing free() of var_name16 in eficonfig_delete_invalid_boot_option(). Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
140a8959 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use efi_get_next_variable_name_int() eficonfig command reads all possible UEFI load options from 0x0000 to 0xFFFF to construct the menu. This takes too much time in some environment. This commit uses efi_get_next_variable_name_int() to read all existing UEFI load options to significantlly reduce the count of efi_get_var() call. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
78b1ccc4 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use u16_strsize() to get u16 string buffer size Use u16_strsize() to simplify the u16 string buffer size calculation. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c67d3c9e |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix going one directory up issue The directory name in eficonfig menu entry contains the '\' separator. strcmp() argument ".." is wrong and one directory up handling does not work correctly. strcmp() argument must include '\' separator. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c3b5af63 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add UEFI Secure Boot Key enrollment interface This commit adds the menu-driven UEFI Secure Boot Key enrollment interface. User can enroll PK, KEK, db and dbx by selecting file. Only the signed EFI Signature List(s) with an authenticated header, typically '.auth' file, is accepted. To clear the PK, KEK, db and dbx, user needs to enroll the null key signed by PK or KEK. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
21faf4ef |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use protocol interface for file selection EFI_SIMPLE_FILE_SYSTEM_PROTOCOL is not always provided by U-Boot. Use protocol interface functions instead of U-Boot internal functions. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d6566113 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose eficonfig_create_device_path() Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use eficonfig_create_device_path() to construct the full device path from device path of the volume and file path, so move it out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d571f9b2 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation All the eficonfig menus other than "Change Boot Order" use 'eficonfig_entry' structure for each menu entry. This commit refactors change boot order implementation to use 'eficonfig_entry' structure same as other menus to have consistent menu handling. This commit also simplifies the data->active handling when KEY_SPACE is pressed, and sizeof() parameter. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
8961e93e |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose append entry function Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use append_entry() and append_quit_entry() to construct the menu, so move them out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
a84040ab |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor file selection handling eficonfig_select_file_handler() is commonly used to select the file. eficonfig_display_select_file_option() adds an additional menu to clear the selected file. eficonfig_display_select_file_option() is not always necessary for the file selection process, so it must be outside of eficonfig_select_file_handler(). This commit also renames the following functions to avoid confusion. eficonfig_select_file_handler() -> eficonfig_process_select_file() eficonfig_select_file() -> eficonfig_show_file_selection() eficonfig_display_select_file_option() -> eficonfig_process_show_file_option() Finally, test_eficonfig.py need to be updated to get aligned with the above modification. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
1167e88a |
|
14-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix missing variable initialization The 'ret' variable must be initialized before use in eficonfig_delete_invalid_boot_option(). Fixes: c416f1c0bc ("bootmenu: add removable media entries") Addresses-Coverity: 376207 ("Uninitialized variables") Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
3d595ac5 |
|
09-Nov-2022 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: remove superfluous if in eficonfig_edit_boot_option Goto for an immediately succeeding label is superfluous. Fixes: 87d791423ac6 ("eficonfig: menu-driven addition of UEFI boot option") Addresses-Coverity: 376202 ("Identical code for different branches") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
64658007 |
|
17-Nov-2023 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: eficonfig: create shortened boot options The boot options created by eficonfig should use shortened device-paths to avoid problems if drives are enumerated in a different sequence. Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
9945bc4f |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Fix incorrect return code of boot option update Correct the return code for out-of-memory and no boot option found Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
339b527b |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Move bootorder and bootoption apis to lib Rename and move bootorder and bootoption apis from cmd to lib for re-use between eficonfig and bootmgr Fix 'unexpected indentation' when 'make htmldocs' after functions are moved Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
2c0b0c31 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_SECURE_BOOT This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_SECURE_BOOT defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
83f3d121 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_MM_COMM_TEE This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_MM_COMM_TEE defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
88df3634 |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: CTRL+S to save the boot order 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>
|
#
45f5319f |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
menu: remove CTRL+C to quit On the sandbox called without "--terminal raw" CTRL+C leaves U-Boot, "ESC/CTRL+C to quit" is misleading. Let's remove CTRL+C to quit key handling from bootmenu and eficonfig menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
|
#
8dbd0a0f |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add vertical scroll support The current eficonfig menu does not support vertical scroll, so it can not display the menu entries greater than the console row size. This commit add the vertial scroll support. The console size is retrieved by SIMPLE_TEXT_OUTPUT_PROTOCOL.QueryMode() service, then calculates the row size for menu entry by subtracting menu header and description row size from the console row size. "start" and "end" are added in the efimenu structure. "start" keeps the menu entry index at the top, "end" keeps the bottom menu entry index. item_data_print() menu function only draws the menu entry between "start" and "end". This commit also fixes the issue that "Save" and "Quit" entries can be moved by BKEY_PLUS in change boot order menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
0d590852 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation This commit removes the change boot order specific menu implementation. The change boot order implementation calls eficonfig_process_common() same as other menus. The change boot order menu requires own item_data_print and item_choice implementation, but display_statusline function can be a same function as other menus. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
cd160b27 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor eficonfig_process_common function Current change boot order implementation does not call eficonfig_process_common() and call own menu functions for display_statusline, item_data_print and item_choice. Change boot order functionality should call eficonfig_process_common() to improve maintenanceability. This commit is a preparation to remove the change boot order specific implementation. The menu functions (display_statusline, item_data_print and item_choice) are added as argument of eficonfig_process_common(). The menu description string displayed at the bottom of the menu is also added as argument. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
32bab0ea |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Make use of CLI character processing Avoid duplicating some of the escape-sequence processing here and use the CLI function instead. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
d0ca98db |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Update bootmenu_loop() to return the code Use the return value to save having to pass around a pointer. This also resolves any ambiguity about what *key contains when the function is called. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
2da4a15e |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Rename KEY_... to BKEY_... This enum values conflict with linux/input.h so rename them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
64550274 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: avoid SetVariable between GetNextVariableName calls The current code calls efi_set_variable_int() to delete the invalid boot option between calls to efi_get_next_variable_name_int(), it may produce unpredictable results. This commit moves removal of the invalid boot option outside of the efi_get_next_variable_name_int() calls. EFI_NOT_FOUND returned from efi_get_next_variable_name_int() indicates we retrieved all EFI variables, it should be treated as EFI_SUCEESS. To address the checkpatch warning of too many leading tabs, combine two if statement into one. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
ce327084 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: carve out efi_get_next_variable_name_int calls To retrieve the EFI variable name by efi_get_next_variable_name_int(), the sequence of alloc -> efi_get_next_variable_name_int -> realloc -> efi_get_next_variable_name_int is required. In current code, this sequence repeatedly appears in the several functions. It should be curved out a common function. This commit also fixes the missing free() of var_name16 in eficonfig_delete_invalid_boot_option(). Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
140a8959 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use efi_get_next_variable_name_int() eficonfig command reads all possible UEFI load options from 0x0000 to 0xFFFF to construct the menu. This takes too much time in some environment. This commit uses efi_get_next_variable_name_int() to read all existing UEFI load options to significantlly reduce the count of efi_get_var() call. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
78b1ccc4 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use u16_strsize() to get u16 string buffer size Use u16_strsize() to simplify the u16 string buffer size calculation. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c67d3c9e |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix going one directory up issue The directory name in eficonfig menu entry contains the '\' separator. strcmp() argument ".." is wrong and one directory up handling does not work correctly. strcmp() argument must include '\' separator. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c3b5af63 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add UEFI Secure Boot Key enrollment interface This commit adds the menu-driven UEFI Secure Boot Key enrollment interface. User can enroll PK, KEK, db and dbx by selecting file. Only the signed EFI Signature List(s) with an authenticated header, typically '.auth' file, is accepted. To clear the PK, KEK, db and dbx, user needs to enroll the null key signed by PK or KEK. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
21faf4ef |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use protocol interface for file selection EFI_SIMPLE_FILE_SYSTEM_PROTOCOL is not always provided by U-Boot. Use protocol interface functions instead of U-Boot internal functions. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d6566113 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose eficonfig_create_device_path() Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use eficonfig_create_device_path() to construct the full device path from device path of the volume and file path, so move it out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d571f9b2 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation All the eficonfig menus other than "Change Boot Order" use 'eficonfig_entry' structure for each menu entry. This commit refactors change boot order implementation to use 'eficonfig_entry' structure same as other menus to have consistent menu handling. This commit also simplifies the data->active handling when KEY_SPACE is pressed, and sizeof() parameter. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
8961e93e |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose append entry function Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use append_entry() and append_quit_entry() to construct the menu, so move them out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
a84040ab |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor file selection handling eficonfig_select_file_handler() is commonly used to select the file. eficonfig_display_select_file_option() adds an additional menu to clear the selected file. eficonfig_display_select_file_option() is not always necessary for the file selection process, so it must be outside of eficonfig_select_file_handler(). This commit also renames the following functions to avoid confusion. eficonfig_select_file_handler() -> eficonfig_process_select_file() eficonfig_select_file() -> eficonfig_show_file_selection() eficonfig_display_select_file_option() -> eficonfig_process_show_file_option() Finally, test_eficonfig.py need to be updated to get aligned with the above modification. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
1167e88a |
|
14-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix missing variable initialization The 'ret' variable must be initialized before use in eficonfig_delete_invalid_boot_option(). Fixes: c416f1c0bc ("bootmenu: add removable media entries") Addresses-Coverity: 376207 ("Uninitialized variables") Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
3d595ac5 |
|
09-Nov-2022 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: remove superfluous if in eficonfig_edit_boot_option Goto for an immediately succeeding label is superfluous. Fixes: 87d791423ac6 ("eficonfig: menu-driven addition of UEFI boot option") Addresses-Coverity: 376202 ("Identical code for different branches") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
64658007 |
|
17-Nov-2023 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: eficonfig: create shortened boot options The boot options created by eficonfig should use shortened device-paths to avoid problems if drives are enumerated in a different sequence. Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
9945bc4f |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Fix incorrect return code of boot option update Correct the return code for out-of-memory and no boot option found Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
339b527b |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Move bootorder and bootoption apis to lib Rename and move bootorder and bootoption apis from cmd to lib for re-use between eficonfig and bootmgr Fix 'unexpected indentation' when 'make htmldocs' after functions are moved Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
2c0b0c31 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_SECURE_BOOT This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_SECURE_BOOT defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
83f3d121 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_MM_COMM_TEE This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_MM_COMM_TEE defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
88df3634 |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: CTRL+S to save the boot order 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>
|
#
45f5319f |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
menu: remove CTRL+C to quit On the sandbox called without "--terminal raw" CTRL+C leaves U-Boot, "ESC/CTRL+C to quit" is misleading. Let's remove CTRL+C to quit key handling from bootmenu and eficonfig menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
|
#
8dbd0a0f |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add vertical scroll support The current eficonfig menu does not support vertical scroll, so it can not display the menu entries greater than the console row size. This commit add the vertial scroll support. The console size is retrieved by SIMPLE_TEXT_OUTPUT_PROTOCOL.QueryMode() service, then calculates the row size for menu entry by subtracting menu header and description row size from the console row size. "start" and "end" are added in the efimenu structure. "start" keeps the menu entry index at the top, "end" keeps the bottom menu entry index. item_data_print() menu function only draws the menu entry between "start" and "end". This commit also fixes the issue that "Save" and "Quit" entries can be moved by BKEY_PLUS in change boot order menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
0d590852 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation This commit removes the change boot order specific menu implementation. The change boot order implementation calls eficonfig_process_common() same as other menus. The change boot order menu requires own item_data_print and item_choice implementation, but display_statusline function can be a same function as other menus. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
cd160b27 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor eficonfig_process_common function Current change boot order implementation does not call eficonfig_process_common() and call own menu functions for display_statusline, item_data_print and item_choice. Change boot order functionality should call eficonfig_process_common() to improve maintenanceability. This commit is a preparation to remove the change boot order specific implementation. The menu functions (display_statusline, item_data_print and item_choice) are added as argument of eficonfig_process_common(). The menu description string displayed at the bottom of the menu is also added as argument. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
32bab0ea |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Make use of CLI character processing Avoid duplicating some of the escape-sequence processing here and use the CLI function instead. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
d0ca98db |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Update bootmenu_loop() to return the code Use the return value to save having to pass around a pointer. This also resolves any ambiguity about what *key contains when the function is called. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
2da4a15e |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Rename KEY_... to BKEY_... This enum values conflict with linux/input.h so rename them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
64550274 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: avoid SetVariable between GetNextVariableName calls The current code calls efi_set_variable_int() to delete the invalid boot option between calls to efi_get_next_variable_name_int(), it may produce unpredictable results. This commit moves removal of the invalid boot option outside of the efi_get_next_variable_name_int() calls. EFI_NOT_FOUND returned from efi_get_next_variable_name_int() indicates we retrieved all EFI variables, it should be treated as EFI_SUCEESS. To address the checkpatch warning of too many leading tabs, combine two if statement into one. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
ce327084 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: carve out efi_get_next_variable_name_int calls To retrieve the EFI variable name by efi_get_next_variable_name_int(), the sequence of alloc -> efi_get_next_variable_name_int -> realloc -> efi_get_next_variable_name_int is required. In current code, this sequence repeatedly appears in the several functions. It should be curved out a common function. This commit also fixes the missing free() of var_name16 in eficonfig_delete_invalid_boot_option(). Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
140a8959 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use efi_get_next_variable_name_int() eficonfig command reads all possible UEFI load options from 0x0000 to 0xFFFF to construct the menu. This takes too much time in some environment. This commit uses efi_get_next_variable_name_int() to read all existing UEFI load options to significantlly reduce the count of efi_get_var() call. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
78b1ccc4 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use u16_strsize() to get u16 string buffer size Use u16_strsize() to simplify the u16 string buffer size calculation. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c67d3c9e |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix going one directory up issue The directory name in eficonfig menu entry contains the '\' separator. strcmp() argument ".." is wrong and one directory up handling does not work correctly. strcmp() argument must include '\' separator. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c3b5af63 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add UEFI Secure Boot Key enrollment interface This commit adds the menu-driven UEFI Secure Boot Key enrollment interface. User can enroll PK, KEK, db and dbx by selecting file. Only the signed EFI Signature List(s) with an authenticated header, typically '.auth' file, is accepted. To clear the PK, KEK, db and dbx, user needs to enroll the null key signed by PK or KEK. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
21faf4ef |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use protocol interface for file selection EFI_SIMPLE_FILE_SYSTEM_PROTOCOL is not always provided by U-Boot. Use protocol interface functions instead of U-Boot internal functions. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d6566113 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose eficonfig_create_device_path() Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use eficonfig_create_device_path() to construct the full device path from device path of the volume and file path, so move it out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d571f9b2 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation All the eficonfig menus other than "Change Boot Order" use 'eficonfig_entry' structure for each menu entry. This commit refactors change boot order implementation to use 'eficonfig_entry' structure same as other menus to have consistent menu handling. This commit also simplifies the data->active handling when KEY_SPACE is pressed, and sizeof() parameter. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
8961e93e |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose append entry function Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use append_entry() and append_quit_entry() to construct the menu, so move them out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
a84040ab |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor file selection handling eficonfig_select_file_handler() is commonly used to select the file. eficonfig_display_select_file_option() adds an additional menu to clear the selected file. eficonfig_display_select_file_option() is not always necessary for the file selection process, so it must be outside of eficonfig_select_file_handler(). This commit also renames the following functions to avoid confusion. eficonfig_select_file_handler() -> eficonfig_process_select_file() eficonfig_select_file() -> eficonfig_show_file_selection() eficonfig_display_select_file_option() -> eficonfig_process_show_file_option() Finally, test_eficonfig.py need to be updated to get aligned with the above modification. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
1167e88a |
|
14-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix missing variable initialization The 'ret' variable must be initialized before use in eficonfig_delete_invalid_boot_option(). Fixes: c416f1c0bc ("bootmenu: add removable media entries") Addresses-Coverity: 376207 ("Uninitialized variables") Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
3d595ac5 |
|
09-Nov-2022 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: remove superfluous if in eficonfig_edit_boot_option Goto for an immediately succeeding label is superfluous. Fixes: 87d791423ac6 ("eficonfig: menu-driven addition of UEFI boot option") Addresses-Coverity: 376202 ("Identical code for different branches") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
64658007 |
|
17-Nov-2023 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: eficonfig: create shortened boot options The boot options created by eficonfig should use shortened device-paths to avoid problems if drives are enumerated in a different sequence. Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
9945bc4f |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Fix incorrect return code of boot option update Correct the return code for out-of-memory and no boot option found Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
339b527b |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Move bootorder and bootoption apis to lib Rename and move bootorder and bootoption apis from cmd to lib for re-use between eficonfig and bootmgr Fix 'unexpected indentation' when 'make htmldocs' after functions are moved Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
2c0b0c31 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_SECURE_BOOT This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_SECURE_BOOT defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
83f3d121 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_MM_COMM_TEE This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_MM_COMM_TEE defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
88df3634 |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: CTRL+S to save the boot order 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>
|
#
45f5319f |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
menu: remove CTRL+C to quit On the sandbox called without "--terminal raw" CTRL+C leaves U-Boot, "ESC/CTRL+C to quit" is misleading. Let's remove CTRL+C to quit key handling from bootmenu and eficonfig menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
|
#
8dbd0a0f |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add vertical scroll support The current eficonfig menu does not support vertical scroll, so it can not display the menu entries greater than the console row size. This commit add the vertial scroll support. The console size is retrieved by SIMPLE_TEXT_OUTPUT_PROTOCOL.QueryMode() service, then calculates the row size for menu entry by subtracting menu header and description row size from the console row size. "start" and "end" are added in the efimenu structure. "start" keeps the menu entry index at the top, "end" keeps the bottom menu entry index. item_data_print() menu function only draws the menu entry between "start" and "end". This commit also fixes the issue that "Save" and "Quit" entries can be moved by BKEY_PLUS in change boot order menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
0d590852 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation This commit removes the change boot order specific menu implementation. The change boot order implementation calls eficonfig_process_common() same as other menus. The change boot order menu requires own item_data_print and item_choice implementation, but display_statusline function can be a same function as other menus. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
cd160b27 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor eficonfig_process_common function Current change boot order implementation does not call eficonfig_process_common() and call own menu functions for display_statusline, item_data_print and item_choice. Change boot order functionality should call eficonfig_process_common() to improve maintenanceability. This commit is a preparation to remove the change boot order specific implementation. The menu functions (display_statusline, item_data_print and item_choice) are added as argument of eficonfig_process_common(). The menu description string displayed at the bottom of the menu is also added as argument. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
32bab0ea |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Make use of CLI character processing Avoid duplicating some of the escape-sequence processing here and use the CLI function instead. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
d0ca98db |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Update bootmenu_loop() to return the code Use the return value to save having to pass around a pointer. This also resolves any ambiguity about what *key contains when the function is called. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
2da4a15e |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Rename KEY_... to BKEY_... This enum values conflict with linux/input.h so rename them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
64550274 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: avoid SetVariable between GetNextVariableName calls The current code calls efi_set_variable_int() to delete the invalid boot option between calls to efi_get_next_variable_name_int(), it may produce unpredictable results. This commit moves removal of the invalid boot option outside of the efi_get_next_variable_name_int() calls. EFI_NOT_FOUND returned from efi_get_next_variable_name_int() indicates we retrieved all EFI variables, it should be treated as EFI_SUCEESS. To address the checkpatch warning of too many leading tabs, combine two if statement into one. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
ce327084 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: carve out efi_get_next_variable_name_int calls To retrieve the EFI variable name by efi_get_next_variable_name_int(), the sequence of alloc -> efi_get_next_variable_name_int -> realloc -> efi_get_next_variable_name_int is required. In current code, this sequence repeatedly appears in the several functions. It should be curved out a common function. This commit also fixes the missing free() of var_name16 in eficonfig_delete_invalid_boot_option(). Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
140a8959 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use efi_get_next_variable_name_int() eficonfig command reads all possible UEFI load options from 0x0000 to 0xFFFF to construct the menu. This takes too much time in some environment. This commit uses efi_get_next_variable_name_int() to read all existing UEFI load options to significantlly reduce the count of efi_get_var() call. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
78b1ccc4 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use u16_strsize() to get u16 string buffer size Use u16_strsize() to simplify the u16 string buffer size calculation. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c67d3c9e |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix going one directory up issue The directory name in eficonfig menu entry contains the '\' separator. strcmp() argument ".." is wrong and one directory up handling does not work correctly. strcmp() argument must include '\' separator. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c3b5af63 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add UEFI Secure Boot Key enrollment interface This commit adds the menu-driven UEFI Secure Boot Key enrollment interface. User can enroll PK, KEK, db and dbx by selecting file. Only the signed EFI Signature List(s) with an authenticated header, typically '.auth' file, is accepted. To clear the PK, KEK, db and dbx, user needs to enroll the null key signed by PK or KEK. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
21faf4ef |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use protocol interface for file selection EFI_SIMPLE_FILE_SYSTEM_PROTOCOL is not always provided by U-Boot. Use protocol interface functions instead of U-Boot internal functions. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d6566113 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose eficonfig_create_device_path() Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use eficonfig_create_device_path() to construct the full device path from device path of the volume and file path, so move it out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d571f9b2 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation All the eficonfig menus other than "Change Boot Order" use 'eficonfig_entry' structure for each menu entry. This commit refactors change boot order implementation to use 'eficonfig_entry' structure same as other menus to have consistent menu handling. This commit also simplifies the data->active handling when KEY_SPACE is pressed, and sizeof() parameter. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
8961e93e |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose append entry function Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use append_entry() and append_quit_entry() to construct the menu, so move them out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
a84040ab |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor file selection handling eficonfig_select_file_handler() is commonly used to select the file. eficonfig_display_select_file_option() adds an additional menu to clear the selected file. eficonfig_display_select_file_option() is not always necessary for the file selection process, so it must be outside of eficonfig_select_file_handler(). This commit also renames the following functions to avoid confusion. eficonfig_select_file_handler() -> eficonfig_process_select_file() eficonfig_select_file() -> eficonfig_show_file_selection() eficonfig_display_select_file_option() -> eficonfig_process_show_file_option() Finally, test_eficonfig.py need to be updated to get aligned with the above modification. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
1167e88a |
|
14-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix missing variable initialization The 'ret' variable must be initialized before use in eficonfig_delete_invalid_boot_option(). Fixes: c416f1c0bc ("bootmenu: add removable media entries") Addresses-Coverity: 376207 ("Uninitialized variables") Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
3d595ac5 |
|
09-Nov-2022 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: remove superfluous if in eficonfig_edit_boot_option Goto for an immediately succeeding label is superfluous. Fixes: 87d791423ac6 ("eficonfig: menu-driven addition of UEFI boot option") Addresses-Coverity: 376202 ("Identical code for different branches") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
64658007 |
|
17-Nov-2023 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: eficonfig: create shortened boot options The boot options created by eficonfig should use shortened device-paths to avoid problems if drives are enumerated in a different sequence. Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
9945bc4f |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Fix incorrect return code of boot option update Correct the return code for out-of-memory and no boot option found Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
339b527b |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Move bootorder and bootoption apis to lib Rename and move bootorder and bootoption apis from cmd to lib for re-use between eficonfig and bootmgr Fix 'unexpected indentation' when 'make htmldocs' after functions are moved Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
2c0b0c31 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_SECURE_BOOT This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_SECURE_BOOT defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
83f3d121 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_MM_COMM_TEE This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_MM_COMM_TEE defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
88df3634 |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: CTRL+S to save the boot order 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>
|
#
45f5319f |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
menu: remove CTRL+C to quit On the sandbox called without "--terminal raw" CTRL+C leaves U-Boot, "ESC/CTRL+C to quit" is misleading. Let's remove CTRL+C to quit key handling from bootmenu and eficonfig menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
|
#
8dbd0a0f |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add vertical scroll support The current eficonfig menu does not support vertical scroll, so it can not display the menu entries greater than the console row size. This commit add the vertial scroll support. The console size is retrieved by SIMPLE_TEXT_OUTPUT_PROTOCOL.QueryMode() service, then calculates the row size for menu entry by subtracting menu header and description row size from the console row size. "start" and "end" are added in the efimenu structure. "start" keeps the menu entry index at the top, "end" keeps the bottom menu entry index. item_data_print() menu function only draws the menu entry between "start" and "end". This commit also fixes the issue that "Save" and "Quit" entries can be moved by BKEY_PLUS in change boot order menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
0d590852 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation This commit removes the change boot order specific menu implementation. The change boot order implementation calls eficonfig_process_common() same as other menus. The change boot order menu requires own item_data_print and item_choice implementation, but display_statusline function can be a same function as other menus. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
cd160b27 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor eficonfig_process_common function Current change boot order implementation does not call eficonfig_process_common() and call own menu functions for display_statusline, item_data_print and item_choice. Change boot order functionality should call eficonfig_process_common() to improve maintenanceability. This commit is a preparation to remove the change boot order specific implementation. The menu functions (display_statusline, item_data_print and item_choice) are added as argument of eficonfig_process_common(). The menu description string displayed at the bottom of the menu is also added as argument. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
32bab0ea |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Make use of CLI character processing Avoid duplicating some of the escape-sequence processing here and use the CLI function instead. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
d0ca98db |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Update bootmenu_loop() to return the code Use the return value to save having to pass around a pointer. This also resolves any ambiguity about what *key contains when the function is called. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
2da4a15e |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Rename KEY_... to BKEY_... This enum values conflict with linux/input.h so rename them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
64550274 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: avoid SetVariable between GetNextVariableName calls The current code calls efi_set_variable_int() to delete the invalid boot option between calls to efi_get_next_variable_name_int(), it may produce unpredictable results. This commit moves removal of the invalid boot option outside of the efi_get_next_variable_name_int() calls. EFI_NOT_FOUND returned from efi_get_next_variable_name_int() indicates we retrieved all EFI variables, it should be treated as EFI_SUCEESS. To address the checkpatch warning of too many leading tabs, combine two if statement into one. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
ce327084 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: carve out efi_get_next_variable_name_int calls To retrieve the EFI variable name by efi_get_next_variable_name_int(), the sequence of alloc -> efi_get_next_variable_name_int -> realloc -> efi_get_next_variable_name_int is required. In current code, this sequence repeatedly appears in the several functions. It should be curved out a common function. This commit also fixes the missing free() of var_name16 in eficonfig_delete_invalid_boot_option(). Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
140a8959 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use efi_get_next_variable_name_int() eficonfig command reads all possible UEFI load options from 0x0000 to 0xFFFF to construct the menu. This takes too much time in some environment. This commit uses efi_get_next_variable_name_int() to read all existing UEFI load options to significantlly reduce the count of efi_get_var() call. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
78b1ccc4 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use u16_strsize() to get u16 string buffer size Use u16_strsize() to simplify the u16 string buffer size calculation. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c67d3c9e |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix going one directory up issue The directory name in eficonfig menu entry contains the '\' separator. strcmp() argument ".." is wrong and one directory up handling does not work correctly. strcmp() argument must include '\' separator. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c3b5af63 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add UEFI Secure Boot Key enrollment interface This commit adds the menu-driven UEFI Secure Boot Key enrollment interface. User can enroll PK, KEK, db and dbx by selecting file. Only the signed EFI Signature List(s) with an authenticated header, typically '.auth' file, is accepted. To clear the PK, KEK, db and dbx, user needs to enroll the null key signed by PK or KEK. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
21faf4ef |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use protocol interface for file selection EFI_SIMPLE_FILE_SYSTEM_PROTOCOL is not always provided by U-Boot. Use protocol interface functions instead of U-Boot internal functions. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d6566113 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose eficonfig_create_device_path() Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use eficonfig_create_device_path() to construct the full device path from device path of the volume and file path, so move it out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d571f9b2 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation All the eficonfig menus other than "Change Boot Order" use 'eficonfig_entry' structure for each menu entry. This commit refactors change boot order implementation to use 'eficonfig_entry' structure same as other menus to have consistent menu handling. This commit also simplifies the data->active handling when KEY_SPACE is pressed, and sizeof() parameter. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
8961e93e |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose append entry function Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use append_entry() and append_quit_entry() to construct the menu, so move them out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
a84040ab |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor file selection handling eficonfig_select_file_handler() is commonly used to select the file. eficonfig_display_select_file_option() adds an additional menu to clear the selected file. eficonfig_display_select_file_option() is not always necessary for the file selection process, so it must be outside of eficonfig_select_file_handler(). This commit also renames the following functions to avoid confusion. eficonfig_select_file_handler() -> eficonfig_process_select_file() eficonfig_select_file() -> eficonfig_show_file_selection() eficonfig_display_select_file_option() -> eficonfig_process_show_file_option() Finally, test_eficonfig.py need to be updated to get aligned with the above modification. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
1167e88a |
|
14-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix missing variable initialization The 'ret' variable must be initialized before use in eficonfig_delete_invalid_boot_option(). Fixes: c416f1c0bc ("bootmenu: add removable media entries") Addresses-Coverity: 376207 ("Uninitialized variables") Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
3d595ac5 |
|
09-Nov-2022 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: remove superfluous if in eficonfig_edit_boot_option Goto for an immediately succeeding label is superfluous. Fixes: 87d791423ac6 ("eficonfig: menu-driven addition of UEFI boot option") Addresses-Coverity: 376202 ("Identical code for different branches") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
64658007 |
|
17-Nov-2023 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: eficonfig: create shortened boot options The boot options created by eficonfig should use shortened device-paths to avoid problems if drives are enumerated in a different sequence. Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
9945bc4f |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Fix incorrect return code of boot option update Correct the return code for out-of-memory and no boot option found Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
339b527b |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Move bootorder and bootoption apis to lib Rename and move bootorder and bootoption apis from cmd to lib for re-use between eficonfig and bootmgr Fix 'unexpected indentation' when 'make htmldocs' after functions are moved Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
2c0b0c31 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_SECURE_BOOT This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_SECURE_BOOT defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
83f3d121 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_MM_COMM_TEE This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_MM_COMM_TEE defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
88df3634 |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: CTRL+S to save the boot order 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>
|
#
45f5319f |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
menu: remove CTRL+C to quit On the sandbox called without "--terminal raw" CTRL+C leaves U-Boot, "ESC/CTRL+C to quit" is misleading. Let's remove CTRL+C to quit key handling from bootmenu and eficonfig menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
|
#
8dbd0a0f |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add vertical scroll support The current eficonfig menu does not support vertical scroll, so it can not display the menu entries greater than the console row size. This commit add the vertial scroll support. The console size is retrieved by SIMPLE_TEXT_OUTPUT_PROTOCOL.QueryMode() service, then calculates the row size for menu entry by subtracting menu header and description row size from the console row size. "start" and "end" are added in the efimenu structure. "start" keeps the menu entry index at the top, "end" keeps the bottom menu entry index. item_data_print() menu function only draws the menu entry between "start" and "end". This commit also fixes the issue that "Save" and "Quit" entries can be moved by BKEY_PLUS in change boot order menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
0d590852 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation This commit removes the change boot order specific menu implementation. The change boot order implementation calls eficonfig_process_common() same as other menus. The change boot order menu requires own item_data_print and item_choice implementation, but display_statusline function can be a same function as other menus. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
cd160b27 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor eficonfig_process_common function Current change boot order implementation does not call eficonfig_process_common() and call own menu functions for display_statusline, item_data_print and item_choice. Change boot order functionality should call eficonfig_process_common() to improve maintenanceability. This commit is a preparation to remove the change boot order specific implementation. The menu functions (display_statusline, item_data_print and item_choice) are added as argument of eficonfig_process_common(). The menu description string displayed at the bottom of the menu is also added as argument. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
32bab0ea |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Make use of CLI character processing Avoid duplicating some of the escape-sequence processing here and use the CLI function instead. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
d0ca98db |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Update bootmenu_loop() to return the code Use the return value to save having to pass around a pointer. This also resolves any ambiguity about what *key contains when the function is called. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
2da4a15e |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Rename KEY_... to BKEY_... This enum values conflict with linux/input.h so rename them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
64550274 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: avoid SetVariable between GetNextVariableName calls The current code calls efi_set_variable_int() to delete the invalid boot option between calls to efi_get_next_variable_name_int(), it may produce unpredictable results. This commit moves removal of the invalid boot option outside of the efi_get_next_variable_name_int() calls. EFI_NOT_FOUND returned from efi_get_next_variable_name_int() indicates we retrieved all EFI variables, it should be treated as EFI_SUCEESS. To address the checkpatch warning of too many leading tabs, combine two if statement into one. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
ce327084 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: carve out efi_get_next_variable_name_int calls To retrieve the EFI variable name by efi_get_next_variable_name_int(), the sequence of alloc -> efi_get_next_variable_name_int -> realloc -> efi_get_next_variable_name_int is required. In current code, this sequence repeatedly appears in the several functions. It should be curved out a common function. This commit also fixes the missing free() of var_name16 in eficonfig_delete_invalid_boot_option(). Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
140a8959 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use efi_get_next_variable_name_int() eficonfig command reads all possible UEFI load options from 0x0000 to 0xFFFF to construct the menu. This takes too much time in some environment. This commit uses efi_get_next_variable_name_int() to read all existing UEFI load options to significantlly reduce the count of efi_get_var() call. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
78b1ccc4 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use u16_strsize() to get u16 string buffer size Use u16_strsize() to simplify the u16 string buffer size calculation. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c67d3c9e |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix going one directory up issue The directory name in eficonfig menu entry contains the '\' separator. strcmp() argument ".." is wrong and one directory up handling does not work correctly. strcmp() argument must include '\' separator. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c3b5af63 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add UEFI Secure Boot Key enrollment interface This commit adds the menu-driven UEFI Secure Boot Key enrollment interface. User can enroll PK, KEK, db and dbx by selecting file. Only the signed EFI Signature List(s) with an authenticated header, typically '.auth' file, is accepted. To clear the PK, KEK, db and dbx, user needs to enroll the null key signed by PK or KEK. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
21faf4ef |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use protocol interface for file selection EFI_SIMPLE_FILE_SYSTEM_PROTOCOL is not always provided by U-Boot. Use protocol interface functions instead of U-Boot internal functions. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d6566113 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose eficonfig_create_device_path() Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use eficonfig_create_device_path() to construct the full device path from device path of the volume and file path, so move it out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d571f9b2 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation All the eficonfig menus other than "Change Boot Order" use 'eficonfig_entry' structure for each menu entry. This commit refactors change boot order implementation to use 'eficonfig_entry' structure same as other menus to have consistent menu handling. This commit also simplifies the data->active handling when KEY_SPACE is pressed, and sizeof() parameter. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
8961e93e |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose append entry function Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use append_entry() and append_quit_entry() to construct the menu, so move them out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
a84040ab |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor file selection handling eficonfig_select_file_handler() is commonly used to select the file. eficonfig_display_select_file_option() adds an additional menu to clear the selected file. eficonfig_display_select_file_option() is not always necessary for the file selection process, so it must be outside of eficonfig_select_file_handler(). This commit also renames the following functions to avoid confusion. eficonfig_select_file_handler() -> eficonfig_process_select_file() eficonfig_select_file() -> eficonfig_show_file_selection() eficonfig_display_select_file_option() -> eficonfig_process_show_file_option() Finally, test_eficonfig.py need to be updated to get aligned with the above modification. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
1167e88a |
|
14-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix missing variable initialization The 'ret' variable must be initialized before use in eficonfig_delete_invalid_boot_option(). Fixes: c416f1c0bc ("bootmenu: add removable media entries") Addresses-Coverity: 376207 ("Uninitialized variables") Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
3d595ac5 |
|
09-Nov-2022 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: remove superfluous if in eficonfig_edit_boot_option Goto for an immediately succeeding label is superfluous. Fixes: 87d791423ac6 ("eficonfig: menu-driven addition of UEFI boot option") Addresses-Coverity: 376202 ("Identical code for different branches") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
64658007 |
|
17-Nov-2023 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: eficonfig: create shortened boot options The boot options created by eficonfig should use shortened device-paths to avoid problems if drives are enumerated in a different sequence. Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
9945bc4f |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Fix incorrect return code of boot option update Correct the return code for out-of-memory and no boot option found Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
339b527b |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Move bootorder and bootoption apis to lib Rename and move bootorder and bootoption apis from cmd to lib for re-use between eficonfig and bootmgr Fix 'unexpected indentation' when 'make htmldocs' after functions are moved Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
2c0b0c31 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_SECURE_BOOT This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_SECURE_BOOT defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
83f3d121 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_MM_COMM_TEE This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_MM_COMM_TEE defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
88df3634 |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: CTRL+S to save the boot order 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>
|
#
45f5319f |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
menu: remove CTRL+C to quit On the sandbox called without "--terminal raw" CTRL+C leaves U-Boot, "ESC/CTRL+C to quit" is misleading. Let's remove CTRL+C to quit key handling from bootmenu and eficonfig menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
|
#
8dbd0a0f |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add vertical scroll support The current eficonfig menu does not support vertical scroll, so it can not display the menu entries greater than the console row size. This commit add the vertial scroll support. The console size is retrieved by SIMPLE_TEXT_OUTPUT_PROTOCOL.QueryMode() service, then calculates the row size for menu entry by subtracting menu header and description row size from the console row size. "start" and "end" are added in the efimenu structure. "start" keeps the menu entry index at the top, "end" keeps the bottom menu entry index. item_data_print() menu function only draws the menu entry between "start" and "end". This commit also fixes the issue that "Save" and "Quit" entries can be moved by BKEY_PLUS in change boot order menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
0d590852 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation This commit removes the change boot order specific menu implementation. The change boot order implementation calls eficonfig_process_common() same as other menus. The change boot order menu requires own item_data_print and item_choice implementation, but display_statusline function can be a same function as other menus. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
cd160b27 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor eficonfig_process_common function Current change boot order implementation does not call eficonfig_process_common() and call own menu functions for display_statusline, item_data_print and item_choice. Change boot order functionality should call eficonfig_process_common() to improve maintenanceability. This commit is a preparation to remove the change boot order specific implementation. The menu functions (display_statusline, item_data_print and item_choice) are added as argument of eficonfig_process_common(). The menu description string displayed at the bottom of the menu is also added as argument. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
32bab0ea |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Make use of CLI character processing Avoid duplicating some of the escape-sequence processing here and use the CLI function instead. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
d0ca98db |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Update bootmenu_loop() to return the code Use the return value to save having to pass around a pointer. This also resolves any ambiguity about what *key contains when the function is called. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
2da4a15e |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Rename KEY_... to BKEY_... This enum values conflict with linux/input.h so rename them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
64550274 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: avoid SetVariable between GetNextVariableName calls The current code calls efi_set_variable_int() to delete the invalid boot option between calls to efi_get_next_variable_name_int(), it may produce unpredictable results. This commit moves removal of the invalid boot option outside of the efi_get_next_variable_name_int() calls. EFI_NOT_FOUND returned from efi_get_next_variable_name_int() indicates we retrieved all EFI variables, it should be treated as EFI_SUCEESS. To address the checkpatch warning of too many leading tabs, combine two if statement into one. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
ce327084 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: carve out efi_get_next_variable_name_int calls To retrieve the EFI variable name by efi_get_next_variable_name_int(), the sequence of alloc -> efi_get_next_variable_name_int -> realloc -> efi_get_next_variable_name_int is required. In current code, this sequence repeatedly appears in the several functions. It should be curved out a common function. This commit also fixes the missing free() of var_name16 in eficonfig_delete_invalid_boot_option(). Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
140a8959 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use efi_get_next_variable_name_int() eficonfig command reads all possible UEFI load options from 0x0000 to 0xFFFF to construct the menu. This takes too much time in some environment. This commit uses efi_get_next_variable_name_int() to read all existing UEFI load options to significantlly reduce the count of efi_get_var() call. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
78b1ccc4 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use u16_strsize() to get u16 string buffer size Use u16_strsize() to simplify the u16 string buffer size calculation. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c67d3c9e |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix going one directory up issue The directory name in eficonfig menu entry contains the '\' separator. strcmp() argument ".." is wrong and one directory up handling does not work correctly. strcmp() argument must include '\' separator. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c3b5af63 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add UEFI Secure Boot Key enrollment interface This commit adds the menu-driven UEFI Secure Boot Key enrollment interface. User can enroll PK, KEK, db and dbx by selecting file. Only the signed EFI Signature List(s) with an authenticated header, typically '.auth' file, is accepted. To clear the PK, KEK, db and dbx, user needs to enroll the null key signed by PK or KEK. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
21faf4ef |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use protocol interface for file selection EFI_SIMPLE_FILE_SYSTEM_PROTOCOL is not always provided by U-Boot. Use protocol interface functions instead of U-Boot internal functions. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d6566113 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose eficonfig_create_device_path() Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use eficonfig_create_device_path() to construct the full device path from device path of the volume and file path, so move it out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d571f9b2 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation All the eficonfig menus other than "Change Boot Order" use 'eficonfig_entry' structure for each menu entry. This commit refactors change boot order implementation to use 'eficonfig_entry' structure same as other menus to have consistent menu handling. This commit also simplifies the data->active handling when KEY_SPACE is pressed, and sizeof() parameter. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
8961e93e |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose append entry function Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use append_entry() and append_quit_entry() to construct the menu, so move them out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
a84040ab |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor file selection handling eficonfig_select_file_handler() is commonly used to select the file. eficonfig_display_select_file_option() adds an additional menu to clear the selected file. eficonfig_display_select_file_option() is not always necessary for the file selection process, so it must be outside of eficonfig_select_file_handler(). This commit also renames the following functions to avoid confusion. eficonfig_select_file_handler() -> eficonfig_process_select_file() eficonfig_select_file() -> eficonfig_show_file_selection() eficonfig_display_select_file_option() -> eficonfig_process_show_file_option() Finally, test_eficonfig.py need to be updated to get aligned with the above modification. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
1167e88a |
|
14-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix missing variable initialization The 'ret' variable must be initialized before use in eficonfig_delete_invalid_boot_option(). Fixes: c416f1c0bc ("bootmenu: add removable media entries") Addresses-Coverity: 376207 ("Uninitialized variables") Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
3d595ac5 |
|
09-Nov-2022 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: remove superfluous if in eficonfig_edit_boot_option Goto for an immediately succeeding label is superfluous. Fixes: 87d791423ac6 ("eficonfig: menu-driven addition of UEFI boot option") Addresses-Coverity: 376202 ("Identical code for different branches") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
64658007 |
|
17-Nov-2023 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: eficonfig: create shortened boot options The boot options created by eficonfig should use shortened device-paths to avoid problems if drives are enumerated in a different sequence. Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
9945bc4f |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Fix incorrect return code of boot option update Correct the return code for out-of-memory and no boot option found Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
339b527b |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Move bootorder and bootoption apis to lib Rename and move bootorder and bootoption apis from cmd to lib for re-use between eficonfig and bootmgr Fix 'unexpected indentation' when 'make htmldocs' after functions are moved Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
2c0b0c31 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_SECURE_BOOT This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_SECURE_BOOT defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
83f3d121 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_MM_COMM_TEE This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_MM_COMM_TEE defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
88df3634 |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: CTRL+S to save the boot order 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>
|
#
45f5319f |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
menu: remove CTRL+C to quit On the sandbox called without "--terminal raw" CTRL+C leaves U-Boot, "ESC/CTRL+C to quit" is misleading. Let's remove CTRL+C to quit key handling from bootmenu and eficonfig menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
|
#
8dbd0a0f |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add vertical scroll support The current eficonfig menu does not support vertical scroll, so it can not display the menu entries greater than the console row size. This commit add the vertial scroll support. The console size is retrieved by SIMPLE_TEXT_OUTPUT_PROTOCOL.QueryMode() service, then calculates the row size for menu entry by subtracting menu header and description row size from the console row size. "start" and "end" are added in the efimenu structure. "start" keeps the menu entry index at the top, "end" keeps the bottom menu entry index. item_data_print() menu function only draws the menu entry between "start" and "end". This commit also fixes the issue that "Save" and "Quit" entries can be moved by BKEY_PLUS in change boot order menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
0d590852 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation This commit removes the change boot order specific menu implementation. The change boot order implementation calls eficonfig_process_common() same as other menus. The change boot order menu requires own item_data_print and item_choice implementation, but display_statusline function can be a same function as other menus. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
cd160b27 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor eficonfig_process_common function Current change boot order implementation does not call eficonfig_process_common() and call own menu functions for display_statusline, item_data_print and item_choice. Change boot order functionality should call eficonfig_process_common() to improve maintenanceability. This commit is a preparation to remove the change boot order specific implementation. The menu functions (display_statusline, item_data_print and item_choice) are added as argument of eficonfig_process_common(). The menu description string displayed at the bottom of the menu is also added as argument. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
32bab0ea |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Make use of CLI character processing Avoid duplicating some of the escape-sequence processing here and use the CLI function instead. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
d0ca98db |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Update bootmenu_loop() to return the code Use the return value to save having to pass around a pointer. This also resolves any ambiguity about what *key contains when the function is called. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
2da4a15e |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Rename KEY_... to BKEY_... This enum values conflict with linux/input.h so rename them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
64550274 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: avoid SetVariable between GetNextVariableName calls The current code calls efi_set_variable_int() to delete the invalid boot option between calls to efi_get_next_variable_name_int(), it may produce unpredictable results. This commit moves removal of the invalid boot option outside of the efi_get_next_variable_name_int() calls. EFI_NOT_FOUND returned from efi_get_next_variable_name_int() indicates we retrieved all EFI variables, it should be treated as EFI_SUCEESS. To address the checkpatch warning of too many leading tabs, combine two if statement into one. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
ce327084 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: carve out efi_get_next_variable_name_int calls To retrieve the EFI variable name by efi_get_next_variable_name_int(), the sequence of alloc -> efi_get_next_variable_name_int -> realloc -> efi_get_next_variable_name_int is required. In current code, this sequence repeatedly appears in the several functions. It should be curved out a common function. This commit also fixes the missing free() of var_name16 in eficonfig_delete_invalid_boot_option(). Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
140a8959 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use efi_get_next_variable_name_int() eficonfig command reads all possible UEFI load options from 0x0000 to 0xFFFF to construct the menu. This takes too much time in some environment. This commit uses efi_get_next_variable_name_int() to read all existing UEFI load options to significantlly reduce the count of efi_get_var() call. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
78b1ccc4 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use u16_strsize() to get u16 string buffer size Use u16_strsize() to simplify the u16 string buffer size calculation. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c67d3c9e |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix going one directory up issue The directory name in eficonfig menu entry contains the '\' separator. strcmp() argument ".." is wrong and one directory up handling does not work correctly. strcmp() argument must include '\' separator. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c3b5af63 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add UEFI Secure Boot Key enrollment interface This commit adds the menu-driven UEFI Secure Boot Key enrollment interface. User can enroll PK, KEK, db and dbx by selecting file. Only the signed EFI Signature List(s) with an authenticated header, typically '.auth' file, is accepted. To clear the PK, KEK, db and dbx, user needs to enroll the null key signed by PK or KEK. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
21faf4ef |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use protocol interface for file selection EFI_SIMPLE_FILE_SYSTEM_PROTOCOL is not always provided by U-Boot. Use protocol interface functions instead of U-Boot internal functions. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d6566113 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose eficonfig_create_device_path() Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use eficonfig_create_device_path() to construct the full device path from device path of the volume and file path, so move it out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d571f9b2 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation All the eficonfig menus other than "Change Boot Order" use 'eficonfig_entry' structure for each menu entry. This commit refactors change boot order implementation to use 'eficonfig_entry' structure same as other menus to have consistent menu handling. This commit also simplifies the data->active handling when KEY_SPACE is pressed, and sizeof() parameter. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
8961e93e |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose append entry function Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use append_entry() and append_quit_entry() to construct the menu, so move them out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
a84040ab |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor file selection handling eficonfig_select_file_handler() is commonly used to select the file. eficonfig_display_select_file_option() adds an additional menu to clear the selected file. eficonfig_display_select_file_option() is not always necessary for the file selection process, so it must be outside of eficonfig_select_file_handler(). This commit also renames the following functions to avoid confusion. eficonfig_select_file_handler() -> eficonfig_process_select_file() eficonfig_select_file() -> eficonfig_show_file_selection() eficonfig_display_select_file_option() -> eficonfig_process_show_file_option() Finally, test_eficonfig.py need to be updated to get aligned with the above modification. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
1167e88a |
|
14-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix missing variable initialization The 'ret' variable must be initialized before use in eficonfig_delete_invalid_boot_option(). Fixes: c416f1c0bc ("bootmenu: add removable media entries") Addresses-Coverity: 376207 ("Uninitialized variables") Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
3d595ac5 |
|
09-Nov-2022 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: remove superfluous if in eficonfig_edit_boot_option Goto for an immediately succeeding label is superfluous. Fixes: 87d791423ac6 ("eficonfig: menu-driven addition of UEFI boot option") Addresses-Coverity: 376202 ("Identical code for different branches") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
64658007 |
|
17-Nov-2023 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: eficonfig: create shortened boot options The boot options created by eficonfig should use shortened device-paths to avoid problems if drives are enumerated in a different sequence. Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
9945bc4f |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Fix incorrect return code of boot option update Correct the return code for out-of-memory and no boot option found Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
339b527b |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Move bootorder and bootoption apis to lib Rename and move bootorder and bootoption apis from cmd to lib for re-use between eficonfig and bootmgr Fix 'unexpected indentation' when 'make htmldocs' after functions are moved Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
2c0b0c31 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_SECURE_BOOT This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_SECURE_BOOT defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
83f3d121 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_MM_COMM_TEE This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_MM_COMM_TEE defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
88df3634 |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: CTRL+S to save the boot order 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>
|
#
45f5319f |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
menu: remove CTRL+C to quit On the sandbox called without "--terminal raw" CTRL+C leaves U-Boot, "ESC/CTRL+C to quit" is misleading. Let's remove CTRL+C to quit key handling from bootmenu and eficonfig menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
|
#
8dbd0a0f |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add vertical scroll support The current eficonfig menu does not support vertical scroll, so it can not display the menu entries greater than the console row size. This commit add the vertial scroll support. The console size is retrieved by SIMPLE_TEXT_OUTPUT_PROTOCOL.QueryMode() service, then calculates the row size for menu entry by subtracting menu header and description row size from the console row size. "start" and "end" are added in the efimenu structure. "start" keeps the menu entry index at the top, "end" keeps the bottom menu entry index. item_data_print() menu function only draws the menu entry between "start" and "end". This commit also fixes the issue that "Save" and "Quit" entries can be moved by BKEY_PLUS in change boot order menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
0d590852 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation This commit removes the change boot order specific menu implementation. The change boot order implementation calls eficonfig_process_common() same as other menus. The change boot order menu requires own item_data_print and item_choice implementation, but display_statusline function can be a same function as other menus. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
cd160b27 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor eficonfig_process_common function Current change boot order implementation does not call eficonfig_process_common() and call own menu functions for display_statusline, item_data_print and item_choice. Change boot order functionality should call eficonfig_process_common() to improve maintenanceability. This commit is a preparation to remove the change boot order specific implementation. The menu functions (display_statusline, item_data_print and item_choice) are added as argument of eficonfig_process_common(). The menu description string displayed at the bottom of the menu is also added as argument. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
32bab0ea |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Make use of CLI character processing Avoid duplicating some of the escape-sequence processing here and use the CLI function instead. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
d0ca98db |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Update bootmenu_loop() to return the code Use the return value to save having to pass around a pointer. This also resolves any ambiguity about what *key contains when the function is called. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
2da4a15e |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Rename KEY_... to BKEY_... This enum values conflict with linux/input.h so rename them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
64550274 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: avoid SetVariable between GetNextVariableName calls The current code calls efi_set_variable_int() to delete the invalid boot option between calls to efi_get_next_variable_name_int(), it may produce unpredictable results. This commit moves removal of the invalid boot option outside of the efi_get_next_variable_name_int() calls. EFI_NOT_FOUND returned from efi_get_next_variable_name_int() indicates we retrieved all EFI variables, it should be treated as EFI_SUCEESS. To address the checkpatch warning of too many leading tabs, combine two if statement into one. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
ce327084 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: carve out efi_get_next_variable_name_int calls To retrieve the EFI variable name by efi_get_next_variable_name_int(), the sequence of alloc -> efi_get_next_variable_name_int -> realloc -> efi_get_next_variable_name_int is required. In current code, this sequence repeatedly appears in the several functions. It should be curved out a common function. This commit also fixes the missing free() of var_name16 in eficonfig_delete_invalid_boot_option(). Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
140a8959 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use efi_get_next_variable_name_int() eficonfig command reads all possible UEFI load options from 0x0000 to 0xFFFF to construct the menu. This takes too much time in some environment. This commit uses efi_get_next_variable_name_int() to read all existing UEFI load options to significantlly reduce the count of efi_get_var() call. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
78b1ccc4 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use u16_strsize() to get u16 string buffer size Use u16_strsize() to simplify the u16 string buffer size calculation. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c67d3c9e |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix going one directory up issue The directory name in eficonfig menu entry contains the '\' separator. strcmp() argument ".." is wrong and one directory up handling does not work correctly. strcmp() argument must include '\' separator. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c3b5af63 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add UEFI Secure Boot Key enrollment interface This commit adds the menu-driven UEFI Secure Boot Key enrollment interface. User can enroll PK, KEK, db and dbx by selecting file. Only the signed EFI Signature List(s) with an authenticated header, typically '.auth' file, is accepted. To clear the PK, KEK, db and dbx, user needs to enroll the null key signed by PK or KEK. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
21faf4ef |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use protocol interface for file selection EFI_SIMPLE_FILE_SYSTEM_PROTOCOL is not always provided by U-Boot. Use protocol interface functions instead of U-Boot internal functions. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d6566113 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose eficonfig_create_device_path() Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use eficonfig_create_device_path() to construct the full device path from device path of the volume and file path, so move it out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d571f9b2 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation All the eficonfig menus other than "Change Boot Order" use 'eficonfig_entry' structure for each menu entry. This commit refactors change boot order implementation to use 'eficonfig_entry' structure same as other menus to have consistent menu handling. This commit also simplifies the data->active handling when KEY_SPACE is pressed, and sizeof() parameter. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
8961e93e |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose append entry function Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use append_entry() and append_quit_entry() to construct the menu, so move them out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
a84040ab |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor file selection handling eficonfig_select_file_handler() is commonly used to select the file. eficonfig_display_select_file_option() adds an additional menu to clear the selected file. eficonfig_display_select_file_option() is not always necessary for the file selection process, so it must be outside of eficonfig_select_file_handler(). This commit also renames the following functions to avoid confusion. eficonfig_select_file_handler() -> eficonfig_process_select_file() eficonfig_select_file() -> eficonfig_show_file_selection() eficonfig_display_select_file_option() -> eficonfig_process_show_file_option() Finally, test_eficonfig.py need to be updated to get aligned with the above modification. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
1167e88a |
|
14-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix missing variable initialization The 'ret' variable must be initialized before use in eficonfig_delete_invalid_boot_option(). Fixes: c416f1c0bc ("bootmenu: add removable media entries") Addresses-Coverity: 376207 ("Uninitialized variables") Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
3d595ac5 |
|
09-Nov-2022 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: remove superfluous if in eficonfig_edit_boot_option Goto for an immediately succeeding label is superfluous. Fixes: 87d791423ac6 ("eficonfig: menu-driven addition of UEFI boot option") Addresses-Coverity: 376202 ("Identical code for different branches") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
64658007 |
|
17-Nov-2023 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: eficonfig: create shortened boot options The boot options created by eficonfig should use shortened device-paths to avoid problems if drives are enumerated in a different sequence. Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
9945bc4f |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Fix incorrect return code of boot option update Correct the return code for out-of-memory and no boot option found Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
339b527b |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Move bootorder and bootoption apis to lib Rename and move bootorder and bootoption apis from cmd to lib for re-use between eficonfig and bootmgr Fix 'unexpected indentation' when 'make htmldocs' after functions are moved Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
2c0b0c31 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_SECURE_BOOT This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_SECURE_BOOT defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
83f3d121 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_MM_COMM_TEE This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_MM_COMM_TEE defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
88df3634 |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: CTRL+S to save the boot order 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>
|
#
45f5319f |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
menu: remove CTRL+C to quit On the sandbox called without "--terminal raw" CTRL+C leaves U-Boot, "ESC/CTRL+C to quit" is misleading. Let's remove CTRL+C to quit key handling from bootmenu and eficonfig menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
|
#
8dbd0a0f |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add vertical scroll support The current eficonfig menu does not support vertical scroll, so it can not display the menu entries greater than the console row size. This commit add the vertial scroll support. The console size is retrieved by SIMPLE_TEXT_OUTPUT_PROTOCOL.QueryMode() service, then calculates the row size for menu entry by subtracting menu header and description row size from the console row size. "start" and "end" are added in the efimenu structure. "start" keeps the menu entry index at the top, "end" keeps the bottom menu entry index. item_data_print() menu function only draws the menu entry between "start" and "end". This commit also fixes the issue that "Save" and "Quit" entries can be moved by BKEY_PLUS in change boot order menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
0d590852 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation This commit removes the change boot order specific menu implementation. The change boot order implementation calls eficonfig_process_common() same as other menus. The change boot order menu requires own item_data_print and item_choice implementation, but display_statusline function can be a same function as other menus. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
cd160b27 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor eficonfig_process_common function Current change boot order implementation does not call eficonfig_process_common() and call own menu functions for display_statusline, item_data_print and item_choice. Change boot order functionality should call eficonfig_process_common() to improve maintenanceability. This commit is a preparation to remove the change boot order specific implementation. The menu functions (display_statusline, item_data_print and item_choice) are added as argument of eficonfig_process_common(). The menu description string displayed at the bottom of the menu is also added as argument. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
32bab0ea |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Make use of CLI character processing Avoid duplicating some of the escape-sequence processing here and use the CLI function instead. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
d0ca98db |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Update bootmenu_loop() to return the code Use the return value to save having to pass around a pointer. This also resolves any ambiguity about what *key contains when the function is called. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
2da4a15e |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Rename KEY_... to BKEY_... This enum values conflict with linux/input.h so rename them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
64550274 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: avoid SetVariable between GetNextVariableName calls The current code calls efi_set_variable_int() to delete the invalid boot option between calls to efi_get_next_variable_name_int(), it may produce unpredictable results. This commit moves removal of the invalid boot option outside of the efi_get_next_variable_name_int() calls. EFI_NOT_FOUND returned from efi_get_next_variable_name_int() indicates we retrieved all EFI variables, it should be treated as EFI_SUCEESS. To address the checkpatch warning of too many leading tabs, combine two if statement into one. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
ce327084 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: carve out efi_get_next_variable_name_int calls To retrieve the EFI variable name by efi_get_next_variable_name_int(), the sequence of alloc -> efi_get_next_variable_name_int -> realloc -> efi_get_next_variable_name_int is required. In current code, this sequence repeatedly appears in the several functions. It should be curved out a common function. This commit also fixes the missing free() of var_name16 in eficonfig_delete_invalid_boot_option(). Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
140a8959 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use efi_get_next_variable_name_int() eficonfig command reads all possible UEFI load options from 0x0000 to 0xFFFF to construct the menu. This takes too much time in some environment. This commit uses efi_get_next_variable_name_int() to read all existing UEFI load options to significantlly reduce the count of efi_get_var() call. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
78b1ccc4 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use u16_strsize() to get u16 string buffer size Use u16_strsize() to simplify the u16 string buffer size calculation. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c67d3c9e |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix going one directory up issue The directory name in eficonfig menu entry contains the '\' separator. strcmp() argument ".." is wrong and one directory up handling does not work correctly. strcmp() argument must include '\' separator. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c3b5af63 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add UEFI Secure Boot Key enrollment interface This commit adds the menu-driven UEFI Secure Boot Key enrollment interface. User can enroll PK, KEK, db and dbx by selecting file. Only the signed EFI Signature List(s) with an authenticated header, typically '.auth' file, is accepted. To clear the PK, KEK, db and dbx, user needs to enroll the null key signed by PK or KEK. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
21faf4ef |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use protocol interface for file selection EFI_SIMPLE_FILE_SYSTEM_PROTOCOL is not always provided by U-Boot. Use protocol interface functions instead of U-Boot internal functions. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d6566113 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose eficonfig_create_device_path() Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use eficonfig_create_device_path() to construct the full device path from device path of the volume and file path, so move it out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d571f9b2 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation All the eficonfig menus other than "Change Boot Order" use 'eficonfig_entry' structure for each menu entry. This commit refactors change boot order implementation to use 'eficonfig_entry' structure same as other menus to have consistent menu handling. This commit also simplifies the data->active handling when KEY_SPACE is pressed, and sizeof() parameter. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
8961e93e |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose append entry function Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use append_entry() and append_quit_entry() to construct the menu, so move them out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
a84040ab |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor file selection handling eficonfig_select_file_handler() is commonly used to select the file. eficonfig_display_select_file_option() adds an additional menu to clear the selected file. eficonfig_display_select_file_option() is not always necessary for the file selection process, so it must be outside of eficonfig_select_file_handler(). This commit also renames the following functions to avoid confusion. eficonfig_select_file_handler() -> eficonfig_process_select_file() eficonfig_select_file() -> eficonfig_show_file_selection() eficonfig_display_select_file_option() -> eficonfig_process_show_file_option() Finally, test_eficonfig.py need to be updated to get aligned with the above modification. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
1167e88a |
|
14-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix missing variable initialization The 'ret' variable must be initialized before use in eficonfig_delete_invalid_boot_option(). Fixes: c416f1c0bc ("bootmenu: add removable media entries") Addresses-Coverity: 376207 ("Uninitialized variables") Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
3d595ac5 |
|
09-Nov-2022 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: remove superfluous if in eficonfig_edit_boot_option Goto for an immediately succeeding label is superfluous. Fixes: 87d791423ac6 ("eficonfig: menu-driven addition of UEFI boot option") Addresses-Coverity: 376202 ("Identical code for different branches") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
64658007 |
|
17-Nov-2023 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: eficonfig: create shortened boot options The boot options created by eficonfig should use shortened device-paths to avoid problems if drives are enumerated in a different sequence. Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
9945bc4f |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Fix incorrect return code of boot option update Correct the return code for out-of-memory and no boot option found Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
339b527b |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Move bootorder and bootoption apis to lib Rename and move bootorder and bootoption apis from cmd to lib for re-use between eficonfig and bootmgr Fix 'unexpected indentation' when 'make htmldocs' after functions are moved Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
2c0b0c31 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_SECURE_BOOT This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_SECURE_BOOT defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
83f3d121 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_MM_COMM_TEE This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_MM_COMM_TEE defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
88df3634 |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: CTRL+S to save the boot order 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>
|
#
45f5319f |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
menu: remove CTRL+C to quit On the sandbox called without "--terminal raw" CTRL+C leaves U-Boot, "ESC/CTRL+C to quit" is misleading. Let's remove CTRL+C to quit key handling from bootmenu and eficonfig menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
|
#
8dbd0a0f |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add vertical scroll support The current eficonfig menu does not support vertical scroll, so it can not display the menu entries greater than the console row size. This commit add the vertial scroll support. The console size is retrieved by SIMPLE_TEXT_OUTPUT_PROTOCOL.QueryMode() service, then calculates the row size for menu entry by subtracting menu header and description row size from the console row size. "start" and "end" are added in the efimenu structure. "start" keeps the menu entry index at the top, "end" keeps the bottom menu entry index. item_data_print() menu function only draws the menu entry between "start" and "end". This commit also fixes the issue that "Save" and "Quit" entries can be moved by BKEY_PLUS in change boot order menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
0d590852 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation This commit removes the change boot order specific menu implementation. The change boot order implementation calls eficonfig_process_common() same as other menus. The change boot order menu requires own item_data_print and item_choice implementation, but display_statusline function can be a same function as other menus. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
cd160b27 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor eficonfig_process_common function Current change boot order implementation does not call eficonfig_process_common() and call own menu functions for display_statusline, item_data_print and item_choice. Change boot order functionality should call eficonfig_process_common() to improve maintenanceability. This commit is a preparation to remove the change boot order specific implementation. The menu functions (display_statusline, item_data_print and item_choice) are added as argument of eficonfig_process_common(). The menu description string displayed at the bottom of the menu is also added as argument. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
32bab0ea |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Make use of CLI character processing Avoid duplicating some of the escape-sequence processing here and use the CLI function instead. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
d0ca98db |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Update bootmenu_loop() to return the code Use the return value to save having to pass around a pointer. This also resolves any ambiguity about what *key contains when the function is called. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
2da4a15e |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Rename KEY_... to BKEY_... This enum values conflict with linux/input.h so rename them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
64550274 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: avoid SetVariable between GetNextVariableName calls The current code calls efi_set_variable_int() to delete the invalid boot option between calls to efi_get_next_variable_name_int(), it may produce unpredictable results. This commit moves removal of the invalid boot option outside of the efi_get_next_variable_name_int() calls. EFI_NOT_FOUND returned from efi_get_next_variable_name_int() indicates we retrieved all EFI variables, it should be treated as EFI_SUCEESS. To address the checkpatch warning of too many leading tabs, combine two if statement into one. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
ce327084 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: carve out efi_get_next_variable_name_int calls To retrieve the EFI variable name by efi_get_next_variable_name_int(), the sequence of alloc -> efi_get_next_variable_name_int -> realloc -> efi_get_next_variable_name_int is required. In current code, this sequence repeatedly appears in the several functions. It should be curved out a common function. This commit also fixes the missing free() of var_name16 in eficonfig_delete_invalid_boot_option(). Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
140a8959 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use efi_get_next_variable_name_int() eficonfig command reads all possible UEFI load options from 0x0000 to 0xFFFF to construct the menu. This takes too much time in some environment. This commit uses efi_get_next_variable_name_int() to read all existing UEFI load options to significantlly reduce the count of efi_get_var() call. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
78b1ccc4 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use u16_strsize() to get u16 string buffer size Use u16_strsize() to simplify the u16 string buffer size calculation. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c67d3c9e |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix going one directory up issue The directory name in eficonfig menu entry contains the '\' separator. strcmp() argument ".." is wrong and one directory up handling does not work correctly. strcmp() argument must include '\' separator. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c3b5af63 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add UEFI Secure Boot Key enrollment interface This commit adds the menu-driven UEFI Secure Boot Key enrollment interface. User can enroll PK, KEK, db and dbx by selecting file. Only the signed EFI Signature List(s) with an authenticated header, typically '.auth' file, is accepted. To clear the PK, KEK, db and dbx, user needs to enroll the null key signed by PK or KEK. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
21faf4ef |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use protocol interface for file selection EFI_SIMPLE_FILE_SYSTEM_PROTOCOL is not always provided by U-Boot. Use protocol interface functions instead of U-Boot internal functions. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d6566113 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose eficonfig_create_device_path() Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use eficonfig_create_device_path() to construct the full device path from device path of the volume and file path, so move it out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d571f9b2 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation All the eficonfig menus other than "Change Boot Order" use 'eficonfig_entry' structure for each menu entry. This commit refactors change boot order implementation to use 'eficonfig_entry' structure same as other menus to have consistent menu handling. This commit also simplifies the data->active handling when KEY_SPACE is pressed, and sizeof() parameter. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
8961e93e |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose append entry function Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use append_entry() and append_quit_entry() to construct the menu, so move them out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
a84040ab |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor file selection handling eficonfig_select_file_handler() is commonly used to select the file. eficonfig_display_select_file_option() adds an additional menu to clear the selected file. eficonfig_display_select_file_option() is not always necessary for the file selection process, so it must be outside of eficonfig_select_file_handler(). This commit also renames the following functions to avoid confusion. eficonfig_select_file_handler() -> eficonfig_process_select_file() eficonfig_select_file() -> eficonfig_show_file_selection() eficonfig_display_select_file_option() -> eficonfig_process_show_file_option() Finally, test_eficonfig.py need to be updated to get aligned with the above modification. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
1167e88a |
|
14-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix missing variable initialization The 'ret' variable must be initialized before use in eficonfig_delete_invalid_boot_option(). Fixes: c416f1c0bc ("bootmenu: add removable media entries") Addresses-Coverity: 376207 ("Uninitialized variables") Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
3d595ac5 |
|
09-Nov-2022 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: remove superfluous if in eficonfig_edit_boot_option Goto for an immediately succeeding label is superfluous. Fixes: 87d791423ac6 ("eficonfig: menu-driven addition of UEFI boot option") Addresses-Coverity: 376202 ("Identical code for different branches") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
64658007 |
|
17-Nov-2023 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: eficonfig: create shortened boot options The boot options created by eficonfig should use shortened device-paths to avoid problems if drives are enumerated in a different sequence. Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
9945bc4f |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Fix incorrect return code of boot option update Correct the return code for out-of-memory and no boot option found Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
339b527b |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Move bootorder and bootoption apis to lib Rename and move bootorder and bootoption apis from cmd to lib for re-use between eficonfig and bootmgr Fix 'unexpected indentation' when 'make htmldocs' after functions are moved Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
2c0b0c31 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_SECURE_BOOT This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_SECURE_BOOT defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
83f3d121 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_MM_COMM_TEE This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_MM_COMM_TEE defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
88df3634 |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: CTRL+S to save the boot order 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>
|
#
45f5319f |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
menu: remove CTRL+C to quit On the sandbox called without "--terminal raw" CTRL+C leaves U-Boot, "ESC/CTRL+C to quit" is misleading. Let's remove CTRL+C to quit key handling from bootmenu and eficonfig menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
|
#
8dbd0a0f |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add vertical scroll support The current eficonfig menu does not support vertical scroll, so it can not display the menu entries greater than the console row size. This commit add the vertial scroll support. The console size is retrieved by SIMPLE_TEXT_OUTPUT_PROTOCOL.QueryMode() service, then calculates the row size for menu entry by subtracting menu header and description row size from the console row size. "start" and "end" are added in the efimenu structure. "start" keeps the menu entry index at the top, "end" keeps the bottom menu entry index. item_data_print() menu function only draws the menu entry between "start" and "end". This commit also fixes the issue that "Save" and "Quit" entries can be moved by BKEY_PLUS in change boot order menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
0d590852 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation This commit removes the change boot order specific menu implementation. The change boot order implementation calls eficonfig_process_common() same as other menus. The change boot order menu requires own item_data_print and item_choice implementation, but display_statusline function can be a same function as other menus. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
cd160b27 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor eficonfig_process_common function Current change boot order implementation does not call eficonfig_process_common() and call own menu functions for display_statusline, item_data_print and item_choice. Change boot order functionality should call eficonfig_process_common() to improve maintenanceability. This commit is a preparation to remove the change boot order specific implementation. The menu functions (display_statusline, item_data_print and item_choice) are added as argument of eficonfig_process_common(). The menu description string displayed at the bottom of the menu is also added as argument. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
32bab0ea |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Make use of CLI character processing Avoid duplicating some of the escape-sequence processing here and use the CLI function instead. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
d0ca98db |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Update bootmenu_loop() to return the code Use the return value to save having to pass around a pointer. This also resolves any ambiguity about what *key contains when the function is called. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
2da4a15e |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Rename KEY_... to BKEY_... This enum values conflict with linux/input.h so rename them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
64550274 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: avoid SetVariable between GetNextVariableName calls The current code calls efi_set_variable_int() to delete the invalid boot option between calls to efi_get_next_variable_name_int(), it may produce unpredictable results. This commit moves removal of the invalid boot option outside of the efi_get_next_variable_name_int() calls. EFI_NOT_FOUND returned from efi_get_next_variable_name_int() indicates we retrieved all EFI variables, it should be treated as EFI_SUCEESS. To address the checkpatch warning of too many leading tabs, combine two if statement into one. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
ce327084 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: carve out efi_get_next_variable_name_int calls To retrieve the EFI variable name by efi_get_next_variable_name_int(), the sequence of alloc -> efi_get_next_variable_name_int -> realloc -> efi_get_next_variable_name_int is required. In current code, this sequence repeatedly appears in the several functions. It should be curved out a common function. This commit also fixes the missing free() of var_name16 in eficonfig_delete_invalid_boot_option(). Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
140a8959 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use efi_get_next_variable_name_int() eficonfig command reads all possible UEFI load options from 0x0000 to 0xFFFF to construct the menu. This takes too much time in some environment. This commit uses efi_get_next_variable_name_int() to read all existing UEFI load options to significantlly reduce the count of efi_get_var() call. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
78b1ccc4 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use u16_strsize() to get u16 string buffer size Use u16_strsize() to simplify the u16 string buffer size calculation. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c67d3c9e |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix going one directory up issue The directory name in eficonfig menu entry contains the '\' separator. strcmp() argument ".." is wrong and one directory up handling does not work correctly. strcmp() argument must include '\' separator. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c3b5af63 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add UEFI Secure Boot Key enrollment interface This commit adds the menu-driven UEFI Secure Boot Key enrollment interface. User can enroll PK, KEK, db and dbx by selecting file. Only the signed EFI Signature List(s) with an authenticated header, typically '.auth' file, is accepted. To clear the PK, KEK, db and dbx, user needs to enroll the null key signed by PK or KEK. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
21faf4ef |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use protocol interface for file selection EFI_SIMPLE_FILE_SYSTEM_PROTOCOL is not always provided by U-Boot. Use protocol interface functions instead of U-Boot internal functions. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d6566113 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose eficonfig_create_device_path() Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use eficonfig_create_device_path() to construct the full device path from device path of the volume and file path, so move it out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d571f9b2 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation All the eficonfig menus other than "Change Boot Order" use 'eficonfig_entry' structure for each menu entry. This commit refactors change boot order implementation to use 'eficonfig_entry' structure same as other menus to have consistent menu handling. This commit also simplifies the data->active handling when KEY_SPACE is pressed, and sizeof() parameter. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
8961e93e |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose append entry function Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use append_entry() and append_quit_entry() to construct the menu, so move them out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
a84040ab |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor file selection handling eficonfig_select_file_handler() is commonly used to select the file. eficonfig_display_select_file_option() adds an additional menu to clear the selected file. eficonfig_display_select_file_option() is not always necessary for the file selection process, so it must be outside of eficonfig_select_file_handler(). This commit also renames the following functions to avoid confusion. eficonfig_select_file_handler() -> eficonfig_process_select_file() eficonfig_select_file() -> eficonfig_show_file_selection() eficonfig_display_select_file_option() -> eficonfig_process_show_file_option() Finally, test_eficonfig.py need to be updated to get aligned with the above modification. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
1167e88a |
|
14-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix missing variable initialization The 'ret' variable must be initialized before use in eficonfig_delete_invalid_boot_option(). Fixes: c416f1c0bc ("bootmenu: add removable media entries") Addresses-Coverity: 376207 ("Uninitialized variables") Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
3d595ac5 |
|
09-Nov-2022 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: remove superfluous if in eficonfig_edit_boot_option Goto for an immediately succeeding label is superfluous. Fixes: 87d791423ac6 ("eficonfig: menu-driven addition of UEFI boot option") Addresses-Coverity: 376202 ("Identical code for different branches") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
64658007 |
|
17-Nov-2023 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: eficonfig: create shortened boot options The boot options created by eficonfig should use shortened device-paths to avoid problems if drives are enumerated in a different sequence. Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
9945bc4f |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Fix incorrect return code of boot option update Correct the return code for out-of-memory and no boot option found Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
339b527b |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Move bootorder and bootoption apis to lib Rename and move bootorder and bootoption apis from cmd to lib for re-use between eficonfig and bootmgr Fix 'unexpected indentation' when 'make htmldocs' after functions are moved Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
2c0b0c31 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_SECURE_BOOT This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_SECURE_BOOT defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
83f3d121 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_MM_COMM_TEE This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_MM_COMM_TEE defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
88df3634 |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: CTRL+S to save the boot order 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>
|
#
45f5319f |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
menu: remove CTRL+C to quit On the sandbox called without "--terminal raw" CTRL+C leaves U-Boot, "ESC/CTRL+C to quit" is misleading. Let's remove CTRL+C to quit key handling from bootmenu and eficonfig menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
|
#
8dbd0a0f |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add vertical scroll support The current eficonfig menu does not support vertical scroll, so it can not display the menu entries greater than the console row size. This commit add the vertial scroll support. The console size is retrieved by SIMPLE_TEXT_OUTPUT_PROTOCOL.QueryMode() service, then calculates the row size for menu entry by subtracting menu header and description row size from the console row size. "start" and "end" are added in the efimenu structure. "start" keeps the menu entry index at the top, "end" keeps the bottom menu entry index. item_data_print() menu function only draws the menu entry between "start" and "end". This commit also fixes the issue that "Save" and "Quit" entries can be moved by BKEY_PLUS in change boot order menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
0d590852 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation This commit removes the change boot order specific menu implementation. The change boot order implementation calls eficonfig_process_common() same as other menus. The change boot order menu requires own item_data_print and item_choice implementation, but display_statusline function can be a same function as other menus. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
cd160b27 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor eficonfig_process_common function Current change boot order implementation does not call eficonfig_process_common() and call own menu functions for display_statusline, item_data_print and item_choice. Change boot order functionality should call eficonfig_process_common() to improve maintenanceability. This commit is a preparation to remove the change boot order specific implementation. The menu functions (display_statusline, item_data_print and item_choice) are added as argument of eficonfig_process_common(). The menu description string displayed at the bottom of the menu is also added as argument. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
32bab0ea |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Make use of CLI character processing Avoid duplicating some of the escape-sequence processing here and use the CLI function instead. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
d0ca98db |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Update bootmenu_loop() to return the code Use the return value to save having to pass around a pointer. This also resolves any ambiguity about what *key contains when the function is called. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
2da4a15e |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Rename KEY_... to BKEY_... This enum values conflict with linux/input.h so rename them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
64550274 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: avoid SetVariable between GetNextVariableName calls The current code calls efi_set_variable_int() to delete the invalid boot option between calls to efi_get_next_variable_name_int(), it may produce unpredictable results. This commit moves removal of the invalid boot option outside of the efi_get_next_variable_name_int() calls. EFI_NOT_FOUND returned from efi_get_next_variable_name_int() indicates we retrieved all EFI variables, it should be treated as EFI_SUCEESS. To address the checkpatch warning of too many leading tabs, combine two if statement into one. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
ce327084 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: carve out efi_get_next_variable_name_int calls To retrieve the EFI variable name by efi_get_next_variable_name_int(), the sequence of alloc -> efi_get_next_variable_name_int -> realloc -> efi_get_next_variable_name_int is required. In current code, this sequence repeatedly appears in the several functions. It should be curved out a common function. This commit also fixes the missing free() of var_name16 in eficonfig_delete_invalid_boot_option(). Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
140a8959 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use efi_get_next_variable_name_int() eficonfig command reads all possible UEFI load options from 0x0000 to 0xFFFF to construct the menu. This takes too much time in some environment. This commit uses efi_get_next_variable_name_int() to read all existing UEFI load options to significantlly reduce the count of efi_get_var() call. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
78b1ccc4 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use u16_strsize() to get u16 string buffer size Use u16_strsize() to simplify the u16 string buffer size calculation. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c67d3c9e |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix going one directory up issue The directory name in eficonfig menu entry contains the '\' separator. strcmp() argument ".." is wrong and one directory up handling does not work correctly. strcmp() argument must include '\' separator. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c3b5af63 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add UEFI Secure Boot Key enrollment interface This commit adds the menu-driven UEFI Secure Boot Key enrollment interface. User can enroll PK, KEK, db and dbx by selecting file. Only the signed EFI Signature List(s) with an authenticated header, typically '.auth' file, is accepted. To clear the PK, KEK, db and dbx, user needs to enroll the null key signed by PK or KEK. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
21faf4ef |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use protocol interface for file selection EFI_SIMPLE_FILE_SYSTEM_PROTOCOL is not always provided by U-Boot. Use protocol interface functions instead of U-Boot internal functions. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d6566113 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose eficonfig_create_device_path() Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use eficonfig_create_device_path() to construct the full device path from device path of the volume and file path, so move it out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d571f9b2 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation All the eficonfig menus other than "Change Boot Order" use 'eficonfig_entry' structure for each menu entry. This commit refactors change boot order implementation to use 'eficonfig_entry' structure same as other menus to have consistent menu handling. This commit also simplifies the data->active handling when KEY_SPACE is pressed, and sizeof() parameter. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
8961e93e |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose append entry function Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use append_entry() and append_quit_entry() to construct the menu, so move them out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
a84040ab |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor file selection handling eficonfig_select_file_handler() is commonly used to select the file. eficonfig_display_select_file_option() adds an additional menu to clear the selected file. eficonfig_display_select_file_option() is not always necessary for the file selection process, so it must be outside of eficonfig_select_file_handler(). This commit also renames the following functions to avoid confusion. eficonfig_select_file_handler() -> eficonfig_process_select_file() eficonfig_select_file() -> eficonfig_show_file_selection() eficonfig_display_select_file_option() -> eficonfig_process_show_file_option() Finally, test_eficonfig.py need to be updated to get aligned with the above modification. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
1167e88a |
|
14-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix missing variable initialization The 'ret' variable must be initialized before use in eficonfig_delete_invalid_boot_option(). Fixes: c416f1c0bc ("bootmenu: add removable media entries") Addresses-Coverity: 376207 ("Uninitialized variables") Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
3d595ac5 |
|
09-Nov-2022 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: remove superfluous if in eficonfig_edit_boot_option Goto for an immediately succeeding label is superfluous. Fixes: 87d791423ac6 ("eficonfig: menu-driven addition of UEFI boot option") Addresses-Coverity: 376202 ("Identical code for different branches") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
64658007 |
|
17-Nov-2023 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: eficonfig: create shortened boot options The boot options created by eficonfig should use shortened device-paths to avoid problems if drives are enumerated in a different sequence. Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
9945bc4f |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Fix incorrect return code of boot option update Correct the return code for out-of-memory and no boot option found Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
339b527b |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Move bootorder and bootoption apis to lib Rename and move bootorder and bootoption apis from cmd to lib for re-use between eficonfig and bootmgr Fix 'unexpected indentation' when 'make htmldocs' after functions are moved Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
2c0b0c31 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_SECURE_BOOT This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_SECURE_BOOT defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
83f3d121 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_MM_COMM_TEE This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_MM_COMM_TEE defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
88df3634 |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: CTRL+S to save the boot order 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>
|
#
45f5319f |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
menu: remove CTRL+C to quit On the sandbox called without "--terminal raw" CTRL+C leaves U-Boot, "ESC/CTRL+C to quit" is misleading. Let's remove CTRL+C to quit key handling from bootmenu and eficonfig menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
|
#
8dbd0a0f |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add vertical scroll support The current eficonfig menu does not support vertical scroll, so it can not display the menu entries greater than the console row size. This commit add the vertial scroll support. The console size is retrieved by SIMPLE_TEXT_OUTPUT_PROTOCOL.QueryMode() service, then calculates the row size for menu entry by subtracting menu header and description row size from the console row size. "start" and "end" are added in the efimenu structure. "start" keeps the menu entry index at the top, "end" keeps the bottom menu entry index. item_data_print() menu function only draws the menu entry between "start" and "end". This commit also fixes the issue that "Save" and "Quit" entries can be moved by BKEY_PLUS in change boot order menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
0d590852 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation This commit removes the change boot order specific menu implementation. The change boot order implementation calls eficonfig_process_common() same as other menus. The change boot order menu requires own item_data_print and item_choice implementation, but display_statusline function can be a same function as other menus. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
cd160b27 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor eficonfig_process_common function Current change boot order implementation does not call eficonfig_process_common() and call own menu functions for display_statusline, item_data_print and item_choice. Change boot order functionality should call eficonfig_process_common() to improve maintenanceability. This commit is a preparation to remove the change boot order specific implementation. The menu functions (display_statusline, item_data_print and item_choice) are added as argument of eficonfig_process_common(). The menu description string displayed at the bottom of the menu is also added as argument. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
32bab0ea |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Make use of CLI character processing Avoid duplicating some of the escape-sequence processing here and use the CLI function instead. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
d0ca98db |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Update bootmenu_loop() to return the code Use the return value to save having to pass around a pointer. This also resolves any ambiguity about what *key contains when the function is called. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
2da4a15e |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Rename KEY_... to BKEY_... This enum values conflict with linux/input.h so rename them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
64550274 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: avoid SetVariable between GetNextVariableName calls The current code calls efi_set_variable_int() to delete the invalid boot option between calls to efi_get_next_variable_name_int(), it may produce unpredictable results. This commit moves removal of the invalid boot option outside of the efi_get_next_variable_name_int() calls. EFI_NOT_FOUND returned from efi_get_next_variable_name_int() indicates we retrieved all EFI variables, it should be treated as EFI_SUCEESS. To address the checkpatch warning of too many leading tabs, combine two if statement into one. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
ce327084 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: carve out efi_get_next_variable_name_int calls To retrieve the EFI variable name by efi_get_next_variable_name_int(), the sequence of alloc -> efi_get_next_variable_name_int -> realloc -> efi_get_next_variable_name_int is required. In current code, this sequence repeatedly appears in the several functions. It should be curved out a common function. This commit also fixes the missing free() of var_name16 in eficonfig_delete_invalid_boot_option(). Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
140a8959 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use efi_get_next_variable_name_int() eficonfig command reads all possible UEFI load options from 0x0000 to 0xFFFF to construct the menu. This takes too much time in some environment. This commit uses efi_get_next_variable_name_int() to read all existing UEFI load options to significantlly reduce the count of efi_get_var() call. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
78b1ccc4 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use u16_strsize() to get u16 string buffer size Use u16_strsize() to simplify the u16 string buffer size calculation. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c67d3c9e |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix going one directory up issue The directory name in eficonfig menu entry contains the '\' separator. strcmp() argument ".." is wrong and one directory up handling does not work correctly. strcmp() argument must include '\' separator. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c3b5af63 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add UEFI Secure Boot Key enrollment interface This commit adds the menu-driven UEFI Secure Boot Key enrollment interface. User can enroll PK, KEK, db and dbx by selecting file. Only the signed EFI Signature List(s) with an authenticated header, typically '.auth' file, is accepted. To clear the PK, KEK, db and dbx, user needs to enroll the null key signed by PK or KEK. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
21faf4ef |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use protocol interface for file selection EFI_SIMPLE_FILE_SYSTEM_PROTOCOL is not always provided by U-Boot. Use protocol interface functions instead of U-Boot internal functions. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d6566113 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose eficonfig_create_device_path() Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use eficonfig_create_device_path() to construct the full device path from device path of the volume and file path, so move it out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d571f9b2 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation All the eficonfig menus other than "Change Boot Order" use 'eficonfig_entry' structure for each menu entry. This commit refactors change boot order implementation to use 'eficonfig_entry' structure same as other menus to have consistent menu handling. This commit also simplifies the data->active handling when KEY_SPACE is pressed, and sizeof() parameter. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
8961e93e |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose append entry function Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use append_entry() and append_quit_entry() to construct the menu, so move them out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
a84040ab |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor file selection handling eficonfig_select_file_handler() is commonly used to select the file. eficonfig_display_select_file_option() adds an additional menu to clear the selected file. eficonfig_display_select_file_option() is not always necessary for the file selection process, so it must be outside of eficonfig_select_file_handler(). This commit also renames the following functions to avoid confusion. eficonfig_select_file_handler() -> eficonfig_process_select_file() eficonfig_select_file() -> eficonfig_show_file_selection() eficonfig_display_select_file_option() -> eficonfig_process_show_file_option() Finally, test_eficonfig.py need to be updated to get aligned with the above modification. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
1167e88a |
|
14-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix missing variable initialization The 'ret' variable must be initialized before use in eficonfig_delete_invalid_boot_option(). Fixes: c416f1c0bc ("bootmenu: add removable media entries") Addresses-Coverity: 376207 ("Uninitialized variables") Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
3d595ac5 |
|
09-Nov-2022 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: remove superfluous if in eficonfig_edit_boot_option Goto for an immediately succeeding label is superfluous. Fixes: 87d791423ac6 ("eficonfig: menu-driven addition of UEFI boot option") Addresses-Coverity: 376202 ("Identical code for different branches") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
64658007 |
|
17-Nov-2023 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: eficonfig: create shortened boot options The boot options created by eficonfig should use shortened device-paths to avoid problems if drives are enumerated in a different sequence. Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
9945bc4f |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Fix incorrect return code of boot option update Correct the return code for out-of-memory and no boot option found Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
339b527b |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Move bootorder and bootoption apis to lib Rename and move bootorder and bootoption apis from cmd to lib for re-use between eficonfig and bootmgr Fix 'unexpected indentation' when 'make htmldocs' after functions are moved Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
2c0b0c31 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_SECURE_BOOT This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_SECURE_BOOT defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
83f3d121 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_MM_COMM_TEE This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_MM_COMM_TEE defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
88df3634 |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: CTRL+S to save the boot order 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>
|
#
45f5319f |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
menu: remove CTRL+C to quit On the sandbox called without "--terminal raw" CTRL+C leaves U-Boot, "ESC/CTRL+C to quit" is misleading. Let's remove CTRL+C to quit key handling from bootmenu and eficonfig menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
|
#
8dbd0a0f |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add vertical scroll support The current eficonfig menu does not support vertical scroll, so it can not display the menu entries greater than the console row size. This commit add the vertial scroll support. The console size is retrieved by SIMPLE_TEXT_OUTPUT_PROTOCOL.QueryMode() service, then calculates the row size for menu entry by subtracting menu header and description row size from the console row size. "start" and "end" are added in the efimenu structure. "start" keeps the menu entry index at the top, "end" keeps the bottom menu entry index. item_data_print() menu function only draws the menu entry between "start" and "end". This commit also fixes the issue that "Save" and "Quit" entries can be moved by BKEY_PLUS in change boot order menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
0d590852 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation This commit removes the change boot order specific menu implementation. The change boot order implementation calls eficonfig_process_common() same as other menus. The change boot order menu requires own item_data_print and item_choice implementation, but display_statusline function can be a same function as other menus. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
cd160b27 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor eficonfig_process_common function Current change boot order implementation does not call eficonfig_process_common() and call own menu functions for display_statusline, item_data_print and item_choice. Change boot order functionality should call eficonfig_process_common() to improve maintenanceability. This commit is a preparation to remove the change boot order specific implementation. The menu functions (display_statusline, item_data_print and item_choice) are added as argument of eficonfig_process_common(). The menu description string displayed at the bottom of the menu is also added as argument. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
32bab0ea |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Make use of CLI character processing Avoid duplicating some of the escape-sequence processing here and use the CLI function instead. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
d0ca98db |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Update bootmenu_loop() to return the code Use the return value to save having to pass around a pointer. This also resolves any ambiguity about what *key contains when the function is called. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
2da4a15e |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Rename KEY_... to BKEY_... This enum values conflict with linux/input.h so rename them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
64550274 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: avoid SetVariable between GetNextVariableName calls The current code calls efi_set_variable_int() to delete the invalid boot option between calls to efi_get_next_variable_name_int(), it may produce unpredictable results. This commit moves removal of the invalid boot option outside of the efi_get_next_variable_name_int() calls. EFI_NOT_FOUND returned from efi_get_next_variable_name_int() indicates we retrieved all EFI variables, it should be treated as EFI_SUCEESS. To address the checkpatch warning of too many leading tabs, combine two if statement into one. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
ce327084 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: carve out efi_get_next_variable_name_int calls To retrieve the EFI variable name by efi_get_next_variable_name_int(), the sequence of alloc -> efi_get_next_variable_name_int -> realloc -> efi_get_next_variable_name_int is required. In current code, this sequence repeatedly appears in the several functions. It should be curved out a common function. This commit also fixes the missing free() of var_name16 in eficonfig_delete_invalid_boot_option(). Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
140a8959 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use efi_get_next_variable_name_int() eficonfig command reads all possible UEFI load options from 0x0000 to 0xFFFF to construct the menu. This takes too much time in some environment. This commit uses efi_get_next_variable_name_int() to read all existing UEFI load options to significantlly reduce the count of efi_get_var() call. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
78b1ccc4 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use u16_strsize() to get u16 string buffer size Use u16_strsize() to simplify the u16 string buffer size calculation. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c67d3c9e |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix going one directory up issue The directory name in eficonfig menu entry contains the '\' separator. strcmp() argument ".." is wrong and one directory up handling does not work correctly. strcmp() argument must include '\' separator. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c3b5af63 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add UEFI Secure Boot Key enrollment interface This commit adds the menu-driven UEFI Secure Boot Key enrollment interface. User can enroll PK, KEK, db and dbx by selecting file. Only the signed EFI Signature List(s) with an authenticated header, typically '.auth' file, is accepted. To clear the PK, KEK, db and dbx, user needs to enroll the null key signed by PK or KEK. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
21faf4ef |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use protocol interface for file selection EFI_SIMPLE_FILE_SYSTEM_PROTOCOL is not always provided by U-Boot. Use protocol interface functions instead of U-Boot internal functions. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d6566113 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose eficonfig_create_device_path() Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use eficonfig_create_device_path() to construct the full device path from device path of the volume and file path, so move it out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d571f9b2 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation All the eficonfig menus other than "Change Boot Order" use 'eficonfig_entry' structure for each menu entry. This commit refactors change boot order implementation to use 'eficonfig_entry' structure same as other menus to have consistent menu handling. This commit also simplifies the data->active handling when KEY_SPACE is pressed, and sizeof() parameter. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
8961e93e |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose append entry function Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use append_entry() and append_quit_entry() to construct the menu, so move them out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
a84040ab |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor file selection handling eficonfig_select_file_handler() is commonly used to select the file. eficonfig_display_select_file_option() adds an additional menu to clear the selected file. eficonfig_display_select_file_option() is not always necessary for the file selection process, so it must be outside of eficonfig_select_file_handler(). This commit also renames the following functions to avoid confusion. eficonfig_select_file_handler() -> eficonfig_process_select_file() eficonfig_select_file() -> eficonfig_show_file_selection() eficonfig_display_select_file_option() -> eficonfig_process_show_file_option() Finally, test_eficonfig.py need to be updated to get aligned with the above modification. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
1167e88a |
|
14-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix missing variable initialization The 'ret' variable must be initialized before use in eficonfig_delete_invalid_boot_option(). Fixes: c416f1c0bc ("bootmenu: add removable media entries") Addresses-Coverity: 376207 ("Uninitialized variables") Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
3d595ac5 |
|
09-Nov-2022 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: remove superfluous if in eficonfig_edit_boot_option Goto for an immediately succeeding label is superfluous. Fixes: 87d791423ac6 ("eficonfig: menu-driven addition of UEFI boot option") Addresses-Coverity: 376202 ("Identical code for different branches") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
64658007 |
|
17-Nov-2023 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: eficonfig: create shortened boot options The boot options created by eficonfig should use shortened device-paths to avoid problems if drives are enumerated in a different sequence. Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
9945bc4f |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Fix incorrect return code of boot option update Correct the return code for out-of-memory and no boot option found Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
339b527b |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Move bootorder and bootoption apis to lib Rename and move bootorder and bootoption apis from cmd to lib for re-use between eficonfig and bootmgr Fix 'unexpected indentation' when 'make htmldocs' after functions are moved Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
2c0b0c31 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_SECURE_BOOT This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_SECURE_BOOT defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
83f3d121 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_MM_COMM_TEE This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_MM_COMM_TEE defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
88df3634 |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: CTRL+S to save the boot order 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>
|
#
45f5319f |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
menu: remove CTRL+C to quit On the sandbox called without "--terminal raw" CTRL+C leaves U-Boot, "ESC/CTRL+C to quit" is misleading. Let's remove CTRL+C to quit key handling from bootmenu and eficonfig menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
|
#
8dbd0a0f |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add vertical scroll support The current eficonfig menu does not support vertical scroll, so it can not display the menu entries greater than the console row size. This commit add the vertial scroll support. The console size is retrieved by SIMPLE_TEXT_OUTPUT_PROTOCOL.QueryMode() service, then calculates the row size for menu entry by subtracting menu header and description row size from the console row size. "start" and "end" are added in the efimenu structure. "start" keeps the menu entry index at the top, "end" keeps the bottom menu entry index. item_data_print() menu function only draws the menu entry between "start" and "end". This commit also fixes the issue that "Save" and "Quit" entries can be moved by BKEY_PLUS in change boot order menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
0d590852 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation This commit removes the change boot order specific menu implementation. The change boot order implementation calls eficonfig_process_common() same as other menus. The change boot order menu requires own item_data_print and item_choice implementation, but display_statusline function can be a same function as other menus. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
cd160b27 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor eficonfig_process_common function Current change boot order implementation does not call eficonfig_process_common() and call own menu functions for display_statusline, item_data_print and item_choice. Change boot order functionality should call eficonfig_process_common() to improve maintenanceability. This commit is a preparation to remove the change boot order specific implementation. The menu functions (display_statusline, item_data_print and item_choice) are added as argument of eficonfig_process_common(). The menu description string displayed at the bottom of the menu is also added as argument. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
32bab0ea |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Make use of CLI character processing Avoid duplicating some of the escape-sequence processing here and use the CLI function instead. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
d0ca98db |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Update bootmenu_loop() to return the code Use the return value to save having to pass around a pointer. This also resolves any ambiguity about what *key contains when the function is called. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
2da4a15e |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Rename KEY_... to BKEY_... This enum values conflict with linux/input.h so rename them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
64550274 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: avoid SetVariable between GetNextVariableName calls The current code calls efi_set_variable_int() to delete the invalid boot option between calls to efi_get_next_variable_name_int(), it may produce unpredictable results. This commit moves removal of the invalid boot option outside of the efi_get_next_variable_name_int() calls. EFI_NOT_FOUND returned from efi_get_next_variable_name_int() indicates we retrieved all EFI variables, it should be treated as EFI_SUCEESS. To address the checkpatch warning of too many leading tabs, combine two if statement into one. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
ce327084 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: carve out efi_get_next_variable_name_int calls To retrieve the EFI variable name by efi_get_next_variable_name_int(), the sequence of alloc -> efi_get_next_variable_name_int -> realloc -> efi_get_next_variable_name_int is required. In current code, this sequence repeatedly appears in the several functions. It should be curved out a common function. This commit also fixes the missing free() of var_name16 in eficonfig_delete_invalid_boot_option(). Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
140a8959 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use efi_get_next_variable_name_int() eficonfig command reads all possible UEFI load options from 0x0000 to 0xFFFF to construct the menu. This takes too much time in some environment. This commit uses efi_get_next_variable_name_int() to read all existing UEFI load options to significantlly reduce the count of efi_get_var() call. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
78b1ccc4 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use u16_strsize() to get u16 string buffer size Use u16_strsize() to simplify the u16 string buffer size calculation. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c67d3c9e |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix going one directory up issue The directory name in eficonfig menu entry contains the '\' separator. strcmp() argument ".." is wrong and one directory up handling does not work correctly. strcmp() argument must include '\' separator. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c3b5af63 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add UEFI Secure Boot Key enrollment interface This commit adds the menu-driven UEFI Secure Boot Key enrollment interface. User can enroll PK, KEK, db and dbx by selecting file. Only the signed EFI Signature List(s) with an authenticated header, typically '.auth' file, is accepted. To clear the PK, KEK, db and dbx, user needs to enroll the null key signed by PK or KEK. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
21faf4ef |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use protocol interface for file selection EFI_SIMPLE_FILE_SYSTEM_PROTOCOL is not always provided by U-Boot. Use protocol interface functions instead of U-Boot internal functions. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d6566113 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose eficonfig_create_device_path() Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use eficonfig_create_device_path() to construct the full device path from device path of the volume and file path, so move it out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d571f9b2 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation All the eficonfig menus other than "Change Boot Order" use 'eficonfig_entry' structure for each menu entry. This commit refactors change boot order implementation to use 'eficonfig_entry' structure same as other menus to have consistent menu handling. This commit also simplifies the data->active handling when KEY_SPACE is pressed, and sizeof() parameter. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
8961e93e |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose append entry function Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use append_entry() and append_quit_entry() to construct the menu, so move them out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
a84040ab |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor file selection handling eficonfig_select_file_handler() is commonly used to select the file. eficonfig_display_select_file_option() adds an additional menu to clear the selected file. eficonfig_display_select_file_option() is not always necessary for the file selection process, so it must be outside of eficonfig_select_file_handler(). This commit also renames the following functions to avoid confusion. eficonfig_select_file_handler() -> eficonfig_process_select_file() eficonfig_select_file() -> eficonfig_show_file_selection() eficonfig_display_select_file_option() -> eficonfig_process_show_file_option() Finally, test_eficonfig.py need to be updated to get aligned with the above modification. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
1167e88a |
|
14-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix missing variable initialization The 'ret' variable must be initialized before use in eficonfig_delete_invalid_boot_option(). Fixes: c416f1c0bc ("bootmenu: add removable media entries") Addresses-Coverity: 376207 ("Uninitialized variables") Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
3d595ac5 |
|
09-Nov-2022 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: remove superfluous if in eficonfig_edit_boot_option Goto for an immediately succeeding label is superfluous. Fixes: 87d791423ac6 ("eficonfig: menu-driven addition of UEFI boot option") Addresses-Coverity: 376202 ("Identical code for different branches") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
64658007 |
|
17-Nov-2023 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: eficonfig: create shortened boot options The boot options created by eficonfig should use shortened device-paths to avoid problems if drives are enumerated in a different sequence. Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
9945bc4f |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Fix incorrect return code of boot option update Correct the return code for out-of-memory and no boot option found Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
339b527b |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Move bootorder and bootoption apis to lib Rename and move bootorder and bootoption apis from cmd to lib for re-use between eficonfig and bootmgr Fix 'unexpected indentation' when 'make htmldocs' after functions are moved Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
2c0b0c31 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_SECURE_BOOT This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_SECURE_BOOT defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
83f3d121 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_MM_COMM_TEE This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_MM_COMM_TEE defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
88df3634 |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: CTRL+S to save the boot order 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>
|
#
45f5319f |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
menu: remove CTRL+C to quit On the sandbox called without "--terminal raw" CTRL+C leaves U-Boot, "ESC/CTRL+C to quit" is misleading. Let's remove CTRL+C to quit key handling from bootmenu and eficonfig menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
|
#
8dbd0a0f |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add vertical scroll support The current eficonfig menu does not support vertical scroll, so it can not display the menu entries greater than the console row size. This commit add the vertial scroll support. The console size is retrieved by SIMPLE_TEXT_OUTPUT_PROTOCOL.QueryMode() service, then calculates the row size for menu entry by subtracting menu header and description row size from the console row size. "start" and "end" are added in the efimenu structure. "start" keeps the menu entry index at the top, "end" keeps the bottom menu entry index. item_data_print() menu function only draws the menu entry between "start" and "end". This commit also fixes the issue that "Save" and "Quit" entries can be moved by BKEY_PLUS in change boot order menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
0d590852 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation This commit removes the change boot order specific menu implementation. The change boot order implementation calls eficonfig_process_common() same as other menus. The change boot order menu requires own item_data_print and item_choice implementation, but display_statusline function can be a same function as other menus. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
cd160b27 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor eficonfig_process_common function Current change boot order implementation does not call eficonfig_process_common() and call own menu functions for display_statusline, item_data_print and item_choice. Change boot order functionality should call eficonfig_process_common() to improve maintenanceability. This commit is a preparation to remove the change boot order specific implementation. The menu functions (display_statusline, item_data_print and item_choice) are added as argument of eficonfig_process_common(). The menu description string displayed at the bottom of the menu is also added as argument. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
32bab0ea |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Make use of CLI character processing Avoid duplicating some of the escape-sequence processing here and use the CLI function instead. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
d0ca98db |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Update bootmenu_loop() to return the code Use the return value to save having to pass around a pointer. This also resolves any ambiguity about what *key contains when the function is called. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
2da4a15e |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Rename KEY_... to BKEY_... This enum values conflict with linux/input.h so rename them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
64550274 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: avoid SetVariable between GetNextVariableName calls The current code calls efi_set_variable_int() to delete the invalid boot option between calls to efi_get_next_variable_name_int(), it may produce unpredictable results. This commit moves removal of the invalid boot option outside of the efi_get_next_variable_name_int() calls. EFI_NOT_FOUND returned from efi_get_next_variable_name_int() indicates we retrieved all EFI variables, it should be treated as EFI_SUCEESS. To address the checkpatch warning of too many leading tabs, combine two if statement into one. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
ce327084 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: carve out efi_get_next_variable_name_int calls To retrieve the EFI variable name by efi_get_next_variable_name_int(), the sequence of alloc -> efi_get_next_variable_name_int -> realloc -> efi_get_next_variable_name_int is required. In current code, this sequence repeatedly appears in the several functions. It should be curved out a common function. This commit also fixes the missing free() of var_name16 in eficonfig_delete_invalid_boot_option(). Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
140a8959 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use efi_get_next_variable_name_int() eficonfig command reads all possible UEFI load options from 0x0000 to 0xFFFF to construct the menu. This takes too much time in some environment. This commit uses efi_get_next_variable_name_int() to read all existing UEFI load options to significantlly reduce the count of efi_get_var() call. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
78b1ccc4 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use u16_strsize() to get u16 string buffer size Use u16_strsize() to simplify the u16 string buffer size calculation. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c67d3c9e |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix going one directory up issue The directory name in eficonfig menu entry contains the '\' separator. strcmp() argument ".." is wrong and one directory up handling does not work correctly. strcmp() argument must include '\' separator. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c3b5af63 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add UEFI Secure Boot Key enrollment interface This commit adds the menu-driven UEFI Secure Boot Key enrollment interface. User can enroll PK, KEK, db and dbx by selecting file. Only the signed EFI Signature List(s) with an authenticated header, typically '.auth' file, is accepted. To clear the PK, KEK, db and dbx, user needs to enroll the null key signed by PK or KEK. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
21faf4ef |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use protocol interface for file selection EFI_SIMPLE_FILE_SYSTEM_PROTOCOL is not always provided by U-Boot. Use protocol interface functions instead of U-Boot internal functions. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d6566113 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose eficonfig_create_device_path() Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use eficonfig_create_device_path() to construct the full device path from device path of the volume and file path, so move it out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d571f9b2 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation All the eficonfig menus other than "Change Boot Order" use 'eficonfig_entry' structure for each menu entry. This commit refactors change boot order implementation to use 'eficonfig_entry' structure same as other menus to have consistent menu handling. This commit also simplifies the data->active handling when KEY_SPACE is pressed, and sizeof() parameter. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
8961e93e |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose append entry function Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use append_entry() and append_quit_entry() to construct the menu, so move them out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
a84040ab |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor file selection handling eficonfig_select_file_handler() is commonly used to select the file. eficonfig_display_select_file_option() adds an additional menu to clear the selected file. eficonfig_display_select_file_option() is not always necessary for the file selection process, so it must be outside of eficonfig_select_file_handler(). This commit also renames the following functions to avoid confusion. eficonfig_select_file_handler() -> eficonfig_process_select_file() eficonfig_select_file() -> eficonfig_show_file_selection() eficonfig_display_select_file_option() -> eficonfig_process_show_file_option() Finally, test_eficonfig.py need to be updated to get aligned with the above modification. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
1167e88a |
|
14-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix missing variable initialization The 'ret' variable must be initialized before use in eficonfig_delete_invalid_boot_option(). Fixes: c416f1c0bc ("bootmenu: add removable media entries") Addresses-Coverity: 376207 ("Uninitialized variables") Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
3d595ac5 |
|
09-Nov-2022 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: remove superfluous if in eficonfig_edit_boot_option Goto for an immediately succeeding label is superfluous. Fixes: 87d791423ac6 ("eficonfig: menu-driven addition of UEFI boot option") Addresses-Coverity: 376202 ("Identical code for different branches") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
64658007 |
|
17-Nov-2023 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: eficonfig: create shortened boot options The boot options created by eficonfig should use shortened device-paths to avoid problems if drives are enumerated in a different sequence. Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
9945bc4f |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Fix incorrect return code of boot option update Correct the return code for out-of-memory and no boot option found Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
339b527b |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Move bootorder and bootoption apis to lib Rename and move bootorder and bootoption apis from cmd to lib for re-use between eficonfig and bootmgr Fix 'unexpected indentation' when 'make htmldocs' after functions are moved Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
2c0b0c31 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_SECURE_BOOT This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_SECURE_BOOT defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
83f3d121 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_MM_COMM_TEE This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_MM_COMM_TEE defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
88df3634 |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: CTRL+S to save the boot order 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>
|
#
45f5319f |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
menu: remove CTRL+C to quit On the sandbox called without "--terminal raw" CTRL+C leaves U-Boot, "ESC/CTRL+C to quit" is misleading. Let's remove CTRL+C to quit key handling from bootmenu and eficonfig menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
|
#
8dbd0a0f |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add vertical scroll support The current eficonfig menu does not support vertical scroll, so it can not display the menu entries greater than the console row size. This commit add the vertial scroll support. The console size is retrieved by SIMPLE_TEXT_OUTPUT_PROTOCOL.QueryMode() service, then calculates the row size for menu entry by subtracting menu header and description row size from the console row size. "start" and "end" are added in the efimenu structure. "start" keeps the menu entry index at the top, "end" keeps the bottom menu entry index. item_data_print() menu function only draws the menu entry between "start" and "end". This commit also fixes the issue that "Save" and "Quit" entries can be moved by BKEY_PLUS in change boot order menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
0d590852 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation This commit removes the change boot order specific menu implementation. The change boot order implementation calls eficonfig_process_common() same as other menus. The change boot order menu requires own item_data_print and item_choice implementation, but display_statusline function can be a same function as other menus. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
cd160b27 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor eficonfig_process_common function Current change boot order implementation does not call eficonfig_process_common() and call own menu functions for display_statusline, item_data_print and item_choice. Change boot order functionality should call eficonfig_process_common() to improve maintenanceability. This commit is a preparation to remove the change boot order specific implementation. The menu functions (display_statusline, item_data_print and item_choice) are added as argument of eficonfig_process_common(). The menu description string displayed at the bottom of the menu is also added as argument. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
32bab0ea |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Make use of CLI character processing Avoid duplicating some of the escape-sequence processing here and use the CLI function instead. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
d0ca98db |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Update bootmenu_loop() to return the code Use the return value to save having to pass around a pointer. This also resolves any ambiguity about what *key contains when the function is called. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
2da4a15e |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Rename KEY_... to BKEY_... This enum values conflict with linux/input.h so rename them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
64550274 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: avoid SetVariable between GetNextVariableName calls The current code calls efi_set_variable_int() to delete the invalid boot option between calls to efi_get_next_variable_name_int(), it may produce unpredictable results. This commit moves removal of the invalid boot option outside of the efi_get_next_variable_name_int() calls. EFI_NOT_FOUND returned from efi_get_next_variable_name_int() indicates we retrieved all EFI variables, it should be treated as EFI_SUCEESS. To address the checkpatch warning of too many leading tabs, combine two if statement into one. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
ce327084 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: carve out efi_get_next_variable_name_int calls To retrieve the EFI variable name by efi_get_next_variable_name_int(), the sequence of alloc -> efi_get_next_variable_name_int -> realloc -> efi_get_next_variable_name_int is required. In current code, this sequence repeatedly appears in the several functions. It should be curved out a common function. This commit also fixes the missing free() of var_name16 in eficonfig_delete_invalid_boot_option(). Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
140a8959 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use efi_get_next_variable_name_int() eficonfig command reads all possible UEFI load options from 0x0000 to 0xFFFF to construct the menu. This takes too much time in some environment. This commit uses efi_get_next_variable_name_int() to read all existing UEFI load options to significantlly reduce the count of efi_get_var() call. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
78b1ccc4 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use u16_strsize() to get u16 string buffer size Use u16_strsize() to simplify the u16 string buffer size calculation. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c67d3c9e |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix going one directory up issue The directory name in eficonfig menu entry contains the '\' separator. strcmp() argument ".." is wrong and one directory up handling does not work correctly. strcmp() argument must include '\' separator. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c3b5af63 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add UEFI Secure Boot Key enrollment interface This commit adds the menu-driven UEFI Secure Boot Key enrollment interface. User can enroll PK, KEK, db and dbx by selecting file. Only the signed EFI Signature List(s) with an authenticated header, typically '.auth' file, is accepted. To clear the PK, KEK, db and dbx, user needs to enroll the null key signed by PK or KEK. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
21faf4ef |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use protocol interface for file selection EFI_SIMPLE_FILE_SYSTEM_PROTOCOL is not always provided by U-Boot. Use protocol interface functions instead of U-Boot internal functions. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d6566113 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose eficonfig_create_device_path() Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use eficonfig_create_device_path() to construct the full device path from device path of the volume and file path, so move it out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d571f9b2 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation All the eficonfig menus other than "Change Boot Order" use 'eficonfig_entry' structure for each menu entry. This commit refactors change boot order implementation to use 'eficonfig_entry' structure same as other menus to have consistent menu handling. This commit also simplifies the data->active handling when KEY_SPACE is pressed, and sizeof() parameter. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
8961e93e |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose append entry function Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use append_entry() and append_quit_entry() to construct the menu, so move them out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
a84040ab |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor file selection handling eficonfig_select_file_handler() is commonly used to select the file. eficonfig_display_select_file_option() adds an additional menu to clear the selected file. eficonfig_display_select_file_option() is not always necessary for the file selection process, so it must be outside of eficonfig_select_file_handler(). This commit also renames the following functions to avoid confusion. eficonfig_select_file_handler() -> eficonfig_process_select_file() eficonfig_select_file() -> eficonfig_show_file_selection() eficonfig_display_select_file_option() -> eficonfig_process_show_file_option() Finally, test_eficonfig.py need to be updated to get aligned with the above modification. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
1167e88a |
|
14-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix missing variable initialization The 'ret' variable must be initialized before use in eficonfig_delete_invalid_boot_option(). Fixes: c416f1c0bc ("bootmenu: add removable media entries") Addresses-Coverity: 376207 ("Uninitialized variables") Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
3d595ac5 |
|
09-Nov-2022 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: remove superfluous if in eficonfig_edit_boot_option Goto for an immediately succeeding label is superfluous. Fixes: 87d791423ac6 ("eficonfig: menu-driven addition of UEFI boot option") Addresses-Coverity: 376202 ("Identical code for different branches") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
64658007 |
|
17-Nov-2023 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: eficonfig: create shortened boot options The boot options created by eficonfig should use shortened device-paths to avoid problems if drives are enumerated in a different sequence. Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
9945bc4f |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Fix incorrect return code of boot option update Correct the return code for out-of-memory and no boot option found Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
339b527b |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Move bootorder and bootoption apis to lib Rename and move bootorder and bootoption apis from cmd to lib for re-use between eficonfig and bootmgr Fix 'unexpected indentation' when 'make htmldocs' after functions are moved Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
2c0b0c31 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_SECURE_BOOT This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_SECURE_BOOT defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
83f3d121 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_MM_COMM_TEE This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_MM_COMM_TEE defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
88df3634 |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: CTRL+S to save the boot order 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>
|
#
45f5319f |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
menu: remove CTRL+C to quit On the sandbox called without "--terminal raw" CTRL+C leaves U-Boot, "ESC/CTRL+C to quit" is misleading. Let's remove CTRL+C to quit key handling from bootmenu and eficonfig menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
|
#
8dbd0a0f |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add vertical scroll support The current eficonfig menu does not support vertical scroll, so it can not display the menu entries greater than the console row size. This commit add the vertial scroll support. The console size is retrieved by SIMPLE_TEXT_OUTPUT_PROTOCOL.QueryMode() service, then calculates the row size for menu entry by subtracting menu header and description row size from the console row size. "start" and "end" are added in the efimenu structure. "start" keeps the menu entry index at the top, "end" keeps the bottom menu entry index. item_data_print() menu function only draws the menu entry between "start" and "end". This commit also fixes the issue that "Save" and "Quit" entries can be moved by BKEY_PLUS in change boot order menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
0d590852 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation This commit removes the change boot order specific menu implementation. The change boot order implementation calls eficonfig_process_common() same as other menus. The change boot order menu requires own item_data_print and item_choice implementation, but display_statusline function can be a same function as other menus. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
cd160b27 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor eficonfig_process_common function Current change boot order implementation does not call eficonfig_process_common() and call own menu functions for display_statusline, item_data_print and item_choice. Change boot order functionality should call eficonfig_process_common() to improve maintenanceability. This commit is a preparation to remove the change boot order specific implementation. The menu functions (display_statusline, item_data_print and item_choice) are added as argument of eficonfig_process_common(). The menu description string displayed at the bottom of the menu is also added as argument. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
32bab0ea |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Make use of CLI character processing Avoid duplicating some of the escape-sequence processing here and use the CLI function instead. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
d0ca98db |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Update bootmenu_loop() to return the code Use the return value to save having to pass around a pointer. This also resolves any ambiguity about what *key contains when the function is called. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
2da4a15e |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Rename KEY_... to BKEY_... This enum values conflict with linux/input.h so rename them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
64550274 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: avoid SetVariable between GetNextVariableName calls The current code calls efi_set_variable_int() to delete the invalid boot option between calls to efi_get_next_variable_name_int(), it may produce unpredictable results. This commit moves removal of the invalid boot option outside of the efi_get_next_variable_name_int() calls. EFI_NOT_FOUND returned from efi_get_next_variable_name_int() indicates we retrieved all EFI variables, it should be treated as EFI_SUCEESS. To address the checkpatch warning of too many leading tabs, combine two if statement into one. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
ce327084 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: carve out efi_get_next_variable_name_int calls To retrieve the EFI variable name by efi_get_next_variable_name_int(), the sequence of alloc -> efi_get_next_variable_name_int -> realloc -> efi_get_next_variable_name_int is required. In current code, this sequence repeatedly appears in the several functions. It should be curved out a common function. This commit also fixes the missing free() of var_name16 in eficonfig_delete_invalid_boot_option(). Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
140a8959 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use efi_get_next_variable_name_int() eficonfig command reads all possible UEFI load options from 0x0000 to 0xFFFF to construct the menu. This takes too much time in some environment. This commit uses efi_get_next_variable_name_int() to read all existing UEFI load options to significantlly reduce the count of efi_get_var() call. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
78b1ccc4 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use u16_strsize() to get u16 string buffer size Use u16_strsize() to simplify the u16 string buffer size calculation. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c67d3c9e |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix going one directory up issue The directory name in eficonfig menu entry contains the '\' separator. strcmp() argument ".." is wrong and one directory up handling does not work correctly. strcmp() argument must include '\' separator. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c3b5af63 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add UEFI Secure Boot Key enrollment interface This commit adds the menu-driven UEFI Secure Boot Key enrollment interface. User can enroll PK, KEK, db and dbx by selecting file. Only the signed EFI Signature List(s) with an authenticated header, typically '.auth' file, is accepted. To clear the PK, KEK, db and dbx, user needs to enroll the null key signed by PK or KEK. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
21faf4ef |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use protocol interface for file selection EFI_SIMPLE_FILE_SYSTEM_PROTOCOL is not always provided by U-Boot. Use protocol interface functions instead of U-Boot internal functions. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d6566113 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose eficonfig_create_device_path() Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use eficonfig_create_device_path() to construct the full device path from device path of the volume and file path, so move it out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d571f9b2 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation All the eficonfig menus other than "Change Boot Order" use 'eficonfig_entry' structure for each menu entry. This commit refactors change boot order implementation to use 'eficonfig_entry' structure same as other menus to have consistent menu handling. This commit also simplifies the data->active handling when KEY_SPACE is pressed, and sizeof() parameter. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
8961e93e |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose append entry function Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use append_entry() and append_quit_entry() to construct the menu, so move them out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
a84040ab |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor file selection handling eficonfig_select_file_handler() is commonly used to select the file. eficonfig_display_select_file_option() adds an additional menu to clear the selected file. eficonfig_display_select_file_option() is not always necessary for the file selection process, so it must be outside of eficonfig_select_file_handler(). This commit also renames the following functions to avoid confusion. eficonfig_select_file_handler() -> eficonfig_process_select_file() eficonfig_select_file() -> eficonfig_show_file_selection() eficonfig_display_select_file_option() -> eficonfig_process_show_file_option() Finally, test_eficonfig.py need to be updated to get aligned with the above modification. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
1167e88a |
|
14-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix missing variable initialization The 'ret' variable must be initialized before use in eficonfig_delete_invalid_boot_option(). Fixes: c416f1c0bc ("bootmenu: add removable media entries") Addresses-Coverity: 376207 ("Uninitialized variables") Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
3d595ac5 |
|
09-Nov-2022 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: remove superfluous if in eficonfig_edit_boot_option Goto for an immediately succeeding label is superfluous. Fixes: 87d791423ac6 ("eficonfig: menu-driven addition of UEFI boot option") Addresses-Coverity: 376202 ("Identical code for different branches") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
64658007 |
|
17-Nov-2023 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: eficonfig: create shortened boot options The boot options created by eficonfig should use shortened device-paths to avoid problems if drives are enumerated in a different sequence. Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
9945bc4f |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Fix incorrect return code of boot option update Correct the return code for out-of-memory and no boot option found Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
339b527b |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Move bootorder and bootoption apis to lib Rename and move bootorder and bootoption apis from cmd to lib for re-use between eficonfig and bootmgr Fix 'unexpected indentation' when 'make htmldocs' after functions are moved Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
2c0b0c31 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_SECURE_BOOT This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_SECURE_BOOT defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
83f3d121 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_MM_COMM_TEE This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_MM_COMM_TEE defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
88df3634 |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: CTRL+S to save the boot order 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>
|
#
45f5319f |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
menu: remove CTRL+C to quit On the sandbox called without "--terminal raw" CTRL+C leaves U-Boot, "ESC/CTRL+C to quit" is misleading. Let's remove CTRL+C to quit key handling from bootmenu and eficonfig menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
|
#
8dbd0a0f |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add vertical scroll support The current eficonfig menu does not support vertical scroll, so it can not display the menu entries greater than the console row size. This commit add the vertial scroll support. The console size is retrieved by SIMPLE_TEXT_OUTPUT_PROTOCOL.QueryMode() service, then calculates the row size for menu entry by subtracting menu header and description row size from the console row size. "start" and "end" are added in the efimenu structure. "start" keeps the menu entry index at the top, "end" keeps the bottom menu entry index. item_data_print() menu function only draws the menu entry between "start" and "end". This commit also fixes the issue that "Save" and "Quit" entries can be moved by BKEY_PLUS in change boot order menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
0d590852 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation This commit removes the change boot order specific menu implementation. The change boot order implementation calls eficonfig_process_common() same as other menus. The change boot order menu requires own item_data_print and item_choice implementation, but display_statusline function can be a same function as other menus. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
cd160b27 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor eficonfig_process_common function Current change boot order implementation does not call eficonfig_process_common() and call own menu functions for display_statusline, item_data_print and item_choice. Change boot order functionality should call eficonfig_process_common() to improve maintenanceability. This commit is a preparation to remove the change boot order specific implementation. The menu functions (display_statusline, item_data_print and item_choice) are added as argument of eficonfig_process_common(). The menu description string displayed at the bottom of the menu is also added as argument. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
32bab0ea |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Make use of CLI character processing Avoid duplicating some of the escape-sequence processing here and use the CLI function instead. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
d0ca98db |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Update bootmenu_loop() to return the code Use the return value to save having to pass around a pointer. This also resolves any ambiguity about what *key contains when the function is called. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
2da4a15e |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Rename KEY_... to BKEY_... This enum values conflict with linux/input.h so rename them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
64550274 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: avoid SetVariable between GetNextVariableName calls The current code calls efi_set_variable_int() to delete the invalid boot option between calls to efi_get_next_variable_name_int(), it may produce unpredictable results. This commit moves removal of the invalid boot option outside of the efi_get_next_variable_name_int() calls. EFI_NOT_FOUND returned from efi_get_next_variable_name_int() indicates we retrieved all EFI variables, it should be treated as EFI_SUCEESS. To address the checkpatch warning of too many leading tabs, combine two if statement into one. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
ce327084 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: carve out efi_get_next_variable_name_int calls To retrieve the EFI variable name by efi_get_next_variable_name_int(), the sequence of alloc -> efi_get_next_variable_name_int -> realloc -> efi_get_next_variable_name_int is required. In current code, this sequence repeatedly appears in the several functions. It should be curved out a common function. This commit also fixes the missing free() of var_name16 in eficonfig_delete_invalid_boot_option(). Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
140a8959 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use efi_get_next_variable_name_int() eficonfig command reads all possible UEFI load options from 0x0000 to 0xFFFF to construct the menu. This takes too much time in some environment. This commit uses efi_get_next_variable_name_int() to read all existing UEFI load options to significantlly reduce the count of efi_get_var() call. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
78b1ccc4 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use u16_strsize() to get u16 string buffer size Use u16_strsize() to simplify the u16 string buffer size calculation. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c67d3c9e |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix going one directory up issue The directory name in eficonfig menu entry contains the '\' separator. strcmp() argument ".." is wrong and one directory up handling does not work correctly. strcmp() argument must include '\' separator. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c3b5af63 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add UEFI Secure Boot Key enrollment interface This commit adds the menu-driven UEFI Secure Boot Key enrollment interface. User can enroll PK, KEK, db and dbx by selecting file. Only the signed EFI Signature List(s) with an authenticated header, typically '.auth' file, is accepted. To clear the PK, KEK, db and dbx, user needs to enroll the null key signed by PK or KEK. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
21faf4ef |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use protocol interface for file selection EFI_SIMPLE_FILE_SYSTEM_PROTOCOL is not always provided by U-Boot. Use protocol interface functions instead of U-Boot internal functions. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d6566113 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose eficonfig_create_device_path() Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use eficonfig_create_device_path() to construct the full device path from device path of the volume and file path, so move it out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d571f9b2 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation All the eficonfig menus other than "Change Boot Order" use 'eficonfig_entry' structure for each menu entry. This commit refactors change boot order implementation to use 'eficonfig_entry' structure same as other menus to have consistent menu handling. This commit also simplifies the data->active handling when KEY_SPACE is pressed, and sizeof() parameter. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
8961e93e |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose append entry function Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use append_entry() and append_quit_entry() to construct the menu, so move them out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
a84040ab |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor file selection handling eficonfig_select_file_handler() is commonly used to select the file. eficonfig_display_select_file_option() adds an additional menu to clear the selected file. eficonfig_display_select_file_option() is not always necessary for the file selection process, so it must be outside of eficonfig_select_file_handler(). This commit also renames the following functions to avoid confusion. eficonfig_select_file_handler() -> eficonfig_process_select_file() eficonfig_select_file() -> eficonfig_show_file_selection() eficonfig_display_select_file_option() -> eficonfig_process_show_file_option() Finally, test_eficonfig.py need to be updated to get aligned with the above modification. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
1167e88a |
|
14-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix missing variable initialization The 'ret' variable must be initialized before use in eficonfig_delete_invalid_boot_option(). Fixes: c416f1c0bc ("bootmenu: add removable media entries") Addresses-Coverity: 376207 ("Uninitialized variables") Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
3d595ac5 |
|
09-Nov-2022 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: remove superfluous if in eficonfig_edit_boot_option Goto for an immediately succeeding label is superfluous. Fixes: 87d791423ac6 ("eficonfig: menu-driven addition of UEFI boot option") Addresses-Coverity: 376202 ("Identical code for different branches") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
64658007 |
|
17-Nov-2023 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: eficonfig: create shortened boot options The boot options created by eficonfig should use shortened device-paths to avoid problems if drives are enumerated in a different sequence. Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
9945bc4f |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Fix incorrect return code of boot option update Correct the return code for out-of-memory and no boot option found Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
339b527b |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Move bootorder and bootoption apis to lib Rename and move bootorder and bootoption apis from cmd to lib for re-use between eficonfig and bootmgr Fix 'unexpected indentation' when 'make htmldocs' after functions are moved Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
2c0b0c31 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_SECURE_BOOT This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_SECURE_BOOT defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
83f3d121 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_MM_COMM_TEE This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_MM_COMM_TEE defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
88df3634 |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: CTRL+S to save the boot order 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>
|
#
45f5319f |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
menu: remove CTRL+C to quit On the sandbox called without "--terminal raw" CTRL+C leaves U-Boot, "ESC/CTRL+C to quit" is misleading. Let's remove CTRL+C to quit key handling from bootmenu and eficonfig menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
|
#
8dbd0a0f |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add vertical scroll support The current eficonfig menu does not support vertical scroll, so it can not display the menu entries greater than the console row size. This commit add the vertial scroll support. The console size is retrieved by SIMPLE_TEXT_OUTPUT_PROTOCOL.QueryMode() service, then calculates the row size for menu entry by subtracting menu header and description row size from the console row size. "start" and "end" are added in the efimenu structure. "start" keeps the menu entry index at the top, "end" keeps the bottom menu entry index. item_data_print() menu function only draws the menu entry between "start" and "end". This commit also fixes the issue that "Save" and "Quit" entries can be moved by BKEY_PLUS in change boot order menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
0d590852 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation This commit removes the change boot order specific menu implementation. The change boot order implementation calls eficonfig_process_common() same as other menus. The change boot order menu requires own item_data_print and item_choice implementation, but display_statusline function can be a same function as other menus. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
cd160b27 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor eficonfig_process_common function Current change boot order implementation does not call eficonfig_process_common() and call own menu functions for display_statusline, item_data_print and item_choice. Change boot order functionality should call eficonfig_process_common() to improve maintenanceability. This commit is a preparation to remove the change boot order specific implementation. The menu functions (display_statusline, item_data_print and item_choice) are added as argument of eficonfig_process_common(). The menu description string displayed at the bottom of the menu is also added as argument. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
32bab0ea |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Make use of CLI character processing Avoid duplicating some of the escape-sequence processing here and use the CLI function instead. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
d0ca98db |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Update bootmenu_loop() to return the code Use the return value to save having to pass around a pointer. This also resolves any ambiguity about what *key contains when the function is called. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
2da4a15e |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Rename KEY_... to BKEY_... This enum values conflict with linux/input.h so rename them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
64550274 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: avoid SetVariable between GetNextVariableName calls The current code calls efi_set_variable_int() to delete the invalid boot option between calls to efi_get_next_variable_name_int(), it may produce unpredictable results. This commit moves removal of the invalid boot option outside of the efi_get_next_variable_name_int() calls. EFI_NOT_FOUND returned from efi_get_next_variable_name_int() indicates we retrieved all EFI variables, it should be treated as EFI_SUCEESS. To address the checkpatch warning of too many leading tabs, combine two if statement into one. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
ce327084 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: carve out efi_get_next_variable_name_int calls To retrieve the EFI variable name by efi_get_next_variable_name_int(), the sequence of alloc -> efi_get_next_variable_name_int -> realloc -> efi_get_next_variable_name_int is required. In current code, this sequence repeatedly appears in the several functions. It should be curved out a common function. This commit also fixes the missing free() of var_name16 in eficonfig_delete_invalid_boot_option(). Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
140a8959 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use efi_get_next_variable_name_int() eficonfig command reads all possible UEFI load options from 0x0000 to 0xFFFF to construct the menu. This takes too much time in some environment. This commit uses efi_get_next_variable_name_int() to read all existing UEFI load options to significantlly reduce the count of efi_get_var() call. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
78b1ccc4 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use u16_strsize() to get u16 string buffer size Use u16_strsize() to simplify the u16 string buffer size calculation. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c67d3c9e |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix going one directory up issue The directory name in eficonfig menu entry contains the '\' separator. strcmp() argument ".." is wrong and one directory up handling does not work correctly. strcmp() argument must include '\' separator. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c3b5af63 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add UEFI Secure Boot Key enrollment interface This commit adds the menu-driven UEFI Secure Boot Key enrollment interface. User can enroll PK, KEK, db and dbx by selecting file. Only the signed EFI Signature List(s) with an authenticated header, typically '.auth' file, is accepted. To clear the PK, KEK, db and dbx, user needs to enroll the null key signed by PK or KEK. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
21faf4ef |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use protocol interface for file selection EFI_SIMPLE_FILE_SYSTEM_PROTOCOL is not always provided by U-Boot. Use protocol interface functions instead of U-Boot internal functions. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d6566113 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose eficonfig_create_device_path() Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use eficonfig_create_device_path() to construct the full device path from device path of the volume and file path, so move it out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d571f9b2 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation All the eficonfig menus other than "Change Boot Order" use 'eficonfig_entry' structure for each menu entry. This commit refactors change boot order implementation to use 'eficonfig_entry' structure same as other menus to have consistent menu handling. This commit also simplifies the data->active handling when KEY_SPACE is pressed, and sizeof() parameter. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
8961e93e |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose append entry function Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use append_entry() and append_quit_entry() to construct the menu, so move them out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
a84040ab |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor file selection handling eficonfig_select_file_handler() is commonly used to select the file. eficonfig_display_select_file_option() adds an additional menu to clear the selected file. eficonfig_display_select_file_option() is not always necessary for the file selection process, so it must be outside of eficonfig_select_file_handler(). This commit also renames the following functions to avoid confusion. eficonfig_select_file_handler() -> eficonfig_process_select_file() eficonfig_select_file() -> eficonfig_show_file_selection() eficonfig_display_select_file_option() -> eficonfig_process_show_file_option() Finally, test_eficonfig.py need to be updated to get aligned with the above modification. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
1167e88a |
|
14-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix missing variable initialization The 'ret' variable must be initialized before use in eficonfig_delete_invalid_boot_option(). Fixes: c416f1c0bc ("bootmenu: add removable media entries") Addresses-Coverity: 376207 ("Uninitialized variables") Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
3d595ac5 |
|
09-Nov-2022 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: remove superfluous if in eficonfig_edit_boot_option Goto for an immediately succeeding label is superfluous. Fixes: 87d791423ac6 ("eficonfig: menu-driven addition of UEFI boot option") Addresses-Coverity: 376202 ("Identical code for different branches") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
64658007 |
|
17-Nov-2023 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: eficonfig: create shortened boot options The boot options created by eficonfig should use shortened device-paths to avoid problems if drives are enumerated in a different sequence. Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
9945bc4f |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Fix incorrect return code of boot option update Correct the return code for out-of-memory and no boot option found Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
339b527b |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Move bootorder and bootoption apis to lib Rename and move bootorder and bootoption apis from cmd to lib for re-use between eficonfig and bootmgr Fix 'unexpected indentation' when 'make htmldocs' after functions are moved Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
2c0b0c31 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_SECURE_BOOT This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_SECURE_BOOT defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
83f3d121 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_MM_COMM_TEE This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_MM_COMM_TEE defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
88df3634 |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: CTRL+S to save the boot order 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>
|
#
45f5319f |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
menu: remove CTRL+C to quit On the sandbox called without "--terminal raw" CTRL+C leaves U-Boot, "ESC/CTRL+C to quit" is misleading. Let's remove CTRL+C to quit key handling from bootmenu and eficonfig menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
|
#
8dbd0a0f |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add vertical scroll support The current eficonfig menu does not support vertical scroll, so it can not display the menu entries greater than the console row size. This commit add the vertial scroll support. The console size is retrieved by SIMPLE_TEXT_OUTPUT_PROTOCOL.QueryMode() service, then calculates the row size for menu entry by subtracting menu header and description row size from the console row size. "start" and "end" are added in the efimenu structure. "start" keeps the menu entry index at the top, "end" keeps the bottom menu entry index. item_data_print() menu function only draws the menu entry between "start" and "end". This commit also fixes the issue that "Save" and "Quit" entries can be moved by BKEY_PLUS in change boot order menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
0d590852 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation This commit removes the change boot order specific menu implementation. The change boot order implementation calls eficonfig_process_common() same as other menus. The change boot order menu requires own item_data_print and item_choice implementation, but display_statusline function can be a same function as other menus. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
cd160b27 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor eficonfig_process_common function Current change boot order implementation does not call eficonfig_process_common() and call own menu functions for display_statusline, item_data_print and item_choice. Change boot order functionality should call eficonfig_process_common() to improve maintenanceability. This commit is a preparation to remove the change boot order specific implementation. The menu functions (display_statusline, item_data_print and item_choice) are added as argument of eficonfig_process_common(). The menu description string displayed at the bottom of the menu is also added as argument. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
32bab0ea |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Make use of CLI character processing Avoid duplicating some of the escape-sequence processing here and use the CLI function instead. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
d0ca98db |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Update bootmenu_loop() to return the code Use the return value to save having to pass around a pointer. This also resolves any ambiguity about what *key contains when the function is called. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
2da4a15e |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Rename KEY_... to BKEY_... This enum values conflict with linux/input.h so rename them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
64550274 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: avoid SetVariable between GetNextVariableName calls The current code calls efi_set_variable_int() to delete the invalid boot option between calls to efi_get_next_variable_name_int(), it may produce unpredictable results. This commit moves removal of the invalid boot option outside of the efi_get_next_variable_name_int() calls. EFI_NOT_FOUND returned from efi_get_next_variable_name_int() indicates we retrieved all EFI variables, it should be treated as EFI_SUCEESS. To address the checkpatch warning of too many leading tabs, combine two if statement into one. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
ce327084 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: carve out efi_get_next_variable_name_int calls To retrieve the EFI variable name by efi_get_next_variable_name_int(), the sequence of alloc -> efi_get_next_variable_name_int -> realloc -> efi_get_next_variable_name_int is required. In current code, this sequence repeatedly appears in the several functions. It should be curved out a common function. This commit also fixes the missing free() of var_name16 in eficonfig_delete_invalid_boot_option(). Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
140a8959 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use efi_get_next_variable_name_int() eficonfig command reads all possible UEFI load options from 0x0000 to 0xFFFF to construct the menu. This takes too much time in some environment. This commit uses efi_get_next_variable_name_int() to read all existing UEFI load options to significantlly reduce the count of efi_get_var() call. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
78b1ccc4 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use u16_strsize() to get u16 string buffer size Use u16_strsize() to simplify the u16 string buffer size calculation. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c67d3c9e |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix going one directory up issue The directory name in eficonfig menu entry contains the '\' separator. strcmp() argument ".." is wrong and one directory up handling does not work correctly. strcmp() argument must include '\' separator. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c3b5af63 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add UEFI Secure Boot Key enrollment interface This commit adds the menu-driven UEFI Secure Boot Key enrollment interface. User can enroll PK, KEK, db and dbx by selecting file. Only the signed EFI Signature List(s) with an authenticated header, typically '.auth' file, is accepted. To clear the PK, KEK, db and dbx, user needs to enroll the null key signed by PK or KEK. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
21faf4ef |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use protocol interface for file selection EFI_SIMPLE_FILE_SYSTEM_PROTOCOL is not always provided by U-Boot. Use protocol interface functions instead of U-Boot internal functions. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d6566113 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose eficonfig_create_device_path() Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use eficonfig_create_device_path() to construct the full device path from device path of the volume and file path, so move it out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d571f9b2 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation All the eficonfig menus other than "Change Boot Order" use 'eficonfig_entry' structure for each menu entry. This commit refactors change boot order implementation to use 'eficonfig_entry' structure same as other menus to have consistent menu handling. This commit also simplifies the data->active handling when KEY_SPACE is pressed, and sizeof() parameter. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
8961e93e |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose append entry function Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use append_entry() and append_quit_entry() to construct the menu, so move them out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
a84040ab |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor file selection handling eficonfig_select_file_handler() is commonly used to select the file. eficonfig_display_select_file_option() adds an additional menu to clear the selected file. eficonfig_display_select_file_option() is not always necessary for the file selection process, so it must be outside of eficonfig_select_file_handler(). This commit also renames the following functions to avoid confusion. eficonfig_select_file_handler() -> eficonfig_process_select_file() eficonfig_select_file() -> eficonfig_show_file_selection() eficonfig_display_select_file_option() -> eficonfig_process_show_file_option() Finally, test_eficonfig.py need to be updated to get aligned with the above modification. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
1167e88a |
|
14-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix missing variable initialization The 'ret' variable must be initialized before use in eficonfig_delete_invalid_boot_option(). Fixes: c416f1c0bc ("bootmenu: add removable media entries") Addresses-Coverity: 376207 ("Uninitialized variables") Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
3d595ac5 |
|
09-Nov-2022 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: remove superfluous if in eficonfig_edit_boot_option Goto for an immediately succeeding label is superfluous. Fixes: 87d791423ac6 ("eficonfig: menu-driven addition of UEFI boot option") Addresses-Coverity: 376202 ("Identical code for different branches") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
64658007 |
|
17-Nov-2023 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: eficonfig: create shortened boot options The boot options created by eficonfig should use shortened device-paths to avoid problems if drives are enumerated in a different sequence. Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
9945bc4f |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Fix incorrect return code of boot option update Correct the return code for out-of-memory and no boot option found Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
339b527b |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Move bootorder and bootoption apis to lib Rename and move bootorder and bootoption apis from cmd to lib for re-use between eficonfig and bootmgr Fix 'unexpected indentation' when 'make htmldocs' after functions are moved Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
2c0b0c31 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_SECURE_BOOT This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_SECURE_BOOT defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
83f3d121 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_MM_COMM_TEE This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_MM_COMM_TEE defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
88df3634 |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: CTRL+S to save the boot order 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>
|
#
45f5319f |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
menu: remove CTRL+C to quit On the sandbox called without "--terminal raw" CTRL+C leaves U-Boot, "ESC/CTRL+C to quit" is misleading. Let's remove CTRL+C to quit key handling from bootmenu and eficonfig menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
|
#
8dbd0a0f |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add vertical scroll support The current eficonfig menu does not support vertical scroll, so it can not display the menu entries greater than the console row size. This commit add the vertial scroll support. The console size is retrieved by SIMPLE_TEXT_OUTPUT_PROTOCOL.QueryMode() service, then calculates the row size for menu entry by subtracting menu header and description row size from the console row size. "start" and "end" are added in the efimenu structure. "start" keeps the menu entry index at the top, "end" keeps the bottom menu entry index. item_data_print() menu function only draws the menu entry between "start" and "end". This commit also fixes the issue that "Save" and "Quit" entries can be moved by BKEY_PLUS in change boot order menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
0d590852 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation This commit removes the change boot order specific menu implementation. The change boot order implementation calls eficonfig_process_common() same as other menus. The change boot order menu requires own item_data_print and item_choice implementation, but display_statusline function can be a same function as other menus. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
cd160b27 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor eficonfig_process_common function Current change boot order implementation does not call eficonfig_process_common() and call own menu functions for display_statusline, item_data_print and item_choice. Change boot order functionality should call eficonfig_process_common() to improve maintenanceability. This commit is a preparation to remove the change boot order specific implementation. The menu functions (display_statusline, item_data_print and item_choice) are added as argument of eficonfig_process_common(). The menu description string displayed at the bottom of the menu is also added as argument. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
32bab0ea |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Make use of CLI character processing Avoid duplicating some of the escape-sequence processing here and use the CLI function instead. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
d0ca98db |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Update bootmenu_loop() to return the code Use the return value to save having to pass around a pointer. This also resolves any ambiguity about what *key contains when the function is called. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
2da4a15e |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Rename KEY_... to BKEY_... This enum values conflict with linux/input.h so rename them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
64550274 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: avoid SetVariable between GetNextVariableName calls The current code calls efi_set_variable_int() to delete the invalid boot option between calls to efi_get_next_variable_name_int(), it may produce unpredictable results. This commit moves removal of the invalid boot option outside of the efi_get_next_variable_name_int() calls. EFI_NOT_FOUND returned from efi_get_next_variable_name_int() indicates we retrieved all EFI variables, it should be treated as EFI_SUCEESS. To address the checkpatch warning of too many leading tabs, combine two if statement into one. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
ce327084 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: carve out efi_get_next_variable_name_int calls To retrieve the EFI variable name by efi_get_next_variable_name_int(), the sequence of alloc -> efi_get_next_variable_name_int -> realloc -> efi_get_next_variable_name_int is required. In current code, this sequence repeatedly appears in the several functions. It should be curved out a common function. This commit also fixes the missing free() of var_name16 in eficonfig_delete_invalid_boot_option(). Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
140a8959 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use efi_get_next_variable_name_int() eficonfig command reads all possible UEFI load options from 0x0000 to 0xFFFF to construct the menu. This takes too much time in some environment. This commit uses efi_get_next_variable_name_int() to read all existing UEFI load options to significantlly reduce the count of efi_get_var() call. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
78b1ccc4 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use u16_strsize() to get u16 string buffer size Use u16_strsize() to simplify the u16 string buffer size calculation. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c67d3c9e |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix going one directory up issue The directory name in eficonfig menu entry contains the '\' separator. strcmp() argument ".." is wrong and one directory up handling does not work correctly. strcmp() argument must include '\' separator. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c3b5af63 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add UEFI Secure Boot Key enrollment interface This commit adds the menu-driven UEFI Secure Boot Key enrollment interface. User can enroll PK, KEK, db and dbx by selecting file. Only the signed EFI Signature List(s) with an authenticated header, typically '.auth' file, is accepted. To clear the PK, KEK, db and dbx, user needs to enroll the null key signed by PK or KEK. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
21faf4ef |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use protocol interface for file selection EFI_SIMPLE_FILE_SYSTEM_PROTOCOL is not always provided by U-Boot. Use protocol interface functions instead of U-Boot internal functions. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d6566113 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose eficonfig_create_device_path() Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use eficonfig_create_device_path() to construct the full device path from device path of the volume and file path, so move it out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d571f9b2 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation All the eficonfig menus other than "Change Boot Order" use 'eficonfig_entry' structure for each menu entry. This commit refactors change boot order implementation to use 'eficonfig_entry' structure same as other menus to have consistent menu handling. This commit also simplifies the data->active handling when KEY_SPACE is pressed, and sizeof() parameter. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
8961e93e |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose append entry function Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use append_entry() and append_quit_entry() to construct the menu, so move them out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
a84040ab |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor file selection handling eficonfig_select_file_handler() is commonly used to select the file. eficonfig_display_select_file_option() adds an additional menu to clear the selected file. eficonfig_display_select_file_option() is not always necessary for the file selection process, so it must be outside of eficonfig_select_file_handler(). This commit also renames the following functions to avoid confusion. eficonfig_select_file_handler() -> eficonfig_process_select_file() eficonfig_select_file() -> eficonfig_show_file_selection() eficonfig_display_select_file_option() -> eficonfig_process_show_file_option() Finally, test_eficonfig.py need to be updated to get aligned with the above modification. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
1167e88a |
|
14-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix missing variable initialization The 'ret' variable must be initialized before use in eficonfig_delete_invalid_boot_option(). Fixes: c416f1c0bc ("bootmenu: add removable media entries") Addresses-Coverity: 376207 ("Uninitialized variables") Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
3d595ac5 |
|
09-Nov-2022 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: remove superfluous if in eficonfig_edit_boot_option Goto for an immediately succeeding label is superfluous. Fixes: 87d791423ac6 ("eficonfig: menu-driven addition of UEFI boot option") Addresses-Coverity: 376202 ("Identical code for different branches") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
64658007 |
|
17-Nov-2023 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: eficonfig: create shortened boot options The boot options created by eficonfig should use shortened device-paths to avoid problems if drives are enumerated in a different sequence. Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
9945bc4f |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Fix incorrect return code of boot option update Correct the return code for out-of-memory and no boot option found Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
339b527b |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Move bootorder and bootoption apis to lib Rename and move bootorder and bootoption apis from cmd to lib for re-use between eficonfig and bootmgr Fix 'unexpected indentation' when 'make htmldocs' after functions are moved Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
2c0b0c31 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_SECURE_BOOT This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_SECURE_BOOT defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
83f3d121 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_MM_COMM_TEE This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_MM_COMM_TEE defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
88df3634 |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: CTRL+S to save the boot order 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>
|
#
45f5319f |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
menu: remove CTRL+C to quit On the sandbox called without "--terminal raw" CTRL+C leaves U-Boot, "ESC/CTRL+C to quit" is misleading. Let's remove CTRL+C to quit key handling from bootmenu and eficonfig menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
|
#
8dbd0a0f |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add vertical scroll support The current eficonfig menu does not support vertical scroll, so it can not display the menu entries greater than the console row size. This commit add the vertial scroll support. The console size is retrieved by SIMPLE_TEXT_OUTPUT_PROTOCOL.QueryMode() service, then calculates the row size for menu entry by subtracting menu header and description row size from the console row size. "start" and "end" are added in the efimenu structure. "start" keeps the menu entry index at the top, "end" keeps the bottom menu entry index. item_data_print() menu function only draws the menu entry between "start" and "end". This commit also fixes the issue that "Save" and "Quit" entries can be moved by BKEY_PLUS in change boot order menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
0d590852 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation This commit removes the change boot order specific menu implementation. The change boot order implementation calls eficonfig_process_common() same as other menus. The change boot order menu requires own item_data_print and item_choice implementation, but display_statusline function can be a same function as other menus. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
cd160b27 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor eficonfig_process_common function Current change boot order implementation does not call eficonfig_process_common() and call own menu functions for display_statusline, item_data_print and item_choice. Change boot order functionality should call eficonfig_process_common() to improve maintenanceability. This commit is a preparation to remove the change boot order specific implementation. The menu functions (display_statusline, item_data_print and item_choice) are added as argument of eficonfig_process_common(). The menu description string displayed at the bottom of the menu is also added as argument. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
32bab0ea |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Make use of CLI character processing Avoid duplicating some of the escape-sequence processing here and use the CLI function instead. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
d0ca98db |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Update bootmenu_loop() to return the code Use the return value to save having to pass around a pointer. This also resolves any ambiguity about what *key contains when the function is called. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
2da4a15e |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Rename KEY_... to BKEY_... This enum values conflict with linux/input.h so rename them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
64550274 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: avoid SetVariable between GetNextVariableName calls The current code calls efi_set_variable_int() to delete the invalid boot option between calls to efi_get_next_variable_name_int(), it may produce unpredictable results. This commit moves removal of the invalid boot option outside of the efi_get_next_variable_name_int() calls. EFI_NOT_FOUND returned from efi_get_next_variable_name_int() indicates we retrieved all EFI variables, it should be treated as EFI_SUCEESS. To address the checkpatch warning of too many leading tabs, combine two if statement into one. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
ce327084 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: carve out efi_get_next_variable_name_int calls To retrieve the EFI variable name by efi_get_next_variable_name_int(), the sequence of alloc -> efi_get_next_variable_name_int -> realloc -> efi_get_next_variable_name_int is required. In current code, this sequence repeatedly appears in the several functions. It should be curved out a common function. This commit also fixes the missing free() of var_name16 in eficonfig_delete_invalid_boot_option(). Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
140a8959 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use efi_get_next_variable_name_int() eficonfig command reads all possible UEFI load options from 0x0000 to 0xFFFF to construct the menu. This takes too much time in some environment. This commit uses efi_get_next_variable_name_int() to read all existing UEFI load options to significantlly reduce the count of efi_get_var() call. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
78b1ccc4 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use u16_strsize() to get u16 string buffer size Use u16_strsize() to simplify the u16 string buffer size calculation. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c67d3c9e |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix going one directory up issue The directory name in eficonfig menu entry contains the '\' separator. strcmp() argument ".." is wrong and one directory up handling does not work correctly. strcmp() argument must include '\' separator. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c3b5af63 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add UEFI Secure Boot Key enrollment interface This commit adds the menu-driven UEFI Secure Boot Key enrollment interface. User can enroll PK, KEK, db and dbx by selecting file. Only the signed EFI Signature List(s) with an authenticated header, typically '.auth' file, is accepted. To clear the PK, KEK, db and dbx, user needs to enroll the null key signed by PK or KEK. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
21faf4ef |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use protocol interface for file selection EFI_SIMPLE_FILE_SYSTEM_PROTOCOL is not always provided by U-Boot. Use protocol interface functions instead of U-Boot internal functions. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d6566113 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose eficonfig_create_device_path() Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use eficonfig_create_device_path() to construct the full device path from device path of the volume and file path, so move it out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d571f9b2 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation All the eficonfig menus other than "Change Boot Order" use 'eficonfig_entry' structure for each menu entry. This commit refactors change boot order implementation to use 'eficonfig_entry' structure same as other menus to have consistent menu handling. This commit also simplifies the data->active handling when KEY_SPACE is pressed, and sizeof() parameter. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
8961e93e |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose append entry function Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use append_entry() and append_quit_entry() to construct the menu, so move them out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
a84040ab |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor file selection handling eficonfig_select_file_handler() is commonly used to select the file. eficonfig_display_select_file_option() adds an additional menu to clear the selected file. eficonfig_display_select_file_option() is not always necessary for the file selection process, so it must be outside of eficonfig_select_file_handler(). This commit also renames the following functions to avoid confusion. eficonfig_select_file_handler() -> eficonfig_process_select_file() eficonfig_select_file() -> eficonfig_show_file_selection() eficonfig_display_select_file_option() -> eficonfig_process_show_file_option() Finally, test_eficonfig.py need to be updated to get aligned with the above modification. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
1167e88a |
|
14-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix missing variable initialization The 'ret' variable must be initialized before use in eficonfig_delete_invalid_boot_option(). Fixes: c416f1c0bc ("bootmenu: add removable media entries") Addresses-Coverity: 376207 ("Uninitialized variables") Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
3d595ac5 |
|
09-Nov-2022 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: remove superfluous if in eficonfig_edit_boot_option Goto for an immediately succeeding label is superfluous. Fixes: 87d791423ac6 ("eficonfig: menu-driven addition of UEFI boot option") Addresses-Coverity: 376202 ("Identical code for different branches") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
64658007 |
|
17-Nov-2023 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: eficonfig: create shortened boot options The boot options created by eficonfig should use shortened device-paths to avoid problems if drives are enumerated in a different sequence. Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
9945bc4f |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Fix incorrect return code of boot option update Correct the return code for out-of-memory and no boot option found Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
339b527b |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Move bootorder and bootoption apis to lib Rename and move bootorder and bootoption apis from cmd to lib for re-use between eficonfig and bootmgr Fix 'unexpected indentation' when 'make htmldocs' after functions are moved Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
2c0b0c31 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_SECURE_BOOT This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_SECURE_BOOT defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
83f3d121 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_MM_COMM_TEE This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_MM_COMM_TEE defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
88df3634 |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: CTRL+S to save the boot order 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>
|
#
45f5319f |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
menu: remove CTRL+C to quit On the sandbox called without "--terminal raw" CTRL+C leaves U-Boot, "ESC/CTRL+C to quit" is misleading. Let's remove CTRL+C to quit key handling from bootmenu and eficonfig menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
|
#
8dbd0a0f |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add vertical scroll support The current eficonfig menu does not support vertical scroll, so it can not display the menu entries greater than the console row size. This commit add the vertial scroll support. The console size is retrieved by SIMPLE_TEXT_OUTPUT_PROTOCOL.QueryMode() service, then calculates the row size for menu entry by subtracting menu header and description row size from the console row size. "start" and "end" are added in the efimenu structure. "start" keeps the menu entry index at the top, "end" keeps the bottom menu entry index. item_data_print() menu function only draws the menu entry between "start" and "end". This commit also fixes the issue that "Save" and "Quit" entries can be moved by BKEY_PLUS in change boot order menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
0d590852 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation This commit removes the change boot order specific menu implementation. The change boot order implementation calls eficonfig_process_common() same as other menus. The change boot order menu requires own item_data_print and item_choice implementation, but display_statusline function can be a same function as other menus. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
cd160b27 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor eficonfig_process_common function Current change boot order implementation does not call eficonfig_process_common() and call own menu functions for display_statusline, item_data_print and item_choice. Change boot order functionality should call eficonfig_process_common() to improve maintenanceability. This commit is a preparation to remove the change boot order specific implementation. The menu functions (display_statusline, item_data_print and item_choice) are added as argument of eficonfig_process_common(). The menu description string displayed at the bottom of the menu is also added as argument. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
32bab0ea |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Make use of CLI character processing Avoid duplicating some of the escape-sequence processing here and use the CLI function instead. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
d0ca98db |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Update bootmenu_loop() to return the code Use the return value to save having to pass around a pointer. This also resolves any ambiguity about what *key contains when the function is called. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
2da4a15e |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Rename KEY_... to BKEY_... This enum values conflict with linux/input.h so rename them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
64550274 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: avoid SetVariable between GetNextVariableName calls The current code calls efi_set_variable_int() to delete the invalid boot option between calls to efi_get_next_variable_name_int(), it may produce unpredictable results. This commit moves removal of the invalid boot option outside of the efi_get_next_variable_name_int() calls. EFI_NOT_FOUND returned from efi_get_next_variable_name_int() indicates we retrieved all EFI variables, it should be treated as EFI_SUCEESS. To address the checkpatch warning of too many leading tabs, combine two if statement into one. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
ce327084 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: carve out efi_get_next_variable_name_int calls To retrieve the EFI variable name by efi_get_next_variable_name_int(), the sequence of alloc -> efi_get_next_variable_name_int -> realloc -> efi_get_next_variable_name_int is required. In current code, this sequence repeatedly appears in the several functions. It should be curved out a common function. This commit also fixes the missing free() of var_name16 in eficonfig_delete_invalid_boot_option(). Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
140a8959 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use efi_get_next_variable_name_int() eficonfig command reads all possible UEFI load options from 0x0000 to 0xFFFF to construct the menu. This takes too much time in some environment. This commit uses efi_get_next_variable_name_int() to read all existing UEFI load options to significantlly reduce the count of efi_get_var() call. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
78b1ccc4 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use u16_strsize() to get u16 string buffer size Use u16_strsize() to simplify the u16 string buffer size calculation. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c67d3c9e |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix going one directory up issue The directory name in eficonfig menu entry contains the '\' separator. strcmp() argument ".." is wrong and one directory up handling does not work correctly. strcmp() argument must include '\' separator. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c3b5af63 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add UEFI Secure Boot Key enrollment interface This commit adds the menu-driven UEFI Secure Boot Key enrollment interface. User can enroll PK, KEK, db and dbx by selecting file. Only the signed EFI Signature List(s) with an authenticated header, typically '.auth' file, is accepted. To clear the PK, KEK, db and dbx, user needs to enroll the null key signed by PK or KEK. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
21faf4ef |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use protocol interface for file selection EFI_SIMPLE_FILE_SYSTEM_PROTOCOL is not always provided by U-Boot. Use protocol interface functions instead of U-Boot internal functions. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d6566113 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose eficonfig_create_device_path() Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use eficonfig_create_device_path() to construct the full device path from device path of the volume and file path, so move it out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d571f9b2 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation All the eficonfig menus other than "Change Boot Order" use 'eficonfig_entry' structure for each menu entry. This commit refactors change boot order implementation to use 'eficonfig_entry' structure same as other menus to have consistent menu handling. This commit also simplifies the data->active handling when KEY_SPACE is pressed, and sizeof() parameter. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
8961e93e |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose append entry function Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use append_entry() and append_quit_entry() to construct the menu, so move them out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
a84040ab |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor file selection handling eficonfig_select_file_handler() is commonly used to select the file. eficonfig_display_select_file_option() adds an additional menu to clear the selected file. eficonfig_display_select_file_option() is not always necessary for the file selection process, so it must be outside of eficonfig_select_file_handler(). This commit also renames the following functions to avoid confusion. eficonfig_select_file_handler() -> eficonfig_process_select_file() eficonfig_select_file() -> eficonfig_show_file_selection() eficonfig_display_select_file_option() -> eficonfig_process_show_file_option() Finally, test_eficonfig.py need to be updated to get aligned with the above modification. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
1167e88a |
|
14-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix missing variable initialization The 'ret' variable must be initialized before use in eficonfig_delete_invalid_boot_option(). Fixes: c416f1c0bc ("bootmenu: add removable media entries") Addresses-Coverity: 376207 ("Uninitialized variables") Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
3d595ac5 |
|
09-Nov-2022 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: remove superfluous if in eficonfig_edit_boot_option Goto for an immediately succeeding label is superfluous. Fixes: 87d791423ac6 ("eficonfig: menu-driven addition of UEFI boot option") Addresses-Coverity: 376202 ("Identical code for different branches") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
64658007 |
|
17-Nov-2023 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: eficonfig: create shortened boot options The boot options created by eficonfig should use shortened device-paths to avoid problems if drives are enumerated in a different sequence. Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
9945bc4f |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Fix incorrect return code of boot option update Correct the return code for out-of-memory and no boot option found Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
339b527b |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Move bootorder and bootoption apis to lib Rename and move bootorder and bootoption apis from cmd to lib for re-use between eficonfig and bootmgr Fix 'unexpected indentation' when 'make htmldocs' after functions are moved Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
2c0b0c31 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_SECURE_BOOT This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_SECURE_BOOT defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
83f3d121 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_MM_COMM_TEE This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_MM_COMM_TEE defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
88df3634 |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: CTRL+S to save the boot order 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>
|
#
45f5319f |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
menu: remove CTRL+C to quit On the sandbox called without "--terminal raw" CTRL+C leaves U-Boot, "ESC/CTRL+C to quit" is misleading. Let's remove CTRL+C to quit key handling from bootmenu and eficonfig menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
|
#
8dbd0a0f |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add vertical scroll support The current eficonfig menu does not support vertical scroll, so it can not display the menu entries greater than the console row size. This commit add the vertial scroll support. The console size is retrieved by SIMPLE_TEXT_OUTPUT_PROTOCOL.QueryMode() service, then calculates the row size for menu entry by subtracting menu header and description row size from the console row size. "start" and "end" are added in the efimenu structure. "start" keeps the menu entry index at the top, "end" keeps the bottom menu entry index. item_data_print() menu function only draws the menu entry between "start" and "end". This commit also fixes the issue that "Save" and "Quit" entries can be moved by BKEY_PLUS in change boot order menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
0d590852 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation This commit removes the change boot order specific menu implementation. The change boot order implementation calls eficonfig_process_common() same as other menus. The change boot order menu requires own item_data_print and item_choice implementation, but display_statusline function can be a same function as other menus. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
cd160b27 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor eficonfig_process_common function Current change boot order implementation does not call eficonfig_process_common() and call own menu functions for display_statusline, item_data_print and item_choice. Change boot order functionality should call eficonfig_process_common() to improve maintenanceability. This commit is a preparation to remove the change boot order specific implementation. The menu functions (display_statusline, item_data_print and item_choice) are added as argument of eficonfig_process_common(). The menu description string displayed at the bottom of the menu is also added as argument. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
32bab0ea |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Make use of CLI character processing Avoid duplicating some of the escape-sequence processing here and use the CLI function instead. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
d0ca98db |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Update bootmenu_loop() to return the code Use the return value to save having to pass around a pointer. This also resolves any ambiguity about what *key contains when the function is called. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
2da4a15e |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Rename KEY_... to BKEY_... This enum values conflict with linux/input.h so rename them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
64550274 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: avoid SetVariable between GetNextVariableName calls The current code calls efi_set_variable_int() to delete the invalid boot option between calls to efi_get_next_variable_name_int(), it may produce unpredictable results. This commit moves removal of the invalid boot option outside of the efi_get_next_variable_name_int() calls. EFI_NOT_FOUND returned from efi_get_next_variable_name_int() indicates we retrieved all EFI variables, it should be treated as EFI_SUCEESS. To address the checkpatch warning of too many leading tabs, combine two if statement into one. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
ce327084 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: carve out efi_get_next_variable_name_int calls To retrieve the EFI variable name by efi_get_next_variable_name_int(), the sequence of alloc -> efi_get_next_variable_name_int -> realloc -> efi_get_next_variable_name_int is required. In current code, this sequence repeatedly appears in the several functions. It should be curved out a common function. This commit also fixes the missing free() of var_name16 in eficonfig_delete_invalid_boot_option(). Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
140a8959 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use efi_get_next_variable_name_int() eficonfig command reads all possible UEFI load options from 0x0000 to 0xFFFF to construct the menu. This takes too much time in some environment. This commit uses efi_get_next_variable_name_int() to read all existing UEFI load options to significantlly reduce the count of efi_get_var() call. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
78b1ccc4 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use u16_strsize() to get u16 string buffer size Use u16_strsize() to simplify the u16 string buffer size calculation. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c67d3c9e |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix going one directory up issue The directory name in eficonfig menu entry contains the '\' separator. strcmp() argument ".." is wrong and one directory up handling does not work correctly. strcmp() argument must include '\' separator. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c3b5af63 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add UEFI Secure Boot Key enrollment interface This commit adds the menu-driven UEFI Secure Boot Key enrollment interface. User can enroll PK, KEK, db and dbx by selecting file. Only the signed EFI Signature List(s) with an authenticated header, typically '.auth' file, is accepted. To clear the PK, KEK, db and dbx, user needs to enroll the null key signed by PK or KEK. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
21faf4ef |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use protocol interface for file selection EFI_SIMPLE_FILE_SYSTEM_PROTOCOL is not always provided by U-Boot. Use protocol interface functions instead of U-Boot internal functions. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d6566113 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose eficonfig_create_device_path() Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use eficonfig_create_device_path() to construct the full device path from device path of the volume and file path, so move it out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d571f9b2 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation All the eficonfig menus other than "Change Boot Order" use 'eficonfig_entry' structure for each menu entry. This commit refactors change boot order implementation to use 'eficonfig_entry' structure same as other menus to have consistent menu handling. This commit also simplifies the data->active handling when KEY_SPACE is pressed, and sizeof() parameter. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
8961e93e |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose append entry function Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use append_entry() and append_quit_entry() to construct the menu, so move them out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
a84040ab |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor file selection handling eficonfig_select_file_handler() is commonly used to select the file. eficonfig_display_select_file_option() adds an additional menu to clear the selected file. eficonfig_display_select_file_option() is not always necessary for the file selection process, so it must be outside of eficonfig_select_file_handler(). This commit also renames the following functions to avoid confusion. eficonfig_select_file_handler() -> eficonfig_process_select_file() eficonfig_select_file() -> eficonfig_show_file_selection() eficonfig_display_select_file_option() -> eficonfig_process_show_file_option() Finally, test_eficonfig.py need to be updated to get aligned with the above modification. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
1167e88a |
|
14-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix missing variable initialization The 'ret' variable must be initialized before use in eficonfig_delete_invalid_boot_option(). Fixes: c416f1c0bc ("bootmenu: add removable media entries") Addresses-Coverity: 376207 ("Uninitialized variables") Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
3d595ac5 |
|
09-Nov-2022 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: remove superfluous if in eficonfig_edit_boot_option Goto for an immediately succeeding label is superfluous. Fixes: 87d791423ac6 ("eficonfig: menu-driven addition of UEFI boot option") Addresses-Coverity: 376202 ("Identical code for different branches") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
9945bc4f |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Fix incorrect return code of boot option update Correct the return code for out-of-memory and no boot option found Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
339b527b |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Move bootorder and bootoption apis to lib Rename and move bootorder and bootoption apis from cmd to lib for re-use between eficonfig and bootmgr Fix 'unexpected indentation' when 'make htmldocs' after functions are moved Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
2c0b0c31 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_SECURE_BOOT This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_SECURE_BOOT defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
83f3d121 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_MM_COMM_TEE This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_MM_COMM_TEE defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
88df3634 |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: CTRL+S to save the boot order 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>
|
#
45f5319f |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
menu: remove CTRL+C to quit On the sandbox called without "--terminal raw" CTRL+C leaves U-Boot, "ESC/CTRL+C to quit" is misleading. Let's remove CTRL+C to quit key handling from bootmenu and eficonfig menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
|
#
8dbd0a0f |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add vertical scroll support The current eficonfig menu does not support vertical scroll, so it can not display the menu entries greater than the console row size. This commit add the vertial scroll support. The console size is retrieved by SIMPLE_TEXT_OUTPUT_PROTOCOL.QueryMode() service, then calculates the row size for menu entry by subtracting menu header and description row size from the console row size. "start" and "end" are added in the efimenu structure. "start" keeps the menu entry index at the top, "end" keeps the bottom menu entry index. item_data_print() menu function only draws the menu entry between "start" and "end". This commit also fixes the issue that "Save" and "Quit" entries can be moved by BKEY_PLUS in change boot order menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
0d590852 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation This commit removes the change boot order specific menu implementation. The change boot order implementation calls eficonfig_process_common() same as other menus. The change boot order menu requires own item_data_print and item_choice implementation, but display_statusline function can be a same function as other menus. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
cd160b27 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor eficonfig_process_common function Current change boot order implementation does not call eficonfig_process_common() and call own menu functions for display_statusline, item_data_print and item_choice. Change boot order functionality should call eficonfig_process_common() to improve maintenanceability. This commit is a preparation to remove the change boot order specific implementation. The menu functions (display_statusline, item_data_print and item_choice) are added as argument of eficonfig_process_common(). The menu description string displayed at the bottom of the menu is also added as argument. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
32bab0ea |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Make use of CLI character processing Avoid duplicating some of the escape-sequence processing here and use the CLI function instead. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
d0ca98db |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Update bootmenu_loop() to return the code Use the return value to save having to pass around a pointer. This also resolves any ambiguity about what *key contains when the function is called. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
2da4a15e |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Rename KEY_... to BKEY_... This enum values conflict with linux/input.h so rename them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
64550274 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: avoid SetVariable between GetNextVariableName calls The current code calls efi_set_variable_int() to delete the invalid boot option between calls to efi_get_next_variable_name_int(), it may produce unpredictable results. This commit moves removal of the invalid boot option outside of the efi_get_next_variable_name_int() calls. EFI_NOT_FOUND returned from efi_get_next_variable_name_int() indicates we retrieved all EFI variables, it should be treated as EFI_SUCEESS. To address the checkpatch warning of too many leading tabs, combine two if statement into one. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
ce327084 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: carve out efi_get_next_variable_name_int calls To retrieve the EFI variable name by efi_get_next_variable_name_int(), the sequence of alloc -> efi_get_next_variable_name_int -> realloc -> efi_get_next_variable_name_int is required. In current code, this sequence repeatedly appears in the several functions. It should be curved out a common function. This commit also fixes the missing free() of var_name16 in eficonfig_delete_invalid_boot_option(). Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
140a8959 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use efi_get_next_variable_name_int() eficonfig command reads all possible UEFI load options from 0x0000 to 0xFFFF to construct the menu. This takes too much time in some environment. This commit uses efi_get_next_variable_name_int() to read all existing UEFI load options to significantlly reduce the count of efi_get_var() call. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
78b1ccc4 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use u16_strsize() to get u16 string buffer size Use u16_strsize() to simplify the u16 string buffer size calculation. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c67d3c9e |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix going one directory up issue The directory name in eficonfig menu entry contains the '\' separator. strcmp() argument ".." is wrong and one directory up handling does not work correctly. strcmp() argument must include '\' separator. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c3b5af63 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add UEFI Secure Boot Key enrollment interface This commit adds the menu-driven UEFI Secure Boot Key enrollment interface. User can enroll PK, KEK, db and dbx by selecting file. Only the signed EFI Signature List(s) with an authenticated header, typically '.auth' file, is accepted. To clear the PK, KEK, db and dbx, user needs to enroll the null key signed by PK or KEK. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
21faf4ef |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use protocol interface for file selection EFI_SIMPLE_FILE_SYSTEM_PROTOCOL is not always provided by U-Boot. Use protocol interface functions instead of U-Boot internal functions. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d6566113 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose eficonfig_create_device_path() Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use eficonfig_create_device_path() to construct the full device path from device path of the volume and file path, so move it out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d571f9b2 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation All the eficonfig menus other than "Change Boot Order" use 'eficonfig_entry' structure for each menu entry. This commit refactors change boot order implementation to use 'eficonfig_entry' structure same as other menus to have consistent menu handling. This commit also simplifies the data->active handling when KEY_SPACE is pressed, and sizeof() parameter. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
8961e93e |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose append entry function Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use append_entry() and append_quit_entry() to construct the menu, so move them out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
a84040ab |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor file selection handling eficonfig_select_file_handler() is commonly used to select the file. eficonfig_display_select_file_option() adds an additional menu to clear the selected file. eficonfig_display_select_file_option() is not always necessary for the file selection process, so it must be outside of eficonfig_select_file_handler(). This commit also renames the following functions to avoid confusion. eficonfig_select_file_handler() -> eficonfig_process_select_file() eficonfig_select_file() -> eficonfig_show_file_selection() eficonfig_display_select_file_option() -> eficonfig_process_show_file_option() Finally, test_eficonfig.py need to be updated to get aligned with the above modification. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
1167e88a |
|
14-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix missing variable initialization The 'ret' variable must be initialized before use in eficonfig_delete_invalid_boot_option(). Fixes: c416f1c0bc ("bootmenu: add removable media entries") Addresses-Coverity: 376207 ("Uninitialized variables") Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
3d595ac5 |
|
09-Nov-2022 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: remove superfluous if in eficonfig_edit_boot_option Goto for an immediately succeeding label is superfluous. Fixes: 87d791423ac6 ("eficonfig: menu-driven addition of UEFI boot option") Addresses-Coverity: 376202 ("Identical code for different branches") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
9945bc4f |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Fix incorrect return code of boot option update Correct the return code for out-of-memory and no boot option found Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
339b527b |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Move bootorder and bootoption apis to lib Rename and move bootorder and bootoption apis from cmd to lib for re-use between eficonfig and bootmgr Fix 'unexpected indentation' when 'make htmldocs' after functions are moved Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
2c0b0c31 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_SECURE_BOOT This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_SECURE_BOOT defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
83f3d121 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_MM_COMM_TEE This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_MM_COMM_TEE defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
88df3634 |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: CTRL+S to save the boot order 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>
|
#
45f5319f |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
menu: remove CTRL+C to quit On the sandbox called without "--terminal raw" CTRL+C leaves U-Boot, "ESC/CTRL+C to quit" is misleading. Let's remove CTRL+C to quit key handling from bootmenu and eficonfig menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
|
#
8dbd0a0f |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add vertical scroll support The current eficonfig menu does not support vertical scroll, so it can not display the menu entries greater than the console row size. This commit add the vertial scroll support. The console size is retrieved by SIMPLE_TEXT_OUTPUT_PROTOCOL.QueryMode() service, then calculates the row size for menu entry by subtracting menu header and description row size from the console row size. "start" and "end" are added in the efimenu structure. "start" keeps the menu entry index at the top, "end" keeps the bottom menu entry index. item_data_print() menu function only draws the menu entry between "start" and "end". This commit also fixes the issue that "Save" and "Quit" entries can be moved by BKEY_PLUS in change boot order menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
0d590852 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation This commit removes the change boot order specific menu implementation. The change boot order implementation calls eficonfig_process_common() same as other menus. The change boot order menu requires own item_data_print and item_choice implementation, but display_statusline function can be a same function as other menus. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
cd160b27 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor eficonfig_process_common function Current change boot order implementation does not call eficonfig_process_common() and call own menu functions for display_statusline, item_data_print and item_choice. Change boot order functionality should call eficonfig_process_common() to improve maintenanceability. This commit is a preparation to remove the change boot order specific implementation. The menu functions (display_statusline, item_data_print and item_choice) are added as argument of eficonfig_process_common(). The menu description string displayed at the bottom of the menu is also added as argument. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
32bab0ea |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Make use of CLI character processing Avoid duplicating some of the escape-sequence processing here and use the CLI function instead. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
d0ca98db |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Update bootmenu_loop() to return the code Use the return value to save having to pass around a pointer. This also resolves any ambiguity about what *key contains when the function is called. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
2da4a15e |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Rename KEY_... to BKEY_... This enum values conflict with linux/input.h so rename them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
64550274 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: avoid SetVariable between GetNextVariableName calls The current code calls efi_set_variable_int() to delete the invalid boot option between calls to efi_get_next_variable_name_int(), it may produce unpredictable results. This commit moves removal of the invalid boot option outside of the efi_get_next_variable_name_int() calls. EFI_NOT_FOUND returned from efi_get_next_variable_name_int() indicates we retrieved all EFI variables, it should be treated as EFI_SUCEESS. To address the checkpatch warning of too many leading tabs, combine two if statement into one. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
ce327084 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: carve out efi_get_next_variable_name_int calls To retrieve the EFI variable name by efi_get_next_variable_name_int(), the sequence of alloc -> efi_get_next_variable_name_int -> realloc -> efi_get_next_variable_name_int is required. In current code, this sequence repeatedly appears in the several functions. It should be curved out a common function. This commit also fixes the missing free() of var_name16 in eficonfig_delete_invalid_boot_option(). Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
140a8959 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use efi_get_next_variable_name_int() eficonfig command reads all possible UEFI load options from 0x0000 to 0xFFFF to construct the menu. This takes too much time in some environment. This commit uses efi_get_next_variable_name_int() to read all existing UEFI load options to significantlly reduce the count of efi_get_var() call. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
78b1ccc4 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use u16_strsize() to get u16 string buffer size Use u16_strsize() to simplify the u16 string buffer size calculation. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c67d3c9e |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix going one directory up issue The directory name in eficonfig menu entry contains the '\' separator. strcmp() argument ".." is wrong and one directory up handling does not work correctly. strcmp() argument must include '\' separator. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c3b5af63 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add UEFI Secure Boot Key enrollment interface This commit adds the menu-driven UEFI Secure Boot Key enrollment interface. User can enroll PK, KEK, db and dbx by selecting file. Only the signed EFI Signature List(s) with an authenticated header, typically '.auth' file, is accepted. To clear the PK, KEK, db and dbx, user needs to enroll the null key signed by PK or KEK. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
21faf4ef |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use protocol interface for file selection EFI_SIMPLE_FILE_SYSTEM_PROTOCOL is not always provided by U-Boot. Use protocol interface functions instead of U-Boot internal functions. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d6566113 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose eficonfig_create_device_path() Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use eficonfig_create_device_path() to construct the full device path from device path of the volume and file path, so move it out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d571f9b2 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation All the eficonfig menus other than "Change Boot Order" use 'eficonfig_entry' structure for each menu entry. This commit refactors change boot order implementation to use 'eficonfig_entry' structure same as other menus to have consistent menu handling. This commit also simplifies the data->active handling when KEY_SPACE is pressed, and sizeof() parameter. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
8961e93e |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose append entry function Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use append_entry() and append_quit_entry() to construct the menu, so move them out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
a84040ab |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor file selection handling eficonfig_select_file_handler() is commonly used to select the file. eficonfig_display_select_file_option() adds an additional menu to clear the selected file. eficonfig_display_select_file_option() is not always necessary for the file selection process, so it must be outside of eficonfig_select_file_handler(). This commit also renames the following functions to avoid confusion. eficonfig_select_file_handler() -> eficonfig_process_select_file() eficonfig_select_file() -> eficonfig_show_file_selection() eficonfig_display_select_file_option() -> eficonfig_process_show_file_option() Finally, test_eficonfig.py need to be updated to get aligned with the above modification. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
1167e88a |
|
14-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix missing variable initialization The 'ret' variable must be initialized before use in eficonfig_delete_invalid_boot_option(). Fixes: c416f1c0bc ("bootmenu: add removable media entries") Addresses-Coverity: 376207 ("Uninitialized variables") Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
3d595ac5 |
|
09-Nov-2022 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: remove superfluous if in eficonfig_edit_boot_option Goto for an immediately succeeding label is superfluous. Fixes: 87d791423ac6 ("eficonfig: menu-driven addition of UEFI boot option") Addresses-Coverity: 376202 ("Identical code for different branches") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
9945bc4f |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Fix incorrect return code of boot option update Correct the return code for out-of-memory and no boot option found Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
339b527b |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Move bootorder and bootoption apis to lib Rename and move bootorder and bootoption apis from cmd to lib for re-use between eficonfig and bootmgr Fix 'unexpected indentation' when 'make htmldocs' after functions are moved Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
2c0b0c31 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_SECURE_BOOT This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_SECURE_BOOT defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
83f3d121 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_MM_COMM_TEE This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_MM_COMM_TEE defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
88df3634 |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: CTRL+S to save the boot order 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>
|
#
45f5319f |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
menu: remove CTRL+C to quit On the sandbox called without "--terminal raw" CTRL+C leaves U-Boot, "ESC/CTRL+C to quit" is misleading. Let's remove CTRL+C to quit key handling from bootmenu and eficonfig menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
|
#
8dbd0a0f |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add vertical scroll support The current eficonfig menu does not support vertical scroll, so it can not display the menu entries greater than the console row size. This commit add the vertial scroll support. The console size is retrieved by SIMPLE_TEXT_OUTPUT_PROTOCOL.QueryMode() service, then calculates the row size for menu entry by subtracting menu header and description row size from the console row size. "start" and "end" are added in the efimenu structure. "start" keeps the menu entry index at the top, "end" keeps the bottom menu entry index. item_data_print() menu function only draws the menu entry between "start" and "end". This commit also fixes the issue that "Save" and "Quit" entries can be moved by BKEY_PLUS in change boot order menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
0d590852 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation This commit removes the change boot order specific menu implementation. The change boot order implementation calls eficonfig_process_common() same as other menus. The change boot order menu requires own item_data_print and item_choice implementation, but display_statusline function can be a same function as other menus. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
cd160b27 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor eficonfig_process_common function Current change boot order implementation does not call eficonfig_process_common() and call own menu functions for display_statusline, item_data_print and item_choice. Change boot order functionality should call eficonfig_process_common() to improve maintenanceability. This commit is a preparation to remove the change boot order specific implementation. The menu functions (display_statusline, item_data_print and item_choice) are added as argument of eficonfig_process_common(). The menu description string displayed at the bottom of the menu is also added as argument. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
32bab0ea |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Make use of CLI character processing Avoid duplicating some of the escape-sequence processing here and use the CLI function instead. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
d0ca98db |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Update bootmenu_loop() to return the code Use the return value to save having to pass around a pointer. This also resolves any ambiguity about what *key contains when the function is called. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
2da4a15e |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Rename KEY_... to BKEY_... This enum values conflict with linux/input.h so rename them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
64550274 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: avoid SetVariable between GetNextVariableName calls The current code calls efi_set_variable_int() to delete the invalid boot option between calls to efi_get_next_variable_name_int(), it may produce unpredictable results. This commit moves removal of the invalid boot option outside of the efi_get_next_variable_name_int() calls. EFI_NOT_FOUND returned from efi_get_next_variable_name_int() indicates we retrieved all EFI variables, it should be treated as EFI_SUCEESS. To address the checkpatch warning of too many leading tabs, combine two if statement into one. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
ce327084 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: carve out efi_get_next_variable_name_int calls To retrieve the EFI variable name by efi_get_next_variable_name_int(), the sequence of alloc -> efi_get_next_variable_name_int -> realloc -> efi_get_next_variable_name_int is required. In current code, this sequence repeatedly appears in the several functions. It should be curved out a common function. This commit also fixes the missing free() of var_name16 in eficonfig_delete_invalid_boot_option(). Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
140a8959 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use efi_get_next_variable_name_int() eficonfig command reads all possible UEFI load options from 0x0000 to 0xFFFF to construct the menu. This takes too much time in some environment. This commit uses efi_get_next_variable_name_int() to read all existing UEFI load options to significantlly reduce the count of efi_get_var() call. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
78b1ccc4 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use u16_strsize() to get u16 string buffer size Use u16_strsize() to simplify the u16 string buffer size calculation. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c67d3c9e |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix going one directory up issue The directory name in eficonfig menu entry contains the '\' separator. strcmp() argument ".." is wrong and one directory up handling does not work correctly. strcmp() argument must include '\' separator. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c3b5af63 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add UEFI Secure Boot Key enrollment interface This commit adds the menu-driven UEFI Secure Boot Key enrollment interface. User can enroll PK, KEK, db and dbx by selecting file. Only the signed EFI Signature List(s) with an authenticated header, typically '.auth' file, is accepted. To clear the PK, KEK, db and dbx, user needs to enroll the null key signed by PK or KEK. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
21faf4ef |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use protocol interface for file selection EFI_SIMPLE_FILE_SYSTEM_PROTOCOL is not always provided by U-Boot. Use protocol interface functions instead of U-Boot internal functions. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d6566113 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose eficonfig_create_device_path() Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use eficonfig_create_device_path() to construct the full device path from device path of the volume and file path, so move it out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d571f9b2 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation All the eficonfig menus other than "Change Boot Order" use 'eficonfig_entry' structure for each menu entry. This commit refactors change boot order implementation to use 'eficonfig_entry' structure same as other menus to have consistent menu handling. This commit also simplifies the data->active handling when KEY_SPACE is pressed, and sizeof() parameter. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
8961e93e |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose append entry function Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use append_entry() and append_quit_entry() to construct the menu, so move them out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
a84040ab |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor file selection handling eficonfig_select_file_handler() is commonly used to select the file. eficonfig_display_select_file_option() adds an additional menu to clear the selected file. eficonfig_display_select_file_option() is not always necessary for the file selection process, so it must be outside of eficonfig_select_file_handler(). This commit also renames the following functions to avoid confusion. eficonfig_select_file_handler() -> eficonfig_process_select_file() eficonfig_select_file() -> eficonfig_show_file_selection() eficonfig_display_select_file_option() -> eficonfig_process_show_file_option() Finally, test_eficonfig.py need to be updated to get aligned with the above modification. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
1167e88a |
|
14-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix missing variable initialization The 'ret' variable must be initialized before use in eficonfig_delete_invalid_boot_option(). Fixes: c416f1c0bc ("bootmenu: add removable media entries") Addresses-Coverity: 376207 ("Uninitialized variables") Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
3d595ac5 |
|
09-Nov-2022 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: remove superfluous if in eficonfig_edit_boot_option Goto for an immediately succeeding label is superfluous. Fixes: 87d791423ac6 ("eficonfig: menu-driven addition of UEFI boot option") Addresses-Coverity: 376202 ("Identical code for different branches") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
9945bc4f |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Fix incorrect return code of boot option update Correct the return code for out-of-memory and no boot option found Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
339b527b |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Move bootorder and bootoption apis to lib Rename and move bootorder and bootoption apis from cmd to lib for re-use between eficonfig and bootmgr Fix 'unexpected indentation' when 'make htmldocs' after functions are moved Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
2c0b0c31 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_SECURE_BOOT This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_SECURE_BOOT defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
83f3d121 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_MM_COMM_TEE This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_MM_COMM_TEE defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
88df3634 |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: CTRL+S to save the boot order 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>
|
#
45f5319f |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
menu: remove CTRL+C to quit On the sandbox called without "--terminal raw" CTRL+C leaves U-Boot, "ESC/CTRL+C to quit" is misleading. Let's remove CTRL+C to quit key handling from bootmenu and eficonfig menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
|
#
8dbd0a0f |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add vertical scroll support The current eficonfig menu does not support vertical scroll, so it can not display the menu entries greater than the console row size. This commit add the vertial scroll support. The console size is retrieved by SIMPLE_TEXT_OUTPUT_PROTOCOL.QueryMode() service, then calculates the row size for menu entry by subtracting menu header and description row size from the console row size. "start" and "end" are added in the efimenu structure. "start" keeps the menu entry index at the top, "end" keeps the bottom menu entry index. item_data_print() menu function only draws the menu entry between "start" and "end". This commit also fixes the issue that "Save" and "Quit" entries can be moved by BKEY_PLUS in change boot order menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
0d590852 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation This commit removes the change boot order specific menu implementation. The change boot order implementation calls eficonfig_process_common() same as other menus. The change boot order menu requires own item_data_print and item_choice implementation, but display_statusline function can be a same function as other menus. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
cd160b27 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor eficonfig_process_common function Current change boot order implementation does not call eficonfig_process_common() and call own menu functions for display_statusline, item_data_print and item_choice. Change boot order functionality should call eficonfig_process_common() to improve maintenanceability. This commit is a preparation to remove the change boot order specific implementation. The menu functions (display_statusline, item_data_print and item_choice) are added as argument of eficonfig_process_common(). The menu description string displayed at the bottom of the menu is also added as argument. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
32bab0ea |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Make use of CLI character processing Avoid duplicating some of the escape-sequence processing here and use the CLI function instead. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
d0ca98db |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Update bootmenu_loop() to return the code Use the return value to save having to pass around a pointer. This also resolves any ambiguity about what *key contains when the function is called. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
2da4a15e |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Rename KEY_... to BKEY_... This enum values conflict with linux/input.h so rename them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
64550274 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: avoid SetVariable between GetNextVariableName calls The current code calls efi_set_variable_int() to delete the invalid boot option between calls to efi_get_next_variable_name_int(), it may produce unpredictable results. This commit moves removal of the invalid boot option outside of the efi_get_next_variable_name_int() calls. EFI_NOT_FOUND returned from efi_get_next_variable_name_int() indicates we retrieved all EFI variables, it should be treated as EFI_SUCEESS. To address the checkpatch warning of too many leading tabs, combine two if statement into one. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
ce327084 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: carve out efi_get_next_variable_name_int calls To retrieve the EFI variable name by efi_get_next_variable_name_int(), the sequence of alloc -> efi_get_next_variable_name_int -> realloc -> efi_get_next_variable_name_int is required. In current code, this sequence repeatedly appears in the several functions. It should be curved out a common function. This commit also fixes the missing free() of var_name16 in eficonfig_delete_invalid_boot_option(). Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
140a8959 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use efi_get_next_variable_name_int() eficonfig command reads all possible UEFI load options from 0x0000 to 0xFFFF to construct the menu. This takes too much time in some environment. This commit uses efi_get_next_variable_name_int() to read all existing UEFI load options to significantlly reduce the count of efi_get_var() call. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
78b1ccc4 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use u16_strsize() to get u16 string buffer size Use u16_strsize() to simplify the u16 string buffer size calculation. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c67d3c9e |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix going one directory up issue The directory name in eficonfig menu entry contains the '\' separator. strcmp() argument ".." is wrong and one directory up handling does not work correctly. strcmp() argument must include '\' separator. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c3b5af63 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add UEFI Secure Boot Key enrollment interface This commit adds the menu-driven UEFI Secure Boot Key enrollment interface. User can enroll PK, KEK, db and dbx by selecting file. Only the signed EFI Signature List(s) with an authenticated header, typically '.auth' file, is accepted. To clear the PK, KEK, db and dbx, user needs to enroll the null key signed by PK or KEK. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
21faf4ef |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use protocol interface for file selection EFI_SIMPLE_FILE_SYSTEM_PROTOCOL is not always provided by U-Boot. Use protocol interface functions instead of U-Boot internal functions. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d6566113 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose eficonfig_create_device_path() Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use eficonfig_create_device_path() to construct the full device path from device path of the volume and file path, so move it out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d571f9b2 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation All the eficonfig menus other than "Change Boot Order" use 'eficonfig_entry' structure for each menu entry. This commit refactors change boot order implementation to use 'eficonfig_entry' structure same as other menus to have consistent menu handling. This commit also simplifies the data->active handling when KEY_SPACE is pressed, and sizeof() parameter. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
8961e93e |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose append entry function Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use append_entry() and append_quit_entry() to construct the menu, so move them out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
a84040ab |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor file selection handling eficonfig_select_file_handler() is commonly used to select the file. eficonfig_display_select_file_option() adds an additional menu to clear the selected file. eficonfig_display_select_file_option() is not always necessary for the file selection process, so it must be outside of eficonfig_select_file_handler(). This commit also renames the following functions to avoid confusion. eficonfig_select_file_handler() -> eficonfig_process_select_file() eficonfig_select_file() -> eficonfig_show_file_selection() eficonfig_display_select_file_option() -> eficonfig_process_show_file_option() Finally, test_eficonfig.py need to be updated to get aligned with the above modification. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
1167e88a |
|
14-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix missing variable initialization The 'ret' variable must be initialized before use in eficonfig_delete_invalid_boot_option(). Fixes: c416f1c0bc ("bootmenu: add removable media entries") Addresses-Coverity: 376207 ("Uninitialized variables") Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
3d595ac5 |
|
09-Nov-2022 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: remove superfluous if in eficonfig_edit_boot_option Goto for an immediately succeeding label is superfluous. Fixes: 87d791423ac6 ("eficonfig: menu-driven addition of UEFI boot option") Addresses-Coverity: 376202 ("Identical code for different branches") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
9945bc4f |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Fix incorrect return code of boot option update Correct the return code for out-of-memory and no boot option found Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
339b527b |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Move bootorder and bootoption apis to lib Rename and move bootorder and bootoption apis from cmd to lib for re-use between eficonfig and bootmgr Fix 'unexpected indentation' when 'make htmldocs' after functions are moved Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
2c0b0c31 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_SECURE_BOOT This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_SECURE_BOOT defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
83f3d121 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_MM_COMM_TEE This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_MM_COMM_TEE defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
88df3634 |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: CTRL+S to save the boot order 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>
|
#
45f5319f |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
menu: remove CTRL+C to quit On the sandbox called without "--terminal raw" CTRL+C leaves U-Boot, "ESC/CTRL+C to quit" is misleading. Let's remove CTRL+C to quit key handling from bootmenu and eficonfig menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
|
#
8dbd0a0f |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add vertical scroll support The current eficonfig menu does not support vertical scroll, so it can not display the menu entries greater than the console row size. This commit add the vertial scroll support. The console size is retrieved by SIMPLE_TEXT_OUTPUT_PROTOCOL.QueryMode() service, then calculates the row size for menu entry by subtracting menu header and description row size from the console row size. "start" and "end" are added in the efimenu structure. "start" keeps the menu entry index at the top, "end" keeps the bottom menu entry index. item_data_print() menu function only draws the menu entry between "start" and "end". This commit also fixes the issue that "Save" and "Quit" entries can be moved by BKEY_PLUS in change boot order menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
0d590852 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation This commit removes the change boot order specific menu implementation. The change boot order implementation calls eficonfig_process_common() same as other menus. The change boot order menu requires own item_data_print and item_choice implementation, but display_statusline function can be a same function as other menus. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
cd160b27 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor eficonfig_process_common function Current change boot order implementation does not call eficonfig_process_common() and call own menu functions for display_statusline, item_data_print and item_choice. Change boot order functionality should call eficonfig_process_common() to improve maintenanceability. This commit is a preparation to remove the change boot order specific implementation. The menu functions (display_statusline, item_data_print and item_choice) are added as argument of eficonfig_process_common(). The menu description string displayed at the bottom of the menu is also added as argument. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
32bab0ea |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Make use of CLI character processing Avoid duplicating some of the escape-sequence processing here and use the CLI function instead. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
d0ca98db |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Update bootmenu_loop() to return the code Use the return value to save having to pass around a pointer. This also resolves any ambiguity about what *key contains when the function is called. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
2da4a15e |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Rename KEY_... to BKEY_... This enum values conflict with linux/input.h so rename them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
64550274 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: avoid SetVariable between GetNextVariableName calls The current code calls efi_set_variable_int() to delete the invalid boot option between calls to efi_get_next_variable_name_int(), it may produce unpredictable results. This commit moves removal of the invalid boot option outside of the efi_get_next_variable_name_int() calls. EFI_NOT_FOUND returned from efi_get_next_variable_name_int() indicates we retrieved all EFI variables, it should be treated as EFI_SUCEESS. To address the checkpatch warning of too many leading tabs, combine two if statement into one. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
ce327084 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: carve out efi_get_next_variable_name_int calls To retrieve the EFI variable name by efi_get_next_variable_name_int(), the sequence of alloc -> efi_get_next_variable_name_int -> realloc -> efi_get_next_variable_name_int is required. In current code, this sequence repeatedly appears in the several functions. It should be curved out a common function. This commit also fixes the missing free() of var_name16 in eficonfig_delete_invalid_boot_option(). Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
140a8959 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use efi_get_next_variable_name_int() eficonfig command reads all possible UEFI load options from 0x0000 to 0xFFFF to construct the menu. This takes too much time in some environment. This commit uses efi_get_next_variable_name_int() to read all existing UEFI load options to significantlly reduce the count of efi_get_var() call. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
78b1ccc4 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use u16_strsize() to get u16 string buffer size Use u16_strsize() to simplify the u16 string buffer size calculation. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c67d3c9e |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix going one directory up issue The directory name in eficonfig menu entry contains the '\' separator. strcmp() argument ".." is wrong and one directory up handling does not work correctly. strcmp() argument must include '\' separator. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c3b5af63 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add UEFI Secure Boot Key enrollment interface This commit adds the menu-driven UEFI Secure Boot Key enrollment interface. User can enroll PK, KEK, db and dbx by selecting file. Only the signed EFI Signature List(s) with an authenticated header, typically '.auth' file, is accepted. To clear the PK, KEK, db and dbx, user needs to enroll the null key signed by PK or KEK. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
21faf4ef |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use protocol interface for file selection EFI_SIMPLE_FILE_SYSTEM_PROTOCOL is not always provided by U-Boot. Use protocol interface functions instead of U-Boot internal functions. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d6566113 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose eficonfig_create_device_path() Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use eficonfig_create_device_path() to construct the full device path from device path of the volume and file path, so move it out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d571f9b2 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation All the eficonfig menus other than "Change Boot Order" use 'eficonfig_entry' structure for each menu entry. This commit refactors change boot order implementation to use 'eficonfig_entry' structure same as other menus to have consistent menu handling. This commit also simplifies the data->active handling when KEY_SPACE is pressed, and sizeof() parameter. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
8961e93e |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose append entry function Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use append_entry() and append_quit_entry() to construct the menu, so move them out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
a84040ab |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor file selection handling eficonfig_select_file_handler() is commonly used to select the file. eficonfig_display_select_file_option() adds an additional menu to clear the selected file. eficonfig_display_select_file_option() is not always necessary for the file selection process, so it must be outside of eficonfig_select_file_handler(). This commit also renames the following functions to avoid confusion. eficonfig_select_file_handler() -> eficonfig_process_select_file() eficonfig_select_file() -> eficonfig_show_file_selection() eficonfig_display_select_file_option() -> eficonfig_process_show_file_option() Finally, test_eficonfig.py need to be updated to get aligned with the above modification. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
1167e88a |
|
14-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix missing variable initialization The 'ret' variable must be initialized before use in eficonfig_delete_invalid_boot_option(). Fixes: c416f1c0bc ("bootmenu: add removable media entries") Addresses-Coverity: 376207 ("Uninitialized variables") Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
3d595ac5 |
|
09-Nov-2022 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: remove superfluous if in eficonfig_edit_boot_option Goto for an immediately succeeding label is superfluous. Fixes: 87d791423ac6 ("eficonfig: menu-driven addition of UEFI boot option") Addresses-Coverity: 376202 ("Identical code for different branches") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
9945bc4f |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Fix incorrect return code of boot option update Correct the return code for out-of-memory and no boot option found Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
339b527b |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Move bootorder and bootoption apis to lib Rename and move bootorder and bootoption apis from cmd to lib for re-use between eficonfig and bootmgr Fix 'unexpected indentation' when 'make htmldocs' after functions are moved Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
2c0b0c31 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_SECURE_BOOT This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_SECURE_BOOT defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
83f3d121 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_MM_COMM_TEE This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_MM_COMM_TEE defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
88df3634 |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: CTRL+S to save the boot order 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>
|
#
45f5319f |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
menu: remove CTRL+C to quit On the sandbox called without "--terminal raw" CTRL+C leaves U-Boot, "ESC/CTRL+C to quit" is misleading. Let's remove CTRL+C to quit key handling from bootmenu and eficonfig menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
|
#
8dbd0a0f |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add vertical scroll support The current eficonfig menu does not support vertical scroll, so it can not display the menu entries greater than the console row size. This commit add the vertial scroll support. The console size is retrieved by SIMPLE_TEXT_OUTPUT_PROTOCOL.QueryMode() service, then calculates the row size for menu entry by subtracting menu header and description row size from the console row size. "start" and "end" are added in the efimenu structure. "start" keeps the menu entry index at the top, "end" keeps the bottom menu entry index. item_data_print() menu function only draws the menu entry between "start" and "end". This commit also fixes the issue that "Save" and "Quit" entries can be moved by BKEY_PLUS in change boot order menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
0d590852 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation This commit removes the change boot order specific menu implementation. The change boot order implementation calls eficonfig_process_common() same as other menus. The change boot order menu requires own item_data_print and item_choice implementation, but display_statusline function can be a same function as other menus. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
cd160b27 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor eficonfig_process_common function Current change boot order implementation does not call eficonfig_process_common() and call own menu functions for display_statusline, item_data_print and item_choice. Change boot order functionality should call eficonfig_process_common() to improve maintenanceability. This commit is a preparation to remove the change boot order specific implementation. The menu functions (display_statusline, item_data_print and item_choice) are added as argument of eficonfig_process_common(). The menu description string displayed at the bottom of the menu is also added as argument. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
32bab0ea |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Make use of CLI character processing Avoid duplicating some of the escape-sequence processing here and use the CLI function instead. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
d0ca98db |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Update bootmenu_loop() to return the code Use the return value to save having to pass around a pointer. This also resolves any ambiguity about what *key contains when the function is called. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
2da4a15e |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Rename KEY_... to BKEY_... This enum values conflict with linux/input.h so rename them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
64550274 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: avoid SetVariable between GetNextVariableName calls The current code calls efi_set_variable_int() to delete the invalid boot option between calls to efi_get_next_variable_name_int(), it may produce unpredictable results. This commit moves removal of the invalid boot option outside of the efi_get_next_variable_name_int() calls. EFI_NOT_FOUND returned from efi_get_next_variable_name_int() indicates we retrieved all EFI variables, it should be treated as EFI_SUCEESS. To address the checkpatch warning of too many leading tabs, combine two if statement into one. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
ce327084 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: carve out efi_get_next_variable_name_int calls To retrieve the EFI variable name by efi_get_next_variable_name_int(), the sequence of alloc -> efi_get_next_variable_name_int -> realloc -> efi_get_next_variable_name_int is required. In current code, this sequence repeatedly appears in the several functions. It should be curved out a common function. This commit also fixes the missing free() of var_name16 in eficonfig_delete_invalid_boot_option(). Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
140a8959 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use efi_get_next_variable_name_int() eficonfig command reads all possible UEFI load options from 0x0000 to 0xFFFF to construct the menu. This takes too much time in some environment. This commit uses efi_get_next_variable_name_int() to read all existing UEFI load options to significantlly reduce the count of efi_get_var() call. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
78b1ccc4 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use u16_strsize() to get u16 string buffer size Use u16_strsize() to simplify the u16 string buffer size calculation. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c67d3c9e |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix going one directory up issue The directory name in eficonfig menu entry contains the '\' separator. strcmp() argument ".." is wrong and one directory up handling does not work correctly. strcmp() argument must include '\' separator. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c3b5af63 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add UEFI Secure Boot Key enrollment interface This commit adds the menu-driven UEFI Secure Boot Key enrollment interface. User can enroll PK, KEK, db and dbx by selecting file. Only the signed EFI Signature List(s) with an authenticated header, typically '.auth' file, is accepted. To clear the PK, KEK, db and dbx, user needs to enroll the null key signed by PK or KEK. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
21faf4ef |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use protocol interface for file selection EFI_SIMPLE_FILE_SYSTEM_PROTOCOL is not always provided by U-Boot. Use protocol interface functions instead of U-Boot internal functions. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d6566113 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose eficonfig_create_device_path() Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use eficonfig_create_device_path() to construct the full device path from device path of the volume and file path, so move it out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d571f9b2 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation All the eficonfig menus other than "Change Boot Order" use 'eficonfig_entry' structure for each menu entry. This commit refactors change boot order implementation to use 'eficonfig_entry' structure same as other menus to have consistent menu handling. This commit also simplifies the data->active handling when KEY_SPACE is pressed, and sizeof() parameter. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
8961e93e |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose append entry function Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use append_entry() and append_quit_entry() to construct the menu, so move them out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
a84040ab |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor file selection handling eficonfig_select_file_handler() is commonly used to select the file. eficonfig_display_select_file_option() adds an additional menu to clear the selected file. eficonfig_display_select_file_option() is not always necessary for the file selection process, so it must be outside of eficonfig_select_file_handler(). This commit also renames the following functions to avoid confusion. eficonfig_select_file_handler() -> eficonfig_process_select_file() eficonfig_select_file() -> eficonfig_show_file_selection() eficonfig_display_select_file_option() -> eficonfig_process_show_file_option() Finally, test_eficonfig.py need to be updated to get aligned with the above modification. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
1167e88a |
|
14-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix missing variable initialization The 'ret' variable must be initialized before use in eficonfig_delete_invalid_boot_option(). Fixes: c416f1c0bc ("bootmenu: add removable media entries") Addresses-Coverity: 376207 ("Uninitialized variables") Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
3d595ac5 |
|
09-Nov-2022 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: remove superfluous if in eficonfig_edit_boot_option Goto for an immediately succeeding label is superfluous. Fixes: 87d791423ac6 ("eficonfig: menu-driven addition of UEFI boot option") Addresses-Coverity: 376202 ("Identical code for different branches") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
9945bc4f |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Fix incorrect return code of boot option update Correct the return code for out-of-memory and no boot option found Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
339b527b |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Move bootorder and bootoption apis to lib Rename and move bootorder and bootoption apis from cmd to lib for re-use between eficonfig and bootmgr Fix 'unexpected indentation' when 'make htmldocs' after functions are moved Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
2c0b0c31 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_SECURE_BOOT This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_SECURE_BOOT defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
83f3d121 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_MM_COMM_TEE This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_MM_COMM_TEE defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
88df3634 |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: CTRL+S to save the boot order 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>
|
#
45f5319f |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
menu: remove CTRL+C to quit On the sandbox called without "--terminal raw" CTRL+C leaves U-Boot, "ESC/CTRL+C to quit" is misleading. Let's remove CTRL+C to quit key handling from bootmenu and eficonfig menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
|
#
8dbd0a0f |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add vertical scroll support The current eficonfig menu does not support vertical scroll, so it can not display the menu entries greater than the console row size. This commit add the vertial scroll support. The console size is retrieved by SIMPLE_TEXT_OUTPUT_PROTOCOL.QueryMode() service, then calculates the row size for menu entry by subtracting menu header and description row size from the console row size. "start" and "end" are added in the efimenu structure. "start" keeps the menu entry index at the top, "end" keeps the bottom menu entry index. item_data_print() menu function only draws the menu entry between "start" and "end". This commit also fixes the issue that "Save" and "Quit" entries can be moved by BKEY_PLUS in change boot order menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
0d590852 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation This commit removes the change boot order specific menu implementation. The change boot order implementation calls eficonfig_process_common() same as other menus. The change boot order menu requires own item_data_print and item_choice implementation, but display_statusline function can be a same function as other menus. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
cd160b27 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor eficonfig_process_common function Current change boot order implementation does not call eficonfig_process_common() and call own menu functions for display_statusline, item_data_print and item_choice. Change boot order functionality should call eficonfig_process_common() to improve maintenanceability. This commit is a preparation to remove the change boot order specific implementation. The menu functions (display_statusline, item_data_print and item_choice) are added as argument of eficonfig_process_common(). The menu description string displayed at the bottom of the menu is also added as argument. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
32bab0ea |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Make use of CLI character processing Avoid duplicating some of the escape-sequence processing here and use the CLI function instead. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
d0ca98db |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Update bootmenu_loop() to return the code Use the return value to save having to pass around a pointer. This also resolves any ambiguity about what *key contains when the function is called. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
2da4a15e |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Rename KEY_... to BKEY_... This enum values conflict with linux/input.h so rename them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
64550274 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: avoid SetVariable between GetNextVariableName calls The current code calls efi_set_variable_int() to delete the invalid boot option between calls to efi_get_next_variable_name_int(), it may produce unpredictable results. This commit moves removal of the invalid boot option outside of the efi_get_next_variable_name_int() calls. EFI_NOT_FOUND returned from efi_get_next_variable_name_int() indicates we retrieved all EFI variables, it should be treated as EFI_SUCEESS. To address the checkpatch warning of too many leading tabs, combine two if statement into one. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
ce327084 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: carve out efi_get_next_variable_name_int calls To retrieve the EFI variable name by efi_get_next_variable_name_int(), the sequence of alloc -> efi_get_next_variable_name_int -> realloc -> efi_get_next_variable_name_int is required. In current code, this sequence repeatedly appears in the several functions. It should be curved out a common function. This commit also fixes the missing free() of var_name16 in eficonfig_delete_invalid_boot_option(). Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
140a8959 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use efi_get_next_variable_name_int() eficonfig command reads all possible UEFI load options from 0x0000 to 0xFFFF to construct the menu. This takes too much time in some environment. This commit uses efi_get_next_variable_name_int() to read all existing UEFI load options to significantlly reduce the count of efi_get_var() call. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
78b1ccc4 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use u16_strsize() to get u16 string buffer size Use u16_strsize() to simplify the u16 string buffer size calculation. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c67d3c9e |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix going one directory up issue The directory name in eficonfig menu entry contains the '\' separator. strcmp() argument ".." is wrong and one directory up handling does not work correctly. strcmp() argument must include '\' separator. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c3b5af63 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add UEFI Secure Boot Key enrollment interface This commit adds the menu-driven UEFI Secure Boot Key enrollment interface. User can enroll PK, KEK, db and dbx by selecting file. Only the signed EFI Signature List(s) with an authenticated header, typically '.auth' file, is accepted. To clear the PK, KEK, db and dbx, user needs to enroll the null key signed by PK or KEK. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
21faf4ef |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use protocol interface for file selection EFI_SIMPLE_FILE_SYSTEM_PROTOCOL is not always provided by U-Boot. Use protocol interface functions instead of U-Boot internal functions. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d6566113 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose eficonfig_create_device_path() Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use eficonfig_create_device_path() to construct the full device path from device path of the volume and file path, so move it out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d571f9b2 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation All the eficonfig menus other than "Change Boot Order" use 'eficonfig_entry' structure for each menu entry. This commit refactors change boot order implementation to use 'eficonfig_entry' structure same as other menus to have consistent menu handling. This commit also simplifies the data->active handling when KEY_SPACE is pressed, and sizeof() parameter. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
8961e93e |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose append entry function Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use append_entry() and append_quit_entry() to construct the menu, so move them out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
a84040ab |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor file selection handling eficonfig_select_file_handler() is commonly used to select the file. eficonfig_display_select_file_option() adds an additional menu to clear the selected file. eficonfig_display_select_file_option() is not always necessary for the file selection process, so it must be outside of eficonfig_select_file_handler(). This commit also renames the following functions to avoid confusion. eficonfig_select_file_handler() -> eficonfig_process_select_file() eficonfig_select_file() -> eficonfig_show_file_selection() eficonfig_display_select_file_option() -> eficonfig_process_show_file_option() Finally, test_eficonfig.py need to be updated to get aligned with the above modification. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
1167e88a |
|
14-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix missing variable initialization The 'ret' variable must be initialized before use in eficonfig_delete_invalid_boot_option(). Fixes: c416f1c0bc ("bootmenu: add removable media entries") Addresses-Coverity: 376207 ("Uninitialized variables") Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
3d595ac5 |
|
09-Nov-2022 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: remove superfluous if in eficonfig_edit_boot_option Goto for an immediately succeeding label is superfluous. Fixes: 87d791423ac6 ("eficonfig: menu-driven addition of UEFI boot option") Addresses-Coverity: 376202 ("Identical code for different branches") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
9945bc4f |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Fix incorrect return code of boot option update Correct the return code for out-of-memory and no boot option found Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
339b527b |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Move bootorder and bootoption apis to lib Rename and move bootorder and bootoption apis from cmd to lib for re-use between eficonfig and bootmgr Fix 'unexpected indentation' when 'make htmldocs' after functions are moved Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
2c0b0c31 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_SECURE_BOOT This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_SECURE_BOOT defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
83f3d121 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_MM_COMM_TEE This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_MM_COMM_TEE defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
88df3634 |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: CTRL+S to save the boot order 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>
|
#
45f5319f |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
menu: remove CTRL+C to quit On the sandbox called without "--terminal raw" CTRL+C leaves U-Boot, "ESC/CTRL+C to quit" is misleading. Let's remove CTRL+C to quit key handling from bootmenu and eficonfig menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
|
#
8dbd0a0f |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add vertical scroll support The current eficonfig menu does not support vertical scroll, so it can not display the menu entries greater than the console row size. This commit add the vertial scroll support. The console size is retrieved by SIMPLE_TEXT_OUTPUT_PROTOCOL.QueryMode() service, then calculates the row size for menu entry by subtracting menu header and description row size from the console row size. "start" and "end" are added in the efimenu structure. "start" keeps the menu entry index at the top, "end" keeps the bottom menu entry index. item_data_print() menu function only draws the menu entry between "start" and "end". This commit also fixes the issue that "Save" and "Quit" entries can be moved by BKEY_PLUS in change boot order menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
0d590852 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation This commit removes the change boot order specific menu implementation. The change boot order implementation calls eficonfig_process_common() same as other menus. The change boot order menu requires own item_data_print and item_choice implementation, but display_statusline function can be a same function as other menus. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
cd160b27 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor eficonfig_process_common function Current change boot order implementation does not call eficonfig_process_common() and call own menu functions for display_statusline, item_data_print and item_choice. Change boot order functionality should call eficonfig_process_common() to improve maintenanceability. This commit is a preparation to remove the change boot order specific implementation. The menu functions (display_statusline, item_data_print and item_choice) are added as argument of eficonfig_process_common(). The menu description string displayed at the bottom of the menu is also added as argument. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
32bab0ea |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Make use of CLI character processing Avoid duplicating some of the escape-sequence processing here and use the CLI function instead. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
d0ca98db |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Update bootmenu_loop() to return the code Use the return value to save having to pass around a pointer. This also resolves any ambiguity about what *key contains when the function is called. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
2da4a15e |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Rename KEY_... to BKEY_... This enum values conflict with linux/input.h so rename them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
64550274 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: avoid SetVariable between GetNextVariableName calls The current code calls efi_set_variable_int() to delete the invalid boot option between calls to efi_get_next_variable_name_int(), it may produce unpredictable results. This commit moves removal of the invalid boot option outside of the efi_get_next_variable_name_int() calls. EFI_NOT_FOUND returned from efi_get_next_variable_name_int() indicates we retrieved all EFI variables, it should be treated as EFI_SUCEESS. To address the checkpatch warning of too many leading tabs, combine two if statement into one. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
ce327084 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: carve out efi_get_next_variable_name_int calls To retrieve the EFI variable name by efi_get_next_variable_name_int(), the sequence of alloc -> efi_get_next_variable_name_int -> realloc -> efi_get_next_variable_name_int is required. In current code, this sequence repeatedly appears in the several functions. It should be curved out a common function. This commit also fixes the missing free() of var_name16 in eficonfig_delete_invalid_boot_option(). Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
140a8959 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use efi_get_next_variable_name_int() eficonfig command reads all possible UEFI load options from 0x0000 to 0xFFFF to construct the menu. This takes too much time in some environment. This commit uses efi_get_next_variable_name_int() to read all existing UEFI load options to significantlly reduce the count of efi_get_var() call. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
78b1ccc4 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use u16_strsize() to get u16 string buffer size Use u16_strsize() to simplify the u16 string buffer size calculation. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c67d3c9e |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix going one directory up issue The directory name in eficonfig menu entry contains the '\' separator. strcmp() argument ".." is wrong and one directory up handling does not work correctly. strcmp() argument must include '\' separator. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c3b5af63 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add UEFI Secure Boot Key enrollment interface This commit adds the menu-driven UEFI Secure Boot Key enrollment interface. User can enroll PK, KEK, db and dbx by selecting file. Only the signed EFI Signature List(s) with an authenticated header, typically '.auth' file, is accepted. To clear the PK, KEK, db and dbx, user needs to enroll the null key signed by PK or KEK. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
21faf4ef |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use protocol interface for file selection EFI_SIMPLE_FILE_SYSTEM_PROTOCOL is not always provided by U-Boot. Use protocol interface functions instead of U-Boot internal functions. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d6566113 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose eficonfig_create_device_path() Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use eficonfig_create_device_path() to construct the full device path from device path of the volume and file path, so move it out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d571f9b2 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation All the eficonfig menus other than "Change Boot Order" use 'eficonfig_entry' structure for each menu entry. This commit refactors change boot order implementation to use 'eficonfig_entry' structure same as other menus to have consistent menu handling. This commit also simplifies the data->active handling when KEY_SPACE is pressed, and sizeof() parameter. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
8961e93e |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose append entry function Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use append_entry() and append_quit_entry() to construct the menu, so move them out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
a84040ab |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor file selection handling eficonfig_select_file_handler() is commonly used to select the file. eficonfig_display_select_file_option() adds an additional menu to clear the selected file. eficonfig_display_select_file_option() is not always necessary for the file selection process, so it must be outside of eficonfig_select_file_handler(). This commit also renames the following functions to avoid confusion. eficonfig_select_file_handler() -> eficonfig_process_select_file() eficonfig_select_file() -> eficonfig_show_file_selection() eficonfig_display_select_file_option() -> eficonfig_process_show_file_option() Finally, test_eficonfig.py need to be updated to get aligned with the above modification. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
1167e88a |
|
14-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix missing variable initialization The 'ret' variable must be initialized before use in eficonfig_delete_invalid_boot_option(). Fixes: c416f1c0bc ("bootmenu: add removable media entries") Addresses-Coverity: 376207 ("Uninitialized variables") Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
3d595ac5 |
|
09-Nov-2022 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: remove superfluous if in eficonfig_edit_boot_option Goto for an immediately succeeding label is superfluous. Fixes: 87d791423ac6 ("eficonfig: menu-driven addition of UEFI boot option") Addresses-Coverity: 376202 ("Identical code for different branches") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
9945bc4f |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Fix incorrect return code of boot option update Correct the return code for out-of-memory and no boot option found Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
339b527b |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Move bootorder and bootoption apis to lib Rename and move bootorder and bootoption apis from cmd to lib for re-use between eficonfig and bootmgr Fix 'unexpected indentation' when 'make htmldocs' after functions are moved Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
2c0b0c31 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_SECURE_BOOT This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_SECURE_BOOT defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
83f3d121 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_MM_COMM_TEE This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_MM_COMM_TEE defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
88df3634 |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: CTRL+S to save the boot order 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>
|
#
45f5319f |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
menu: remove CTRL+C to quit On the sandbox called without "--terminal raw" CTRL+C leaves U-Boot, "ESC/CTRL+C to quit" is misleading. Let's remove CTRL+C to quit key handling from bootmenu and eficonfig menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
|
#
8dbd0a0f |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add vertical scroll support The current eficonfig menu does not support vertical scroll, so it can not display the menu entries greater than the console row size. This commit add the vertial scroll support. The console size is retrieved by SIMPLE_TEXT_OUTPUT_PROTOCOL.QueryMode() service, then calculates the row size for menu entry by subtracting menu header and description row size from the console row size. "start" and "end" are added in the efimenu structure. "start" keeps the menu entry index at the top, "end" keeps the bottom menu entry index. item_data_print() menu function only draws the menu entry between "start" and "end". This commit also fixes the issue that "Save" and "Quit" entries can be moved by BKEY_PLUS in change boot order menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
0d590852 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation This commit removes the change boot order specific menu implementation. The change boot order implementation calls eficonfig_process_common() same as other menus. The change boot order menu requires own item_data_print and item_choice implementation, but display_statusline function can be a same function as other menus. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
cd160b27 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor eficonfig_process_common function Current change boot order implementation does not call eficonfig_process_common() and call own menu functions for display_statusline, item_data_print and item_choice. Change boot order functionality should call eficonfig_process_common() to improve maintenanceability. This commit is a preparation to remove the change boot order specific implementation. The menu functions (display_statusline, item_data_print and item_choice) are added as argument of eficonfig_process_common(). The menu description string displayed at the bottom of the menu is also added as argument. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
32bab0ea |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Make use of CLI character processing Avoid duplicating some of the escape-sequence processing here and use the CLI function instead. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
d0ca98db |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Update bootmenu_loop() to return the code Use the return value to save having to pass around a pointer. This also resolves any ambiguity about what *key contains when the function is called. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
2da4a15e |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Rename KEY_... to BKEY_... This enum values conflict with linux/input.h so rename them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
64550274 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: avoid SetVariable between GetNextVariableName calls The current code calls efi_set_variable_int() to delete the invalid boot option between calls to efi_get_next_variable_name_int(), it may produce unpredictable results. This commit moves removal of the invalid boot option outside of the efi_get_next_variable_name_int() calls. EFI_NOT_FOUND returned from efi_get_next_variable_name_int() indicates we retrieved all EFI variables, it should be treated as EFI_SUCEESS. To address the checkpatch warning of too many leading tabs, combine two if statement into one. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
ce327084 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: carve out efi_get_next_variable_name_int calls To retrieve the EFI variable name by efi_get_next_variable_name_int(), the sequence of alloc -> efi_get_next_variable_name_int -> realloc -> efi_get_next_variable_name_int is required. In current code, this sequence repeatedly appears in the several functions. It should be curved out a common function. This commit also fixes the missing free() of var_name16 in eficonfig_delete_invalid_boot_option(). Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
140a8959 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use efi_get_next_variable_name_int() eficonfig command reads all possible UEFI load options from 0x0000 to 0xFFFF to construct the menu. This takes too much time in some environment. This commit uses efi_get_next_variable_name_int() to read all existing UEFI load options to significantlly reduce the count of efi_get_var() call. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
78b1ccc4 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use u16_strsize() to get u16 string buffer size Use u16_strsize() to simplify the u16 string buffer size calculation. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c67d3c9e |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix going one directory up issue The directory name in eficonfig menu entry contains the '\' separator. strcmp() argument ".." is wrong and one directory up handling does not work correctly. strcmp() argument must include '\' separator. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c3b5af63 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add UEFI Secure Boot Key enrollment interface This commit adds the menu-driven UEFI Secure Boot Key enrollment interface. User can enroll PK, KEK, db and dbx by selecting file. Only the signed EFI Signature List(s) with an authenticated header, typically '.auth' file, is accepted. To clear the PK, KEK, db and dbx, user needs to enroll the null key signed by PK or KEK. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
21faf4ef |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use protocol interface for file selection EFI_SIMPLE_FILE_SYSTEM_PROTOCOL is not always provided by U-Boot. Use protocol interface functions instead of U-Boot internal functions. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d6566113 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose eficonfig_create_device_path() Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use eficonfig_create_device_path() to construct the full device path from device path of the volume and file path, so move it out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d571f9b2 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation All the eficonfig menus other than "Change Boot Order" use 'eficonfig_entry' structure for each menu entry. This commit refactors change boot order implementation to use 'eficonfig_entry' structure same as other menus to have consistent menu handling. This commit also simplifies the data->active handling when KEY_SPACE is pressed, and sizeof() parameter. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
8961e93e |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose append entry function Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use append_entry() and append_quit_entry() to construct the menu, so move them out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
a84040ab |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor file selection handling eficonfig_select_file_handler() is commonly used to select the file. eficonfig_display_select_file_option() adds an additional menu to clear the selected file. eficonfig_display_select_file_option() is not always necessary for the file selection process, so it must be outside of eficonfig_select_file_handler(). This commit also renames the following functions to avoid confusion. eficonfig_select_file_handler() -> eficonfig_process_select_file() eficonfig_select_file() -> eficonfig_show_file_selection() eficonfig_display_select_file_option() -> eficonfig_process_show_file_option() Finally, test_eficonfig.py need to be updated to get aligned with the above modification. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
1167e88a |
|
14-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix missing variable initialization The 'ret' variable must be initialized before use in eficonfig_delete_invalid_boot_option(). Fixes: c416f1c0bc ("bootmenu: add removable media entries") Addresses-Coverity: 376207 ("Uninitialized variables") Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
3d595ac5 |
|
09-Nov-2022 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: remove superfluous if in eficonfig_edit_boot_option Goto for an immediately succeeding label is superfluous. Fixes: 87d791423ac6 ("eficonfig: menu-driven addition of UEFI boot option") Addresses-Coverity: 376202 ("Identical code for different branches") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
9945bc4f |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Fix incorrect return code of boot option update Correct the return code for out-of-memory and no boot option found Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
339b527b |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Move bootorder and bootoption apis to lib Rename and move bootorder and bootoption apis from cmd to lib for re-use between eficonfig and bootmgr Fix 'unexpected indentation' when 'make htmldocs' after functions are moved Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
2c0b0c31 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_SECURE_BOOT This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_SECURE_BOOT defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
83f3d121 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_MM_COMM_TEE This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_MM_COMM_TEE defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
88df3634 |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: CTRL+S to save the boot order 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>
|
#
45f5319f |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
menu: remove CTRL+C to quit On the sandbox called without "--terminal raw" CTRL+C leaves U-Boot, "ESC/CTRL+C to quit" is misleading. Let's remove CTRL+C to quit key handling from bootmenu and eficonfig menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
|
#
8dbd0a0f |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add vertical scroll support The current eficonfig menu does not support vertical scroll, so it can not display the menu entries greater than the console row size. This commit add the vertial scroll support. The console size is retrieved by SIMPLE_TEXT_OUTPUT_PROTOCOL.QueryMode() service, then calculates the row size for menu entry by subtracting menu header and description row size from the console row size. "start" and "end" are added in the efimenu structure. "start" keeps the menu entry index at the top, "end" keeps the bottom menu entry index. item_data_print() menu function only draws the menu entry between "start" and "end". This commit also fixes the issue that "Save" and "Quit" entries can be moved by BKEY_PLUS in change boot order menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
0d590852 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation This commit removes the change boot order specific menu implementation. The change boot order implementation calls eficonfig_process_common() same as other menus. The change boot order menu requires own item_data_print and item_choice implementation, but display_statusline function can be a same function as other menus. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
cd160b27 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor eficonfig_process_common function Current change boot order implementation does not call eficonfig_process_common() and call own menu functions for display_statusline, item_data_print and item_choice. Change boot order functionality should call eficonfig_process_common() to improve maintenanceability. This commit is a preparation to remove the change boot order specific implementation. The menu functions (display_statusline, item_data_print and item_choice) are added as argument of eficonfig_process_common(). The menu description string displayed at the bottom of the menu is also added as argument. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
32bab0ea |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Make use of CLI character processing Avoid duplicating some of the escape-sequence processing here and use the CLI function instead. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
d0ca98db |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Update bootmenu_loop() to return the code Use the return value to save having to pass around a pointer. This also resolves any ambiguity about what *key contains when the function is called. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
2da4a15e |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Rename KEY_... to BKEY_... This enum values conflict with linux/input.h so rename them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
64550274 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: avoid SetVariable between GetNextVariableName calls The current code calls efi_set_variable_int() to delete the invalid boot option between calls to efi_get_next_variable_name_int(), it may produce unpredictable results. This commit moves removal of the invalid boot option outside of the efi_get_next_variable_name_int() calls. EFI_NOT_FOUND returned from efi_get_next_variable_name_int() indicates we retrieved all EFI variables, it should be treated as EFI_SUCEESS. To address the checkpatch warning of too many leading tabs, combine two if statement into one. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
ce327084 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: carve out efi_get_next_variable_name_int calls To retrieve the EFI variable name by efi_get_next_variable_name_int(), the sequence of alloc -> efi_get_next_variable_name_int -> realloc -> efi_get_next_variable_name_int is required. In current code, this sequence repeatedly appears in the several functions. It should be curved out a common function. This commit also fixes the missing free() of var_name16 in eficonfig_delete_invalid_boot_option(). Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
140a8959 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use efi_get_next_variable_name_int() eficonfig command reads all possible UEFI load options from 0x0000 to 0xFFFF to construct the menu. This takes too much time in some environment. This commit uses efi_get_next_variable_name_int() to read all existing UEFI load options to significantlly reduce the count of efi_get_var() call. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
78b1ccc4 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use u16_strsize() to get u16 string buffer size Use u16_strsize() to simplify the u16 string buffer size calculation. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c67d3c9e |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix going one directory up issue The directory name in eficonfig menu entry contains the '\' separator. strcmp() argument ".." is wrong and one directory up handling does not work correctly. strcmp() argument must include '\' separator. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c3b5af63 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add UEFI Secure Boot Key enrollment interface This commit adds the menu-driven UEFI Secure Boot Key enrollment interface. User can enroll PK, KEK, db and dbx by selecting file. Only the signed EFI Signature List(s) with an authenticated header, typically '.auth' file, is accepted. To clear the PK, KEK, db and dbx, user needs to enroll the null key signed by PK or KEK. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
21faf4ef |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use protocol interface for file selection EFI_SIMPLE_FILE_SYSTEM_PROTOCOL is not always provided by U-Boot. Use protocol interface functions instead of U-Boot internal functions. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d6566113 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose eficonfig_create_device_path() Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use eficonfig_create_device_path() to construct the full device path from device path of the volume and file path, so move it out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d571f9b2 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation All the eficonfig menus other than "Change Boot Order" use 'eficonfig_entry' structure for each menu entry. This commit refactors change boot order implementation to use 'eficonfig_entry' structure same as other menus to have consistent menu handling. This commit also simplifies the data->active handling when KEY_SPACE is pressed, and sizeof() parameter. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
8961e93e |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose append entry function Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use append_entry() and append_quit_entry() to construct the menu, so move them out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
a84040ab |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor file selection handling eficonfig_select_file_handler() is commonly used to select the file. eficonfig_display_select_file_option() adds an additional menu to clear the selected file. eficonfig_display_select_file_option() is not always necessary for the file selection process, so it must be outside of eficonfig_select_file_handler(). This commit also renames the following functions to avoid confusion. eficonfig_select_file_handler() -> eficonfig_process_select_file() eficonfig_select_file() -> eficonfig_show_file_selection() eficonfig_display_select_file_option() -> eficonfig_process_show_file_option() Finally, test_eficonfig.py need to be updated to get aligned with the above modification. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
1167e88a |
|
14-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix missing variable initialization The 'ret' variable must be initialized before use in eficonfig_delete_invalid_boot_option(). Fixes: c416f1c0bc ("bootmenu: add removable media entries") Addresses-Coverity: 376207 ("Uninitialized variables") Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
3d595ac5 |
|
09-Nov-2022 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: remove superfluous if in eficonfig_edit_boot_option Goto for an immediately succeeding label is superfluous. Fixes: 87d791423ac6 ("eficonfig: menu-driven addition of UEFI boot option") Addresses-Coverity: 376202 ("Identical code for different branches") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
9945bc4f |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Fix incorrect return code of boot option update Correct the return code for out-of-memory and no boot option found Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
339b527b |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Move bootorder and bootoption apis to lib Rename and move bootorder and bootoption apis from cmd to lib for re-use between eficonfig and bootmgr Fix 'unexpected indentation' when 'make htmldocs' after functions are moved Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
2c0b0c31 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_SECURE_BOOT This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_SECURE_BOOT defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
83f3d121 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_MM_COMM_TEE This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_MM_COMM_TEE defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
88df3634 |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: CTRL+S to save the boot order 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>
|
#
45f5319f |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
menu: remove CTRL+C to quit On the sandbox called without "--terminal raw" CTRL+C leaves U-Boot, "ESC/CTRL+C to quit" is misleading. Let's remove CTRL+C to quit key handling from bootmenu and eficonfig menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
|
#
8dbd0a0f |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add vertical scroll support The current eficonfig menu does not support vertical scroll, so it can not display the menu entries greater than the console row size. This commit add the vertial scroll support. The console size is retrieved by SIMPLE_TEXT_OUTPUT_PROTOCOL.QueryMode() service, then calculates the row size for menu entry by subtracting menu header and description row size from the console row size. "start" and "end" are added in the efimenu structure. "start" keeps the menu entry index at the top, "end" keeps the bottom menu entry index. item_data_print() menu function only draws the menu entry between "start" and "end". This commit also fixes the issue that "Save" and "Quit" entries can be moved by BKEY_PLUS in change boot order menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
0d590852 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation This commit removes the change boot order specific menu implementation. The change boot order implementation calls eficonfig_process_common() same as other menus. The change boot order menu requires own item_data_print and item_choice implementation, but display_statusline function can be a same function as other menus. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
cd160b27 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor eficonfig_process_common function Current change boot order implementation does not call eficonfig_process_common() and call own menu functions for display_statusline, item_data_print and item_choice. Change boot order functionality should call eficonfig_process_common() to improve maintenanceability. This commit is a preparation to remove the change boot order specific implementation. The menu functions (display_statusline, item_data_print and item_choice) are added as argument of eficonfig_process_common(). The menu description string displayed at the bottom of the menu is also added as argument. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
32bab0ea |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Make use of CLI character processing Avoid duplicating some of the escape-sequence processing here and use the CLI function instead. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
d0ca98db |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Update bootmenu_loop() to return the code Use the return value to save having to pass around a pointer. This also resolves any ambiguity about what *key contains when the function is called. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
2da4a15e |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Rename KEY_... to BKEY_... This enum values conflict with linux/input.h so rename them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
64550274 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: avoid SetVariable between GetNextVariableName calls The current code calls efi_set_variable_int() to delete the invalid boot option between calls to efi_get_next_variable_name_int(), it may produce unpredictable results. This commit moves removal of the invalid boot option outside of the efi_get_next_variable_name_int() calls. EFI_NOT_FOUND returned from efi_get_next_variable_name_int() indicates we retrieved all EFI variables, it should be treated as EFI_SUCEESS. To address the checkpatch warning of too many leading tabs, combine two if statement into one. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
ce327084 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: carve out efi_get_next_variable_name_int calls To retrieve the EFI variable name by efi_get_next_variable_name_int(), the sequence of alloc -> efi_get_next_variable_name_int -> realloc -> efi_get_next_variable_name_int is required. In current code, this sequence repeatedly appears in the several functions. It should be curved out a common function. This commit also fixes the missing free() of var_name16 in eficonfig_delete_invalid_boot_option(). Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
140a8959 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use efi_get_next_variable_name_int() eficonfig command reads all possible UEFI load options from 0x0000 to 0xFFFF to construct the menu. This takes too much time in some environment. This commit uses efi_get_next_variable_name_int() to read all existing UEFI load options to significantlly reduce the count of efi_get_var() call. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
78b1ccc4 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use u16_strsize() to get u16 string buffer size Use u16_strsize() to simplify the u16 string buffer size calculation. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c67d3c9e |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix going one directory up issue The directory name in eficonfig menu entry contains the '\' separator. strcmp() argument ".." is wrong and one directory up handling does not work correctly. strcmp() argument must include '\' separator. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c3b5af63 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add UEFI Secure Boot Key enrollment interface This commit adds the menu-driven UEFI Secure Boot Key enrollment interface. User can enroll PK, KEK, db and dbx by selecting file. Only the signed EFI Signature List(s) with an authenticated header, typically '.auth' file, is accepted. To clear the PK, KEK, db and dbx, user needs to enroll the null key signed by PK or KEK. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
21faf4ef |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use protocol interface for file selection EFI_SIMPLE_FILE_SYSTEM_PROTOCOL is not always provided by U-Boot. Use protocol interface functions instead of U-Boot internal functions. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d6566113 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose eficonfig_create_device_path() Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use eficonfig_create_device_path() to construct the full device path from device path of the volume and file path, so move it out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d571f9b2 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation All the eficonfig menus other than "Change Boot Order" use 'eficonfig_entry' structure for each menu entry. This commit refactors change boot order implementation to use 'eficonfig_entry' structure same as other menus to have consistent menu handling. This commit also simplifies the data->active handling when KEY_SPACE is pressed, and sizeof() parameter. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
8961e93e |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose append entry function Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use append_entry() and append_quit_entry() to construct the menu, so move them out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
a84040ab |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor file selection handling eficonfig_select_file_handler() is commonly used to select the file. eficonfig_display_select_file_option() adds an additional menu to clear the selected file. eficonfig_display_select_file_option() is not always necessary for the file selection process, so it must be outside of eficonfig_select_file_handler(). This commit also renames the following functions to avoid confusion. eficonfig_select_file_handler() -> eficonfig_process_select_file() eficonfig_select_file() -> eficonfig_show_file_selection() eficonfig_display_select_file_option() -> eficonfig_process_show_file_option() Finally, test_eficonfig.py need to be updated to get aligned with the above modification. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
1167e88a |
|
14-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix missing variable initialization The 'ret' variable must be initialized before use in eficonfig_delete_invalid_boot_option(). Fixes: c416f1c0bc ("bootmenu: add removable media entries") Addresses-Coverity: 376207 ("Uninitialized variables") Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
3d595ac5 |
|
09-Nov-2022 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: remove superfluous if in eficonfig_edit_boot_option Goto for an immediately succeeding label is superfluous. Fixes: 87d791423ac6 ("eficonfig: menu-driven addition of UEFI boot option") Addresses-Coverity: 376202 ("Identical code for different branches") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
9945bc4f |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Fix incorrect return code of boot option update Correct the return code for out-of-memory and no boot option found Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
339b527b |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Move bootorder and bootoption apis to lib Rename and move bootorder and bootoption apis from cmd to lib for re-use between eficonfig and bootmgr Fix 'unexpected indentation' when 'make htmldocs' after functions are moved Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
2c0b0c31 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_SECURE_BOOT This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_SECURE_BOOT defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
83f3d121 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_MM_COMM_TEE This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_MM_COMM_TEE defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
88df3634 |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: CTRL+S to save the boot order 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>
|
#
45f5319f |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
menu: remove CTRL+C to quit On the sandbox called without "--terminal raw" CTRL+C leaves U-Boot, "ESC/CTRL+C to quit" is misleading. Let's remove CTRL+C to quit key handling from bootmenu and eficonfig menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
|
#
8dbd0a0f |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add vertical scroll support The current eficonfig menu does not support vertical scroll, so it can not display the menu entries greater than the console row size. This commit add the vertial scroll support. The console size is retrieved by SIMPLE_TEXT_OUTPUT_PROTOCOL.QueryMode() service, then calculates the row size for menu entry by subtracting menu header and description row size from the console row size. "start" and "end" are added in the efimenu structure. "start" keeps the menu entry index at the top, "end" keeps the bottom menu entry index. item_data_print() menu function only draws the menu entry between "start" and "end". This commit also fixes the issue that "Save" and "Quit" entries can be moved by BKEY_PLUS in change boot order menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
0d590852 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation This commit removes the change boot order specific menu implementation. The change boot order implementation calls eficonfig_process_common() same as other menus. The change boot order menu requires own item_data_print and item_choice implementation, but display_statusline function can be a same function as other menus. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
cd160b27 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor eficonfig_process_common function Current change boot order implementation does not call eficonfig_process_common() and call own menu functions for display_statusline, item_data_print and item_choice. Change boot order functionality should call eficonfig_process_common() to improve maintenanceability. This commit is a preparation to remove the change boot order specific implementation. The menu functions (display_statusline, item_data_print and item_choice) are added as argument of eficonfig_process_common(). The menu description string displayed at the bottom of the menu is also added as argument. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
32bab0ea |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Make use of CLI character processing Avoid duplicating some of the escape-sequence processing here and use the CLI function instead. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
d0ca98db |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Update bootmenu_loop() to return the code Use the return value to save having to pass around a pointer. This also resolves any ambiguity about what *key contains when the function is called. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
2da4a15e |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Rename KEY_... to BKEY_... This enum values conflict with linux/input.h so rename them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
64550274 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: avoid SetVariable between GetNextVariableName calls The current code calls efi_set_variable_int() to delete the invalid boot option between calls to efi_get_next_variable_name_int(), it may produce unpredictable results. This commit moves removal of the invalid boot option outside of the efi_get_next_variable_name_int() calls. EFI_NOT_FOUND returned from efi_get_next_variable_name_int() indicates we retrieved all EFI variables, it should be treated as EFI_SUCEESS. To address the checkpatch warning of too many leading tabs, combine two if statement into one. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
ce327084 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: carve out efi_get_next_variable_name_int calls To retrieve the EFI variable name by efi_get_next_variable_name_int(), the sequence of alloc -> efi_get_next_variable_name_int -> realloc -> efi_get_next_variable_name_int is required. In current code, this sequence repeatedly appears in the several functions. It should be curved out a common function. This commit also fixes the missing free() of var_name16 in eficonfig_delete_invalid_boot_option(). Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
140a8959 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use efi_get_next_variable_name_int() eficonfig command reads all possible UEFI load options from 0x0000 to 0xFFFF to construct the menu. This takes too much time in some environment. This commit uses efi_get_next_variable_name_int() to read all existing UEFI load options to significantlly reduce the count of efi_get_var() call. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
78b1ccc4 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use u16_strsize() to get u16 string buffer size Use u16_strsize() to simplify the u16 string buffer size calculation. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c67d3c9e |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix going one directory up issue The directory name in eficonfig menu entry contains the '\' separator. strcmp() argument ".." is wrong and one directory up handling does not work correctly. strcmp() argument must include '\' separator. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c3b5af63 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add UEFI Secure Boot Key enrollment interface This commit adds the menu-driven UEFI Secure Boot Key enrollment interface. User can enroll PK, KEK, db and dbx by selecting file. Only the signed EFI Signature List(s) with an authenticated header, typically '.auth' file, is accepted. To clear the PK, KEK, db and dbx, user needs to enroll the null key signed by PK or KEK. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
21faf4ef |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use protocol interface for file selection EFI_SIMPLE_FILE_SYSTEM_PROTOCOL is not always provided by U-Boot. Use protocol interface functions instead of U-Boot internal functions. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d6566113 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose eficonfig_create_device_path() Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use eficonfig_create_device_path() to construct the full device path from device path of the volume and file path, so move it out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d571f9b2 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation All the eficonfig menus other than "Change Boot Order" use 'eficonfig_entry' structure for each menu entry. This commit refactors change boot order implementation to use 'eficonfig_entry' structure same as other menus to have consistent menu handling. This commit also simplifies the data->active handling when KEY_SPACE is pressed, and sizeof() parameter. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
8961e93e |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose append entry function Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use append_entry() and append_quit_entry() to construct the menu, so move them out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
a84040ab |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor file selection handling eficonfig_select_file_handler() is commonly used to select the file. eficonfig_display_select_file_option() adds an additional menu to clear the selected file. eficonfig_display_select_file_option() is not always necessary for the file selection process, so it must be outside of eficonfig_select_file_handler(). This commit also renames the following functions to avoid confusion. eficonfig_select_file_handler() -> eficonfig_process_select_file() eficonfig_select_file() -> eficonfig_show_file_selection() eficonfig_display_select_file_option() -> eficonfig_process_show_file_option() Finally, test_eficonfig.py need to be updated to get aligned with the above modification. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
1167e88a |
|
14-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix missing variable initialization The 'ret' variable must be initialized before use in eficonfig_delete_invalid_boot_option(). Fixes: c416f1c0bc ("bootmenu: add removable media entries") Addresses-Coverity: 376207 ("Uninitialized variables") Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
3d595ac5 |
|
09-Nov-2022 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: remove superfluous if in eficonfig_edit_boot_option Goto for an immediately succeeding label is superfluous. Fixes: 87d791423ac6 ("eficonfig: menu-driven addition of UEFI boot option") Addresses-Coverity: 376202 ("Identical code for different branches") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
9945bc4f |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Fix incorrect return code of boot option update Correct the return code for out-of-memory and no boot option found Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
339b527b |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Move bootorder and bootoption apis to lib Rename and move bootorder and bootoption apis from cmd to lib for re-use between eficonfig and bootmgr Fix 'unexpected indentation' when 'make htmldocs' after functions are moved Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
2c0b0c31 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_SECURE_BOOT This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_SECURE_BOOT defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
83f3d121 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_MM_COMM_TEE This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_MM_COMM_TEE defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
88df3634 |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: CTRL+S to save the boot order 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>
|
#
45f5319f |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
menu: remove CTRL+C to quit On the sandbox called without "--terminal raw" CTRL+C leaves U-Boot, "ESC/CTRL+C to quit" is misleading. Let's remove CTRL+C to quit key handling from bootmenu and eficonfig menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
|
#
8dbd0a0f |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add vertical scroll support The current eficonfig menu does not support vertical scroll, so it can not display the menu entries greater than the console row size. This commit add the vertial scroll support. The console size is retrieved by SIMPLE_TEXT_OUTPUT_PROTOCOL.QueryMode() service, then calculates the row size for menu entry by subtracting menu header and description row size from the console row size. "start" and "end" are added in the efimenu structure. "start" keeps the menu entry index at the top, "end" keeps the bottom menu entry index. item_data_print() menu function only draws the menu entry between "start" and "end". This commit also fixes the issue that "Save" and "Quit" entries can be moved by BKEY_PLUS in change boot order menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
0d590852 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation This commit removes the change boot order specific menu implementation. The change boot order implementation calls eficonfig_process_common() same as other menus. The change boot order menu requires own item_data_print and item_choice implementation, but display_statusline function can be a same function as other menus. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
cd160b27 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor eficonfig_process_common function Current change boot order implementation does not call eficonfig_process_common() and call own menu functions for display_statusline, item_data_print and item_choice. Change boot order functionality should call eficonfig_process_common() to improve maintenanceability. This commit is a preparation to remove the change boot order specific implementation. The menu functions (display_statusline, item_data_print and item_choice) are added as argument of eficonfig_process_common(). The menu description string displayed at the bottom of the menu is also added as argument. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
32bab0ea |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Make use of CLI character processing Avoid duplicating some of the escape-sequence processing here and use the CLI function instead. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
d0ca98db |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Update bootmenu_loop() to return the code Use the return value to save having to pass around a pointer. This also resolves any ambiguity about what *key contains when the function is called. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
2da4a15e |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Rename KEY_... to BKEY_... This enum values conflict with linux/input.h so rename them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
64550274 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: avoid SetVariable between GetNextVariableName calls The current code calls efi_set_variable_int() to delete the invalid boot option between calls to efi_get_next_variable_name_int(), it may produce unpredictable results. This commit moves removal of the invalid boot option outside of the efi_get_next_variable_name_int() calls. EFI_NOT_FOUND returned from efi_get_next_variable_name_int() indicates we retrieved all EFI variables, it should be treated as EFI_SUCEESS. To address the checkpatch warning of too many leading tabs, combine two if statement into one. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
ce327084 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: carve out efi_get_next_variable_name_int calls To retrieve the EFI variable name by efi_get_next_variable_name_int(), the sequence of alloc -> efi_get_next_variable_name_int -> realloc -> efi_get_next_variable_name_int is required. In current code, this sequence repeatedly appears in the several functions. It should be curved out a common function. This commit also fixes the missing free() of var_name16 in eficonfig_delete_invalid_boot_option(). Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
140a8959 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use efi_get_next_variable_name_int() eficonfig command reads all possible UEFI load options from 0x0000 to 0xFFFF to construct the menu. This takes too much time in some environment. This commit uses efi_get_next_variable_name_int() to read all existing UEFI load options to significantlly reduce the count of efi_get_var() call. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
78b1ccc4 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use u16_strsize() to get u16 string buffer size Use u16_strsize() to simplify the u16 string buffer size calculation. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c67d3c9e |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix going one directory up issue The directory name in eficonfig menu entry contains the '\' separator. strcmp() argument ".." is wrong and one directory up handling does not work correctly. strcmp() argument must include '\' separator. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c3b5af63 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add UEFI Secure Boot Key enrollment interface This commit adds the menu-driven UEFI Secure Boot Key enrollment interface. User can enroll PK, KEK, db and dbx by selecting file. Only the signed EFI Signature List(s) with an authenticated header, typically '.auth' file, is accepted. To clear the PK, KEK, db and dbx, user needs to enroll the null key signed by PK or KEK. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
21faf4ef |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use protocol interface for file selection EFI_SIMPLE_FILE_SYSTEM_PROTOCOL is not always provided by U-Boot. Use protocol interface functions instead of U-Boot internal functions. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d6566113 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose eficonfig_create_device_path() Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use eficonfig_create_device_path() to construct the full device path from device path of the volume and file path, so move it out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d571f9b2 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation All the eficonfig menus other than "Change Boot Order" use 'eficonfig_entry' structure for each menu entry. This commit refactors change boot order implementation to use 'eficonfig_entry' structure same as other menus to have consistent menu handling. This commit also simplifies the data->active handling when KEY_SPACE is pressed, and sizeof() parameter. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
8961e93e |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose append entry function Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use append_entry() and append_quit_entry() to construct the menu, so move them out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
a84040ab |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor file selection handling eficonfig_select_file_handler() is commonly used to select the file. eficonfig_display_select_file_option() adds an additional menu to clear the selected file. eficonfig_display_select_file_option() is not always necessary for the file selection process, so it must be outside of eficonfig_select_file_handler(). This commit also renames the following functions to avoid confusion. eficonfig_select_file_handler() -> eficonfig_process_select_file() eficonfig_select_file() -> eficonfig_show_file_selection() eficonfig_display_select_file_option() -> eficonfig_process_show_file_option() Finally, test_eficonfig.py need to be updated to get aligned with the above modification. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
1167e88a |
|
14-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix missing variable initialization The 'ret' variable must be initialized before use in eficonfig_delete_invalid_boot_option(). Fixes: c416f1c0bc ("bootmenu: add removable media entries") Addresses-Coverity: 376207 ("Uninitialized variables") Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
3d595ac5 |
|
09-Nov-2022 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: remove superfluous if in eficonfig_edit_boot_option Goto for an immediately succeeding label is superfluous. Fixes: 87d791423ac6 ("eficonfig: menu-driven addition of UEFI boot option") Addresses-Coverity: 376202 ("Identical code for different branches") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
9945bc4f |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Fix incorrect return code of boot option update Correct the return code for out-of-memory and no boot option found Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
339b527b |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Move bootorder and bootoption apis to lib Rename and move bootorder and bootoption apis from cmd to lib for re-use between eficonfig and bootmgr Fix 'unexpected indentation' when 'make htmldocs' after functions are moved Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
2c0b0c31 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_SECURE_BOOT This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_SECURE_BOOT defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
83f3d121 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_MM_COMM_TEE This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_MM_COMM_TEE defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
88df3634 |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: CTRL+S to save the boot order 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>
|
#
45f5319f |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
menu: remove CTRL+C to quit On the sandbox called without "--terminal raw" CTRL+C leaves U-Boot, "ESC/CTRL+C to quit" is misleading. Let's remove CTRL+C to quit key handling from bootmenu and eficonfig menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
|
#
8dbd0a0f |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add vertical scroll support The current eficonfig menu does not support vertical scroll, so it can not display the menu entries greater than the console row size. This commit add the vertial scroll support. The console size is retrieved by SIMPLE_TEXT_OUTPUT_PROTOCOL.QueryMode() service, then calculates the row size for menu entry by subtracting menu header and description row size from the console row size. "start" and "end" are added in the efimenu structure. "start" keeps the menu entry index at the top, "end" keeps the bottom menu entry index. item_data_print() menu function only draws the menu entry between "start" and "end". This commit also fixes the issue that "Save" and "Quit" entries can be moved by BKEY_PLUS in change boot order menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
0d590852 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation This commit removes the change boot order specific menu implementation. The change boot order implementation calls eficonfig_process_common() same as other menus. The change boot order menu requires own item_data_print and item_choice implementation, but display_statusline function can be a same function as other menus. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
cd160b27 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor eficonfig_process_common function Current change boot order implementation does not call eficonfig_process_common() and call own menu functions for display_statusline, item_data_print and item_choice. Change boot order functionality should call eficonfig_process_common() to improve maintenanceability. This commit is a preparation to remove the change boot order specific implementation. The menu functions (display_statusline, item_data_print and item_choice) are added as argument of eficonfig_process_common(). The menu description string displayed at the bottom of the menu is also added as argument. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
32bab0ea |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Make use of CLI character processing Avoid duplicating some of the escape-sequence processing here and use the CLI function instead. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
d0ca98db |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Update bootmenu_loop() to return the code Use the return value to save having to pass around a pointer. This also resolves any ambiguity about what *key contains when the function is called. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
2da4a15e |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Rename KEY_... to BKEY_... This enum values conflict with linux/input.h so rename them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
64550274 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: avoid SetVariable between GetNextVariableName calls The current code calls efi_set_variable_int() to delete the invalid boot option between calls to efi_get_next_variable_name_int(), it may produce unpredictable results. This commit moves removal of the invalid boot option outside of the efi_get_next_variable_name_int() calls. EFI_NOT_FOUND returned from efi_get_next_variable_name_int() indicates we retrieved all EFI variables, it should be treated as EFI_SUCEESS. To address the checkpatch warning of too many leading tabs, combine two if statement into one. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
ce327084 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: carve out efi_get_next_variable_name_int calls To retrieve the EFI variable name by efi_get_next_variable_name_int(), the sequence of alloc -> efi_get_next_variable_name_int -> realloc -> efi_get_next_variable_name_int is required. In current code, this sequence repeatedly appears in the several functions. It should be curved out a common function. This commit also fixes the missing free() of var_name16 in eficonfig_delete_invalid_boot_option(). Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
140a8959 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use efi_get_next_variable_name_int() eficonfig command reads all possible UEFI load options from 0x0000 to 0xFFFF to construct the menu. This takes too much time in some environment. This commit uses efi_get_next_variable_name_int() to read all existing UEFI load options to significantlly reduce the count of efi_get_var() call. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
78b1ccc4 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use u16_strsize() to get u16 string buffer size Use u16_strsize() to simplify the u16 string buffer size calculation. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c67d3c9e |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix going one directory up issue The directory name in eficonfig menu entry contains the '\' separator. strcmp() argument ".." is wrong and one directory up handling does not work correctly. strcmp() argument must include '\' separator. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c3b5af63 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add UEFI Secure Boot Key enrollment interface This commit adds the menu-driven UEFI Secure Boot Key enrollment interface. User can enroll PK, KEK, db and dbx by selecting file. Only the signed EFI Signature List(s) with an authenticated header, typically '.auth' file, is accepted. To clear the PK, KEK, db and dbx, user needs to enroll the null key signed by PK or KEK. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
21faf4ef |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use protocol interface for file selection EFI_SIMPLE_FILE_SYSTEM_PROTOCOL is not always provided by U-Boot. Use protocol interface functions instead of U-Boot internal functions. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d6566113 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose eficonfig_create_device_path() Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use eficonfig_create_device_path() to construct the full device path from device path of the volume and file path, so move it out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d571f9b2 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation All the eficonfig menus other than "Change Boot Order" use 'eficonfig_entry' structure for each menu entry. This commit refactors change boot order implementation to use 'eficonfig_entry' structure same as other menus to have consistent menu handling. This commit also simplifies the data->active handling when KEY_SPACE is pressed, and sizeof() parameter. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
8961e93e |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose append entry function Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use append_entry() and append_quit_entry() to construct the menu, so move them out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
a84040ab |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor file selection handling eficonfig_select_file_handler() is commonly used to select the file. eficonfig_display_select_file_option() adds an additional menu to clear the selected file. eficonfig_display_select_file_option() is not always necessary for the file selection process, so it must be outside of eficonfig_select_file_handler(). This commit also renames the following functions to avoid confusion. eficonfig_select_file_handler() -> eficonfig_process_select_file() eficonfig_select_file() -> eficonfig_show_file_selection() eficonfig_display_select_file_option() -> eficonfig_process_show_file_option() Finally, test_eficonfig.py need to be updated to get aligned with the above modification. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
1167e88a |
|
14-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix missing variable initialization The 'ret' variable must be initialized before use in eficonfig_delete_invalid_boot_option(). Fixes: c416f1c0bc ("bootmenu: add removable media entries") Addresses-Coverity: 376207 ("Uninitialized variables") Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
3d595ac5 |
|
09-Nov-2022 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: remove superfluous if in eficonfig_edit_boot_option Goto for an immediately succeeding label is superfluous. Fixes: 87d791423ac6 ("eficonfig: menu-driven addition of UEFI boot option") Addresses-Coverity: 376202 ("Identical code for different branches") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
9945bc4f |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Fix incorrect return code of boot option update Correct the return code for out-of-memory and no boot option found Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
339b527b |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Move bootorder and bootoption apis to lib Rename and move bootorder and bootoption apis from cmd to lib for re-use between eficonfig and bootmgr Fix 'unexpected indentation' when 'make htmldocs' after functions are moved Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
2c0b0c31 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_SECURE_BOOT This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_SECURE_BOOT defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
83f3d121 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_MM_COMM_TEE This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_MM_COMM_TEE defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
88df3634 |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: CTRL+S to save the boot order 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>
|
#
45f5319f |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
menu: remove CTRL+C to quit On the sandbox called without "--terminal raw" CTRL+C leaves U-Boot, "ESC/CTRL+C to quit" is misleading. Let's remove CTRL+C to quit key handling from bootmenu and eficonfig menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
|
#
8dbd0a0f |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add vertical scroll support The current eficonfig menu does not support vertical scroll, so it can not display the menu entries greater than the console row size. This commit add the vertial scroll support. The console size is retrieved by SIMPLE_TEXT_OUTPUT_PROTOCOL.QueryMode() service, then calculates the row size for menu entry by subtracting menu header and description row size from the console row size. "start" and "end" are added in the efimenu structure. "start" keeps the menu entry index at the top, "end" keeps the bottom menu entry index. item_data_print() menu function only draws the menu entry between "start" and "end". This commit also fixes the issue that "Save" and "Quit" entries can be moved by BKEY_PLUS in change boot order menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
0d590852 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation This commit removes the change boot order specific menu implementation. The change boot order implementation calls eficonfig_process_common() same as other menus. The change boot order menu requires own item_data_print and item_choice implementation, but display_statusline function can be a same function as other menus. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
cd160b27 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor eficonfig_process_common function Current change boot order implementation does not call eficonfig_process_common() and call own menu functions for display_statusline, item_data_print and item_choice. Change boot order functionality should call eficonfig_process_common() to improve maintenanceability. This commit is a preparation to remove the change boot order specific implementation. The menu functions (display_statusline, item_data_print and item_choice) are added as argument of eficonfig_process_common(). The menu description string displayed at the bottom of the menu is also added as argument. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
32bab0ea |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Make use of CLI character processing Avoid duplicating some of the escape-sequence processing here and use the CLI function instead. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
d0ca98db |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Update bootmenu_loop() to return the code Use the return value to save having to pass around a pointer. This also resolves any ambiguity about what *key contains when the function is called. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
2da4a15e |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Rename KEY_... to BKEY_... This enum values conflict with linux/input.h so rename them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
64550274 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: avoid SetVariable between GetNextVariableName calls The current code calls efi_set_variable_int() to delete the invalid boot option between calls to efi_get_next_variable_name_int(), it may produce unpredictable results. This commit moves removal of the invalid boot option outside of the efi_get_next_variable_name_int() calls. EFI_NOT_FOUND returned from efi_get_next_variable_name_int() indicates we retrieved all EFI variables, it should be treated as EFI_SUCEESS. To address the checkpatch warning of too many leading tabs, combine two if statement into one. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
ce327084 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: carve out efi_get_next_variable_name_int calls To retrieve the EFI variable name by efi_get_next_variable_name_int(), the sequence of alloc -> efi_get_next_variable_name_int -> realloc -> efi_get_next_variable_name_int is required. In current code, this sequence repeatedly appears in the several functions. It should be curved out a common function. This commit also fixes the missing free() of var_name16 in eficonfig_delete_invalid_boot_option(). Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
140a8959 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use efi_get_next_variable_name_int() eficonfig command reads all possible UEFI load options from 0x0000 to 0xFFFF to construct the menu. This takes too much time in some environment. This commit uses efi_get_next_variable_name_int() to read all existing UEFI load options to significantlly reduce the count of efi_get_var() call. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
78b1ccc4 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use u16_strsize() to get u16 string buffer size Use u16_strsize() to simplify the u16 string buffer size calculation. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c67d3c9e |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix going one directory up issue The directory name in eficonfig menu entry contains the '\' separator. strcmp() argument ".." is wrong and one directory up handling does not work correctly. strcmp() argument must include '\' separator. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c3b5af63 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add UEFI Secure Boot Key enrollment interface This commit adds the menu-driven UEFI Secure Boot Key enrollment interface. User can enroll PK, KEK, db and dbx by selecting file. Only the signed EFI Signature List(s) with an authenticated header, typically '.auth' file, is accepted. To clear the PK, KEK, db and dbx, user needs to enroll the null key signed by PK or KEK. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
21faf4ef |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use protocol interface for file selection EFI_SIMPLE_FILE_SYSTEM_PROTOCOL is not always provided by U-Boot. Use protocol interface functions instead of U-Boot internal functions. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d6566113 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose eficonfig_create_device_path() Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use eficonfig_create_device_path() to construct the full device path from device path of the volume and file path, so move it out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d571f9b2 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation All the eficonfig menus other than "Change Boot Order" use 'eficonfig_entry' structure for each menu entry. This commit refactors change boot order implementation to use 'eficonfig_entry' structure same as other menus to have consistent menu handling. This commit also simplifies the data->active handling when KEY_SPACE is pressed, and sizeof() parameter. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
8961e93e |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose append entry function Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use append_entry() and append_quit_entry() to construct the menu, so move them out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
a84040ab |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor file selection handling eficonfig_select_file_handler() is commonly used to select the file. eficonfig_display_select_file_option() adds an additional menu to clear the selected file. eficonfig_display_select_file_option() is not always necessary for the file selection process, so it must be outside of eficonfig_select_file_handler(). This commit also renames the following functions to avoid confusion. eficonfig_select_file_handler() -> eficonfig_process_select_file() eficonfig_select_file() -> eficonfig_show_file_selection() eficonfig_display_select_file_option() -> eficonfig_process_show_file_option() Finally, test_eficonfig.py need to be updated to get aligned with the above modification. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
1167e88a |
|
14-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix missing variable initialization The 'ret' variable must be initialized before use in eficonfig_delete_invalid_boot_option(). Fixes: c416f1c0bc ("bootmenu: add removable media entries") Addresses-Coverity: 376207 ("Uninitialized variables") Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
3d595ac5 |
|
09-Nov-2022 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: remove superfluous if in eficonfig_edit_boot_option Goto for an immediately succeeding label is superfluous. Fixes: 87d791423ac6 ("eficonfig: menu-driven addition of UEFI boot option") Addresses-Coverity: 376202 ("Identical code for different branches") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
9945bc4f |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Fix incorrect return code of boot option update Correct the return code for out-of-memory and no boot option found Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
339b527b |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Move bootorder and bootoption apis to lib Rename and move bootorder and bootoption apis from cmd to lib for re-use between eficonfig and bootmgr Fix 'unexpected indentation' when 'make htmldocs' after functions are moved Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
2c0b0c31 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_SECURE_BOOT This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_SECURE_BOOT defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
83f3d121 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_MM_COMM_TEE This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_MM_COMM_TEE defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
88df3634 |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: CTRL+S to save the boot order 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>
|
#
45f5319f |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
menu: remove CTRL+C to quit On the sandbox called without "--terminal raw" CTRL+C leaves U-Boot, "ESC/CTRL+C to quit" is misleading. Let's remove CTRL+C to quit key handling from bootmenu and eficonfig menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
|
#
8dbd0a0f |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add vertical scroll support The current eficonfig menu does not support vertical scroll, so it can not display the menu entries greater than the console row size. This commit add the vertial scroll support. The console size is retrieved by SIMPLE_TEXT_OUTPUT_PROTOCOL.QueryMode() service, then calculates the row size for menu entry by subtracting menu header and description row size from the console row size. "start" and "end" are added in the efimenu structure. "start" keeps the menu entry index at the top, "end" keeps the bottom menu entry index. item_data_print() menu function only draws the menu entry between "start" and "end". This commit also fixes the issue that "Save" and "Quit" entries can be moved by BKEY_PLUS in change boot order menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
0d590852 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation This commit removes the change boot order specific menu implementation. The change boot order implementation calls eficonfig_process_common() same as other menus. The change boot order menu requires own item_data_print and item_choice implementation, but display_statusline function can be a same function as other menus. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
cd160b27 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor eficonfig_process_common function Current change boot order implementation does not call eficonfig_process_common() and call own menu functions for display_statusline, item_data_print and item_choice. Change boot order functionality should call eficonfig_process_common() to improve maintenanceability. This commit is a preparation to remove the change boot order specific implementation. The menu functions (display_statusline, item_data_print and item_choice) are added as argument of eficonfig_process_common(). The menu description string displayed at the bottom of the menu is also added as argument. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
32bab0ea |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Make use of CLI character processing Avoid duplicating some of the escape-sequence processing here and use the CLI function instead. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
d0ca98db |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Update bootmenu_loop() to return the code Use the return value to save having to pass around a pointer. This also resolves any ambiguity about what *key contains when the function is called. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
2da4a15e |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Rename KEY_... to BKEY_... This enum values conflict with linux/input.h so rename them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
64550274 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: avoid SetVariable between GetNextVariableName calls The current code calls efi_set_variable_int() to delete the invalid boot option between calls to efi_get_next_variable_name_int(), it may produce unpredictable results. This commit moves removal of the invalid boot option outside of the efi_get_next_variable_name_int() calls. EFI_NOT_FOUND returned from efi_get_next_variable_name_int() indicates we retrieved all EFI variables, it should be treated as EFI_SUCEESS. To address the checkpatch warning of too many leading tabs, combine two if statement into one. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
ce327084 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: carve out efi_get_next_variable_name_int calls To retrieve the EFI variable name by efi_get_next_variable_name_int(), the sequence of alloc -> efi_get_next_variable_name_int -> realloc -> efi_get_next_variable_name_int is required. In current code, this sequence repeatedly appears in the several functions. It should be curved out a common function. This commit also fixes the missing free() of var_name16 in eficonfig_delete_invalid_boot_option(). Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
140a8959 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use efi_get_next_variable_name_int() eficonfig command reads all possible UEFI load options from 0x0000 to 0xFFFF to construct the menu. This takes too much time in some environment. This commit uses efi_get_next_variable_name_int() to read all existing UEFI load options to significantlly reduce the count of efi_get_var() call. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
78b1ccc4 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use u16_strsize() to get u16 string buffer size Use u16_strsize() to simplify the u16 string buffer size calculation. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c67d3c9e |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix going one directory up issue The directory name in eficonfig menu entry contains the '\' separator. strcmp() argument ".." is wrong and one directory up handling does not work correctly. strcmp() argument must include '\' separator. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c3b5af63 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add UEFI Secure Boot Key enrollment interface This commit adds the menu-driven UEFI Secure Boot Key enrollment interface. User can enroll PK, KEK, db and dbx by selecting file. Only the signed EFI Signature List(s) with an authenticated header, typically '.auth' file, is accepted. To clear the PK, KEK, db and dbx, user needs to enroll the null key signed by PK or KEK. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
21faf4ef |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use protocol interface for file selection EFI_SIMPLE_FILE_SYSTEM_PROTOCOL is not always provided by U-Boot. Use protocol interface functions instead of U-Boot internal functions. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d6566113 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose eficonfig_create_device_path() Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use eficonfig_create_device_path() to construct the full device path from device path of the volume and file path, so move it out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d571f9b2 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation All the eficonfig menus other than "Change Boot Order" use 'eficonfig_entry' structure for each menu entry. This commit refactors change boot order implementation to use 'eficonfig_entry' structure same as other menus to have consistent menu handling. This commit also simplifies the data->active handling when KEY_SPACE is pressed, and sizeof() parameter. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
8961e93e |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose append entry function Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use append_entry() and append_quit_entry() to construct the menu, so move them out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
a84040ab |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor file selection handling eficonfig_select_file_handler() is commonly used to select the file. eficonfig_display_select_file_option() adds an additional menu to clear the selected file. eficonfig_display_select_file_option() is not always necessary for the file selection process, so it must be outside of eficonfig_select_file_handler(). This commit also renames the following functions to avoid confusion. eficonfig_select_file_handler() -> eficonfig_process_select_file() eficonfig_select_file() -> eficonfig_show_file_selection() eficonfig_display_select_file_option() -> eficonfig_process_show_file_option() Finally, test_eficonfig.py need to be updated to get aligned with the above modification. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
1167e88a |
|
14-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix missing variable initialization The 'ret' variable must be initialized before use in eficonfig_delete_invalid_boot_option(). Fixes: c416f1c0bc ("bootmenu: add removable media entries") Addresses-Coverity: 376207 ("Uninitialized variables") Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
3d595ac5 |
|
09-Nov-2022 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: remove superfluous if in eficonfig_edit_boot_option Goto for an immediately succeeding label is superfluous. Fixes: 87d791423ac6 ("eficonfig: menu-driven addition of UEFI boot option") Addresses-Coverity: 376202 ("Identical code for different branches") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
9945bc4f |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Fix incorrect return code of boot option update Correct the return code for out-of-memory and no boot option found Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
339b527b |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Move bootorder and bootoption apis to lib Rename and move bootorder and bootoption apis from cmd to lib for re-use between eficonfig and bootmgr Fix 'unexpected indentation' when 'make htmldocs' after functions are moved Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
2c0b0c31 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_SECURE_BOOT This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_SECURE_BOOT defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
83f3d121 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_MM_COMM_TEE This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_MM_COMM_TEE defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
88df3634 |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: CTRL+S to save the boot order 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>
|
#
45f5319f |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
menu: remove CTRL+C to quit On the sandbox called without "--terminal raw" CTRL+C leaves U-Boot, "ESC/CTRL+C to quit" is misleading. Let's remove CTRL+C to quit key handling from bootmenu and eficonfig menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
|
#
8dbd0a0f |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add vertical scroll support The current eficonfig menu does not support vertical scroll, so it can not display the menu entries greater than the console row size. This commit add the vertial scroll support. The console size is retrieved by SIMPLE_TEXT_OUTPUT_PROTOCOL.QueryMode() service, then calculates the row size for menu entry by subtracting menu header and description row size from the console row size. "start" and "end" are added in the efimenu structure. "start" keeps the menu entry index at the top, "end" keeps the bottom menu entry index. item_data_print() menu function only draws the menu entry between "start" and "end". This commit also fixes the issue that "Save" and "Quit" entries can be moved by BKEY_PLUS in change boot order menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
0d590852 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation This commit removes the change boot order specific menu implementation. The change boot order implementation calls eficonfig_process_common() same as other menus. The change boot order menu requires own item_data_print and item_choice implementation, but display_statusline function can be a same function as other menus. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
cd160b27 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor eficonfig_process_common function Current change boot order implementation does not call eficonfig_process_common() and call own menu functions for display_statusline, item_data_print and item_choice. Change boot order functionality should call eficonfig_process_common() to improve maintenanceability. This commit is a preparation to remove the change boot order specific implementation. The menu functions (display_statusline, item_data_print and item_choice) are added as argument of eficonfig_process_common(). The menu description string displayed at the bottom of the menu is also added as argument. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
32bab0ea |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Make use of CLI character processing Avoid duplicating some of the escape-sequence processing here and use the CLI function instead. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
d0ca98db |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Update bootmenu_loop() to return the code Use the return value to save having to pass around a pointer. This also resolves any ambiguity about what *key contains when the function is called. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
2da4a15e |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Rename KEY_... to BKEY_... This enum values conflict with linux/input.h so rename them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
64550274 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: avoid SetVariable between GetNextVariableName calls The current code calls efi_set_variable_int() to delete the invalid boot option between calls to efi_get_next_variable_name_int(), it may produce unpredictable results. This commit moves removal of the invalid boot option outside of the efi_get_next_variable_name_int() calls. EFI_NOT_FOUND returned from efi_get_next_variable_name_int() indicates we retrieved all EFI variables, it should be treated as EFI_SUCEESS. To address the checkpatch warning of too many leading tabs, combine two if statement into one. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
ce327084 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: carve out efi_get_next_variable_name_int calls To retrieve the EFI variable name by efi_get_next_variable_name_int(), the sequence of alloc -> efi_get_next_variable_name_int -> realloc -> efi_get_next_variable_name_int is required. In current code, this sequence repeatedly appears in the several functions. It should be curved out a common function. This commit also fixes the missing free() of var_name16 in eficonfig_delete_invalid_boot_option(). Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
140a8959 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use efi_get_next_variable_name_int() eficonfig command reads all possible UEFI load options from 0x0000 to 0xFFFF to construct the menu. This takes too much time in some environment. This commit uses efi_get_next_variable_name_int() to read all existing UEFI load options to significantlly reduce the count of efi_get_var() call. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
78b1ccc4 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use u16_strsize() to get u16 string buffer size Use u16_strsize() to simplify the u16 string buffer size calculation. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c67d3c9e |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix going one directory up issue The directory name in eficonfig menu entry contains the '\' separator. strcmp() argument ".." is wrong and one directory up handling does not work correctly. strcmp() argument must include '\' separator. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c3b5af63 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add UEFI Secure Boot Key enrollment interface This commit adds the menu-driven UEFI Secure Boot Key enrollment interface. User can enroll PK, KEK, db and dbx by selecting file. Only the signed EFI Signature List(s) with an authenticated header, typically '.auth' file, is accepted. To clear the PK, KEK, db and dbx, user needs to enroll the null key signed by PK or KEK. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
21faf4ef |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use protocol interface for file selection EFI_SIMPLE_FILE_SYSTEM_PROTOCOL is not always provided by U-Boot. Use protocol interface functions instead of U-Boot internal functions. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d6566113 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose eficonfig_create_device_path() Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use eficonfig_create_device_path() to construct the full device path from device path of the volume and file path, so move it out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d571f9b2 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation All the eficonfig menus other than "Change Boot Order" use 'eficonfig_entry' structure for each menu entry. This commit refactors change boot order implementation to use 'eficonfig_entry' structure same as other menus to have consistent menu handling. This commit also simplifies the data->active handling when KEY_SPACE is pressed, and sizeof() parameter. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
8961e93e |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose append entry function Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use append_entry() and append_quit_entry() to construct the menu, so move them out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
a84040ab |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor file selection handling eficonfig_select_file_handler() is commonly used to select the file. eficonfig_display_select_file_option() adds an additional menu to clear the selected file. eficonfig_display_select_file_option() is not always necessary for the file selection process, so it must be outside of eficonfig_select_file_handler(). This commit also renames the following functions to avoid confusion. eficonfig_select_file_handler() -> eficonfig_process_select_file() eficonfig_select_file() -> eficonfig_show_file_selection() eficonfig_display_select_file_option() -> eficonfig_process_show_file_option() Finally, test_eficonfig.py need to be updated to get aligned with the above modification. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
1167e88a |
|
14-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix missing variable initialization The 'ret' variable must be initialized before use in eficonfig_delete_invalid_boot_option(). Fixes: c416f1c0bc ("bootmenu: add removable media entries") Addresses-Coverity: 376207 ("Uninitialized variables") Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
3d595ac5 |
|
09-Nov-2022 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: remove superfluous if in eficonfig_edit_boot_option Goto for an immediately succeeding label is superfluous. Fixes: 87d791423ac6 ("eficonfig: menu-driven addition of UEFI boot option") Addresses-Coverity: 376202 ("Identical code for different branches") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
9945bc4f |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Fix incorrect return code of boot option update Correct the return code for out-of-memory and no boot option found Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
339b527b |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Move bootorder and bootoption apis to lib Rename and move bootorder and bootoption apis from cmd to lib for re-use between eficonfig and bootmgr Fix 'unexpected indentation' when 'make htmldocs' after functions are moved Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
2c0b0c31 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_SECURE_BOOT This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_SECURE_BOOT defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
83f3d121 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_MM_COMM_TEE This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_MM_COMM_TEE defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
88df3634 |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: CTRL+S to save the boot order 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>
|
#
45f5319f |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
menu: remove CTRL+C to quit On the sandbox called without "--terminal raw" CTRL+C leaves U-Boot, "ESC/CTRL+C to quit" is misleading. Let's remove CTRL+C to quit key handling from bootmenu and eficonfig menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
|
#
8dbd0a0f |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add vertical scroll support The current eficonfig menu does not support vertical scroll, so it can not display the menu entries greater than the console row size. This commit add the vertial scroll support. The console size is retrieved by SIMPLE_TEXT_OUTPUT_PROTOCOL.QueryMode() service, then calculates the row size for menu entry by subtracting menu header and description row size from the console row size. "start" and "end" are added in the efimenu structure. "start" keeps the menu entry index at the top, "end" keeps the bottom menu entry index. item_data_print() menu function only draws the menu entry between "start" and "end". This commit also fixes the issue that "Save" and "Quit" entries can be moved by BKEY_PLUS in change boot order menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
0d590852 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation This commit removes the change boot order specific menu implementation. The change boot order implementation calls eficonfig_process_common() same as other menus. The change boot order menu requires own item_data_print and item_choice implementation, but display_statusline function can be a same function as other menus. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
cd160b27 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor eficonfig_process_common function Current change boot order implementation does not call eficonfig_process_common() and call own menu functions for display_statusline, item_data_print and item_choice. Change boot order functionality should call eficonfig_process_common() to improve maintenanceability. This commit is a preparation to remove the change boot order specific implementation. The menu functions (display_statusline, item_data_print and item_choice) are added as argument of eficonfig_process_common(). The menu description string displayed at the bottom of the menu is also added as argument. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
32bab0ea |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Make use of CLI character processing Avoid duplicating some of the escape-sequence processing here and use the CLI function instead. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
d0ca98db |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Update bootmenu_loop() to return the code Use the return value to save having to pass around a pointer. This also resolves any ambiguity about what *key contains when the function is called. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
2da4a15e |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Rename KEY_... to BKEY_... This enum values conflict with linux/input.h so rename them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
64550274 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: avoid SetVariable between GetNextVariableName calls The current code calls efi_set_variable_int() to delete the invalid boot option between calls to efi_get_next_variable_name_int(), it may produce unpredictable results. This commit moves removal of the invalid boot option outside of the efi_get_next_variable_name_int() calls. EFI_NOT_FOUND returned from efi_get_next_variable_name_int() indicates we retrieved all EFI variables, it should be treated as EFI_SUCEESS. To address the checkpatch warning of too many leading tabs, combine two if statement into one. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
ce327084 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: carve out efi_get_next_variable_name_int calls To retrieve the EFI variable name by efi_get_next_variable_name_int(), the sequence of alloc -> efi_get_next_variable_name_int -> realloc -> efi_get_next_variable_name_int is required. In current code, this sequence repeatedly appears in the several functions. It should be curved out a common function. This commit also fixes the missing free() of var_name16 in eficonfig_delete_invalid_boot_option(). Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
140a8959 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use efi_get_next_variable_name_int() eficonfig command reads all possible UEFI load options from 0x0000 to 0xFFFF to construct the menu. This takes too much time in some environment. This commit uses efi_get_next_variable_name_int() to read all existing UEFI load options to significantlly reduce the count of efi_get_var() call. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
78b1ccc4 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use u16_strsize() to get u16 string buffer size Use u16_strsize() to simplify the u16 string buffer size calculation. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c67d3c9e |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix going one directory up issue The directory name in eficonfig menu entry contains the '\' separator. strcmp() argument ".." is wrong and one directory up handling does not work correctly. strcmp() argument must include '\' separator. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c3b5af63 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add UEFI Secure Boot Key enrollment interface This commit adds the menu-driven UEFI Secure Boot Key enrollment interface. User can enroll PK, KEK, db and dbx by selecting file. Only the signed EFI Signature List(s) with an authenticated header, typically '.auth' file, is accepted. To clear the PK, KEK, db and dbx, user needs to enroll the null key signed by PK or KEK. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
21faf4ef |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use protocol interface for file selection EFI_SIMPLE_FILE_SYSTEM_PROTOCOL is not always provided by U-Boot. Use protocol interface functions instead of U-Boot internal functions. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d6566113 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose eficonfig_create_device_path() Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use eficonfig_create_device_path() to construct the full device path from device path of the volume and file path, so move it out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d571f9b2 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation All the eficonfig menus other than "Change Boot Order" use 'eficonfig_entry' structure for each menu entry. This commit refactors change boot order implementation to use 'eficonfig_entry' structure same as other menus to have consistent menu handling. This commit also simplifies the data->active handling when KEY_SPACE is pressed, and sizeof() parameter. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
8961e93e |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose append entry function Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use append_entry() and append_quit_entry() to construct the menu, so move them out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
a84040ab |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor file selection handling eficonfig_select_file_handler() is commonly used to select the file. eficonfig_display_select_file_option() adds an additional menu to clear the selected file. eficonfig_display_select_file_option() is not always necessary for the file selection process, so it must be outside of eficonfig_select_file_handler(). This commit also renames the following functions to avoid confusion. eficonfig_select_file_handler() -> eficonfig_process_select_file() eficonfig_select_file() -> eficonfig_show_file_selection() eficonfig_display_select_file_option() -> eficonfig_process_show_file_option() Finally, test_eficonfig.py need to be updated to get aligned with the above modification. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
1167e88a |
|
14-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix missing variable initialization The 'ret' variable must be initialized before use in eficonfig_delete_invalid_boot_option(). Fixes: c416f1c0bc ("bootmenu: add removable media entries") Addresses-Coverity: 376207 ("Uninitialized variables") Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
3d595ac5 |
|
09-Nov-2022 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: remove superfluous if in eficonfig_edit_boot_option Goto for an immediately succeeding label is superfluous. Fixes: 87d791423ac6 ("eficonfig: menu-driven addition of UEFI boot option") Addresses-Coverity: 376202 ("Identical code for different branches") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
9945bc4f |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Fix incorrect return code of boot option update Correct the return code for out-of-memory and no boot option found Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
339b527b |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Move bootorder and bootoption apis to lib Rename and move bootorder and bootoption apis from cmd to lib for re-use between eficonfig and bootmgr Fix 'unexpected indentation' when 'make htmldocs' after functions are moved Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
2c0b0c31 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_SECURE_BOOT This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_SECURE_BOOT defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
83f3d121 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_MM_COMM_TEE This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_MM_COMM_TEE defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
88df3634 |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: CTRL+S to save the boot order 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>
|
#
45f5319f |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
menu: remove CTRL+C to quit On the sandbox called without "--terminal raw" CTRL+C leaves U-Boot, "ESC/CTRL+C to quit" is misleading. Let's remove CTRL+C to quit key handling from bootmenu and eficonfig menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
|
#
8dbd0a0f |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add vertical scroll support The current eficonfig menu does not support vertical scroll, so it can not display the menu entries greater than the console row size. This commit add the vertial scroll support. The console size is retrieved by SIMPLE_TEXT_OUTPUT_PROTOCOL.QueryMode() service, then calculates the row size for menu entry by subtracting menu header and description row size from the console row size. "start" and "end" are added in the efimenu structure. "start" keeps the menu entry index at the top, "end" keeps the bottom menu entry index. item_data_print() menu function only draws the menu entry between "start" and "end". This commit also fixes the issue that "Save" and "Quit" entries can be moved by BKEY_PLUS in change boot order menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
0d590852 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation This commit removes the change boot order specific menu implementation. The change boot order implementation calls eficonfig_process_common() same as other menus. The change boot order menu requires own item_data_print and item_choice implementation, but display_statusline function can be a same function as other menus. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
cd160b27 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor eficonfig_process_common function Current change boot order implementation does not call eficonfig_process_common() and call own menu functions for display_statusline, item_data_print and item_choice. Change boot order functionality should call eficonfig_process_common() to improve maintenanceability. This commit is a preparation to remove the change boot order specific implementation. The menu functions (display_statusline, item_data_print and item_choice) are added as argument of eficonfig_process_common(). The menu description string displayed at the bottom of the menu is also added as argument. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
32bab0ea |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Make use of CLI character processing Avoid duplicating some of the escape-sequence processing here and use the CLI function instead. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
d0ca98db |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Update bootmenu_loop() to return the code Use the return value to save having to pass around a pointer. This also resolves any ambiguity about what *key contains when the function is called. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
2da4a15e |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Rename KEY_... to BKEY_... This enum values conflict with linux/input.h so rename them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
64550274 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: avoid SetVariable between GetNextVariableName calls The current code calls efi_set_variable_int() to delete the invalid boot option between calls to efi_get_next_variable_name_int(), it may produce unpredictable results. This commit moves removal of the invalid boot option outside of the efi_get_next_variable_name_int() calls. EFI_NOT_FOUND returned from efi_get_next_variable_name_int() indicates we retrieved all EFI variables, it should be treated as EFI_SUCEESS. To address the checkpatch warning of too many leading tabs, combine two if statement into one. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
ce327084 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: carve out efi_get_next_variable_name_int calls To retrieve the EFI variable name by efi_get_next_variable_name_int(), the sequence of alloc -> efi_get_next_variable_name_int -> realloc -> efi_get_next_variable_name_int is required. In current code, this sequence repeatedly appears in the several functions. It should be curved out a common function. This commit also fixes the missing free() of var_name16 in eficonfig_delete_invalid_boot_option(). Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
140a8959 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use efi_get_next_variable_name_int() eficonfig command reads all possible UEFI load options from 0x0000 to 0xFFFF to construct the menu. This takes too much time in some environment. This commit uses efi_get_next_variable_name_int() to read all existing UEFI load options to significantlly reduce the count of efi_get_var() call. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
78b1ccc4 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use u16_strsize() to get u16 string buffer size Use u16_strsize() to simplify the u16 string buffer size calculation. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c67d3c9e |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix going one directory up issue The directory name in eficonfig menu entry contains the '\' separator. strcmp() argument ".." is wrong and one directory up handling does not work correctly. strcmp() argument must include '\' separator. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c3b5af63 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add UEFI Secure Boot Key enrollment interface This commit adds the menu-driven UEFI Secure Boot Key enrollment interface. User can enroll PK, KEK, db and dbx by selecting file. Only the signed EFI Signature List(s) with an authenticated header, typically '.auth' file, is accepted. To clear the PK, KEK, db and dbx, user needs to enroll the null key signed by PK or KEK. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
21faf4ef |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use protocol interface for file selection EFI_SIMPLE_FILE_SYSTEM_PROTOCOL is not always provided by U-Boot. Use protocol interface functions instead of U-Boot internal functions. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d6566113 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose eficonfig_create_device_path() Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use eficonfig_create_device_path() to construct the full device path from device path of the volume and file path, so move it out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d571f9b2 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation All the eficonfig menus other than "Change Boot Order" use 'eficonfig_entry' structure for each menu entry. This commit refactors change boot order implementation to use 'eficonfig_entry' structure same as other menus to have consistent menu handling. This commit also simplifies the data->active handling when KEY_SPACE is pressed, and sizeof() parameter. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
8961e93e |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose append entry function Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use append_entry() and append_quit_entry() to construct the menu, so move them out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
a84040ab |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor file selection handling eficonfig_select_file_handler() is commonly used to select the file. eficonfig_display_select_file_option() adds an additional menu to clear the selected file. eficonfig_display_select_file_option() is not always necessary for the file selection process, so it must be outside of eficonfig_select_file_handler(). This commit also renames the following functions to avoid confusion. eficonfig_select_file_handler() -> eficonfig_process_select_file() eficonfig_select_file() -> eficonfig_show_file_selection() eficonfig_display_select_file_option() -> eficonfig_process_show_file_option() Finally, test_eficonfig.py need to be updated to get aligned with the above modification. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
1167e88a |
|
14-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix missing variable initialization The 'ret' variable must be initialized before use in eficonfig_delete_invalid_boot_option(). Fixes: c416f1c0bc ("bootmenu: add removable media entries") Addresses-Coverity: 376207 ("Uninitialized variables") Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
3d595ac5 |
|
09-Nov-2022 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: remove superfluous if in eficonfig_edit_boot_option Goto for an immediately succeeding label is superfluous. Fixes: 87d791423ac6 ("eficonfig: menu-driven addition of UEFI boot option") Addresses-Coverity: 376202 ("Identical code for different branches") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
9945bc4f |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Fix incorrect return code of boot option update Correct the return code for out-of-memory and no boot option found Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
339b527b |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Move bootorder and bootoption apis to lib Rename and move bootorder and bootoption apis from cmd to lib for re-use between eficonfig and bootmgr Fix 'unexpected indentation' when 'make htmldocs' after functions are moved Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
2c0b0c31 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_SECURE_BOOT This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_SECURE_BOOT defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
83f3d121 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_MM_COMM_TEE This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_MM_COMM_TEE defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
88df3634 |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: CTRL+S to save the boot order 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>
|
#
45f5319f |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
menu: remove CTRL+C to quit On the sandbox called without "--terminal raw" CTRL+C leaves U-Boot, "ESC/CTRL+C to quit" is misleading. Let's remove CTRL+C to quit key handling from bootmenu and eficonfig menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
|
#
8dbd0a0f |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add vertical scroll support The current eficonfig menu does not support vertical scroll, so it can not display the menu entries greater than the console row size. This commit add the vertial scroll support. The console size is retrieved by SIMPLE_TEXT_OUTPUT_PROTOCOL.QueryMode() service, then calculates the row size for menu entry by subtracting menu header and description row size from the console row size. "start" and "end" are added in the efimenu structure. "start" keeps the menu entry index at the top, "end" keeps the bottom menu entry index. item_data_print() menu function only draws the menu entry between "start" and "end". This commit also fixes the issue that "Save" and "Quit" entries can be moved by BKEY_PLUS in change boot order menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
0d590852 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation This commit removes the change boot order specific menu implementation. The change boot order implementation calls eficonfig_process_common() same as other menus. The change boot order menu requires own item_data_print and item_choice implementation, but display_statusline function can be a same function as other menus. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
cd160b27 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor eficonfig_process_common function Current change boot order implementation does not call eficonfig_process_common() and call own menu functions for display_statusline, item_data_print and item_choice. Change boot order functionality should call eficonfig_process_common() to improve maintenanceability. This commit is a preparation to remove the change boot order specific implementation. The menu functions (display_statusline, item_data_print and item_choice) are added as argument of eficonfig_process_common(). The menu description string displayed at the bottom of the menu is also added as argument. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
32bab0ea |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Make use of CLI character processing Avoid duplicating some of the escape-sequence processing here and use the CLI function instead. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
d0ca98db |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Update bootmenu_loop() to return the code Use the return value to save having to pass around a pointer. This also resolves any ambiguity about what *key contains when the function is called. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
2da4a15e |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Rename KEY_... to BKEY_... This enum values conflict with linux/input.h so rename them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
64550274 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: avoid SetVariable between GetNextVariableName calls The current code calls efi_set_variable_int() to delete the invalid boot option between calls to efi_get_next_variable_name_int(), it may produce unpredictable results. This commit moves removal of the invalid boot option outside of the efi_get_next_variable_name_int() calls. EFI_NOT_FOUND returned from efi_get_next_variable_name_int() indicates we retrieved all EFI variables, it should be treated as EFI_SUCEESS. To address the checkpatch warning of too many leading tabs, combine two if statement into one. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
ce327084 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: carve out efi_get_next_variable_name_int calls To retrieve the EFI variable name by efi_get_next_variable_name_int(), the sequence of alloc -> efi_get_next_variable_name_int -> realloc -> efi_get_next_variable_name_int is required. In current code, this sequence repeatedly appears in the several functions. It should be curved out a common function. This commit also fixes the missing free() of var_name16 in eficonfig_delete_invalid_boot_option(). Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
140a8959 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use efi_get_next_variable_name_int() eficonfig command reads all possible UEFI load options from 0x0000 to 0xFFFF to construct the menu. This takes too much time in some environment. This commit uses efi_get_next_variable_name_int() to read all existing UEFI load options to significantlly reduce the count of efi_get_var() call. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
78b1ccc4 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use u16_strsize() to get u16 string buffer size Use u16_strsize() to simplify the u16 string buffer size calculation. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c67d3c9e |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix going one directory up issue The directory name in eficonfig menu entry contains the '\' separator. strcmp() argument ".." is wrong and one directory up handling does not work correctly. strcmp() argument must include '\' separator. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c3b5af63 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add UEFI Secure Boot Key enrollment interface This commit adds the menu-driven UEFI Secure Boot Key enrollment interface. User can enroll PK, KEK, db and dbx by selecting file. Only the signed EFI Signature List(s) with an authenticated header, typically '.auth' file, is accepted. To clear the PK, KEK, db and dbx, user needs to enroll the null key signed by PK or KEK. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
21faf4ef |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use protocol interface for file selection EFI_SIMPLE_FILE_SYSTEM_PROTOCOL is not always provided by U-Boot. Use protocol interface functions instead of U-Boot internal functions. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d6566113 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose eficonfig_create_device_path() Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use eficonfig_create_device_path() to construct the full device path from device path of the volume and file path, so move it out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d571f9b2 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation All the eficonfig menus other than "Change Boot Order" use 'eficonfig_entry' structure for each menu entry. This commit refactors change boot order implementation to use 'eficonfig_entry' structure same as other menus to have consistent menu handling. This commit also simplifies the data->active handling when KEY_SPACE is pressed, and sizeof() parameter. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
8961e93e |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose append entry function Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use append_entry() and append_quit_entry() to construct the menu, so move them out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
a84040ab |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor file selection handling eficonfig_select_file_handler() is commonly used to select the file. eficonfig_display_select_file_option() adds an additional menu to clear the selected file. eficonfig_display_select_file_option() is not always necessary for the file selection process, so it must be outside of eficonfig_select_file_handler(). This commit also renames the following functions to avoid confusion. eficonfig_select_file_handler() -> eficonfig_process_select_file() eficonfig_select_file() -> eficonfig_show_file_selection() eficonfig_display_select_file_option() -> eficonfig_process_show_file_option() Finally, test_eficonfig.py need to be updated to get aligned with the above modification. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
1167e88a |
|
14-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix missing variable initialization The 'ret' variable must be initialized before use in eficonfig_delete_invalid_boot_option(). Fixes: c416f1c0bc ("bootmenu: add removable media entries") Addresses-Coverity: 376207 ("Uninitialized variables") Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
3d595ac5 |
|
09-Nov-2022 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: remove superfluous if in eficonfig_edit_boot_option Goto for an immediately succeeding label is superfluous. Fixes: 87d791423ac6 ("eficonfig: menu-driven addition of UEFI boot option") Addresses-Coverity: 376202 ("Identical code for different branches") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
9945bc4f |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Fix incorrect return code of boot option update Correct the return code for out-of-memory and no boot option found Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
339b527b |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Move bootorder and bootoption apis to lib Rename and move bootorder and bootoption apis from cmd to lib for re-use between eficonfig and bootmgr Fix 'unexpected indentation' when 'make htmldocs' after functions are moved Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
2c0b0c31 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_SECURE_BOOT This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_SECURE_BOOT defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
83f3d121 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_MM_COMM_TEE This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_MM_COMM_TEE defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
88df3634 |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: CTRL+S to save the boot order 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>
|
#
45f5319f |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
menu: remove CTRL+C to quit On the sandbox called without "--terminal raw" CTRL+C leaves U-Boot, "ESC/CTRL+C to quit" is misleading. Let's remove CTRL+C to quit key handling from bootmenu and eficonfig menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
|
#
8dbd0a0f |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add vertical scroll support The current eficonfig menu does not support vertical scroll, so it can not display the menu entries greater than the console row size. This commit add the vertial scroll support. The console size is retrieved by SIMPLE_TEXT_OUTPUT_PROTOCOL.QueryMode() service, then calculates the row size for menu entry by subtracting menu header and description row size from the console row size. "start" and "end" are added in the efimenu structure. "start" keeps the menu entry index at the top, "end" keeps the bottom menu entry index. item_data_print() menu function only draws the menu entry between "start" and "end". This commit also fixes the issue that "Save" and "Quit" entries can be moved by BKEY_PLUS in change boot order menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
0d590852 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation This commit removes the change boot order specific menu implementation. The change boot order implementation calls eficonfig_process_common() same as other menus. The change boot order menu requires own item_data_print and item_choice implementation, but display_statusline function can be a same function as other menus. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
cd160b27 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor eficonfig_process_common function Current change boot order implementation does not call eficonfig_process_common() and call own menu functions for display_statusline, item_data_print and item_choice. Change boot order functionality should call eficonfig_process_common() to improve maintenanceability. This commit is a preparation to remove the change boot order specific implementation. The menu functions (display_statusline, item_data_print and item_choice) are added as argument of eficonfig_process_common(). The menu description string displayed at the bottom of the menu is also added as argument. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
32bab0ea |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Make use of CLI character processing Avoid duplicating some of the escape-sequence processing here and use the CLI function instead. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
d0ca98db |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Update bootmenu_loop() to return the code Use the return value to save having to pass around a pointer. This also resolves any ambiguity about what *key contains when the function is called. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
2da4a15e |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Rename KEY_... to BKEY_... This enum values conflict with linux/input.h so rename them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
64550274 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: avoid SetVariable between GetNextVariableName calls The current code calls efi_set_variable_int() to delete the invalid boot option between calls to efi_get_next_variable_name_int(), it may produce unpredictable results. This commit moves removal of the invalid boot option outside of the efi_get_next_variable_name_int() calls. EFI_NOT_FOUND returned from efi_get_next_variable_name_int() indicates we retrieved all EFI variables, it should be treated as EFI_SUCEESS. To address the checkpatch warning of too many leading tabs, combine two if statement into one. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
ce327084 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: carve out efi_get_next_variable_name_int calls To retrieve the EFI variable name by efi_get_next_variable_name_int(), the sequence of alloc -> efi_get_next_variable_name_int -> realloc -> efi_get_next_variable_name_int is required. In current code, this sequence repeatedly appears in the several functions. It should be curved out a common function. This commit also fixes the missing free() of var_name16 in eficonfig_delete_invalid_boot_option(). Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
140a8959 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use efi_get_next_variable_name_int() eficonfig command reads all possible UEFI load options from 0x0000 to 0xFFFF to construct the menu. This takes too much time in some environment. This commit uses efi_get_next_variable_name_int() to read all existing UEFI load options to significantlly reduce the count of efi_get_var() call. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
78b1ccc4 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use u16_strsize() to get u16 string buffer size Use u16_strsize() to simplify the u16 string buffer size calculation. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c67d3c9e |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix going one directory up issue The directory name in eficonfig menu entry contains the '\' separator. strcmp() argument ".." is wrong and one directory up handling does not work correctly. strcmp() argument must include '\' separator. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c3b5af63 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add UEFI Secure Boot Key enrollment interface This commit adds the menu-driven UEFI Secure Boot Key enrollment interface. User can enroll PK, KEK, db and dbx by selecting file. Only the signed EFI Signature List(s) with an authenticated header, typically '.auth' file, is accepted. To clear the PK, KEK, db and dbx, user needs to enroll the null key signed by PK or KEK. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
21faf4ef |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use protocol interface for file selection EFI_SIMPLE_FILE_SYSTEM_PROTOCOL is not always provided by U-Boot. Use protocol interface functions instead of U-Boot internal functions. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d6566113 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose eficonfig_create_device_path() Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use eficonfig_create_device_path() to construct the full device path from device path of the volume and file path, so move it out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d571f9b2 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation All the eficonfig menus other than "Change Boot Order" use 'eficonfig_entry' structure for each menu entry. This commit refactors change boot order implementation to use 'eficonfig_entry' structure same as other menus to have consistent menu handling. This commit also simplifies the data->active handling when KEY_SPACE is pressed, and sizeof() parameter. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
8961e93e |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose append entry function Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use append_entry() and append_quit_entry() to construct the menu, so move them out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
a84040ab |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor file selection handling eficonfig_select_file_handler() is commonly used to select the file. eficonfig_display_select_file_option() adds an additional menu to clear the selected file. eficonfig_display_select_file_option() is not always necessary for the file selection process, so it must be outside of eficonfig_select_file_handler(). This commit also renames the following functions to avoid confusion. eficonfig_select_file_handler() -> eficonfig_process_select_file() eficonfig_select_file() -> eficonfig_show_file_selection() eficonfig_display_select_file_option() -> eficonfig_process_show_file_option() Finally, test_eficonfig.py need to be updated to get aligned with the above modification. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
1167e88a |
|
14-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix missing variable initialization The 'ret' variable must be initialized before use in eficonfig_delete_invalid_boot_option(). Fixes: c416f1c0bc ("bootmenu: add removable media entries") Addresses-Coverity: 376207 ("Uninitialized variables") Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
3d595ac5 |
|
09-Nov-2022 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: remove superfluous if in eficonfig_edit_boot_option Goto for an immediately succeeding label is superfluous. Fixes: 87d791423ac6 ("eficonfig: menu-driven addition of UEFI boot option") Addresses-Coverity: 376202 ("Identical code for different branches") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
9945bc4f |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Fix incorrect return code of boot option update Correct the return code for out-of-memory and no boot option found Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
339b527b |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Move bootorder and bootoption apis to lib Rename and move bootorder and bootoption apis from cmd to lib for re-use between eficonfig and bootmgr Fix 'unexpected indentation' when 'make htmldocs' after functions are moved Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
2c0b0c31 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_SECURE_BOOT This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_SECURE_BOOT defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
83f3d121 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_MM_COMM_TEE This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_MM_COMM_TEE defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
88df3634 |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: CTRL+S to save the boot order 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>
|
#
45f5319f |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
menu: remove CTRL+C to quit On the sandbox called without "--terminal raw" CTRL+C leaves U-Boot, "ESC/CTRL+C to quit" is misleading. Let's remove CTRL+C to quit key handling from bootmenu and eficonfig menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
|
#
8dbd0a0f |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add vertical scroll support The current eficonfig menu does not support vertical scroll, so it can not display the menu entries greater than the console row size. This commit add the vertial scroll support. The console size is retrieved by SIMPLE_TEXT_OUTPUT_PROTOCOL.QueryMode() service, then calculates the row size for menu entry by subtracting menu header and description row size from the console row size. "start" and "end" are added in the efimenu structure. "start" keeps the menu entry index at the top, "end" keeps the bottom menu entry index. item_data_print() menu function only draws the menu entry between "start" and "end". This commit also fixes the issue that "Save" and "Quit" entries can be moved by BKEY_PLUS in change boot order menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
0d590852 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation This commit removes the change boot order specific menu implementation. The change boot order implementation calls eficonfig_process_common() same as other menus. The change boot order menu requires own item_data_print and item_choice implementation, but display_statusline function can be a same function as other menus. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
cd160b27 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor eficonfig_process_common function Current change boot order implementation does not call eficonfig_process_common() and call own menu functions for display_statusline, item_data_print and item_choice. Change boot order functionality should call eficonfig_process_common() to improve maintenanceability. This commit is a preparation to remove the change boot order specific implementation. The menu functions (display_statusline, item_data_print and item_choice) are added as argument of eficonfig_process_common(). The menu description string displayed at the bottom of the menu is also added as argument. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
32bab0ea |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Make use of CLI character processing Avoid duplicating some of the escape-sequence processing here and use the CLI function instead. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
d0ca98db |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Update bootmenu_loop() to return the code Use the return value to save having to pass around a pointer. This also resolves any ambiguity about what *key contains when the function is called. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
2da4a15e |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Rename KEY_... to BKEY_... This enum values conflict with linux/input.h so rename them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
64550274 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: avoid SetVariable between GetNextVariableName calls The current code calls efi_set_variable_int() to delete the invalid boot option between calls to efi_get_next_variable_name_int(), it may produce unpredictable results. This commit moves removal of the invalid boot option outside of the efi_get_next_variable_name_int() calls. EFI_NOT_FOUND returned from efi_get_next_variable_name_int() indicates we retrieved all EFI variables, it should be treated as EFI_SUCEESS. To address the checkpatch warning of too many leading tabs, combine two if statement into one. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
ce327084 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: carve out efi_get_next_variable_name_int calls To retrieve the EFI variable name by efi_get_next_variable_name_int(), the sequence of alloc -> efi_get_next_variable_name_int -> realloc -> efi_get_next_variable_name_int is required. In current code, this sequence repeatedly appears in the several functions. It should be curved out a common function. This commit also fixes the missing free() of var_name16 in eficonfig_delete_invalid_boot_option(). Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
140a8959 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use efi_get_next_variable_name_int() eficonfig command reads all possible UEFI load options from 0x0000 to 0xFFFF to construct the menu. This takes too much time in some environment. This commit uses efi_get_next_variable_name_int() to read all existing UEFI load options to significantlly reduce the count of efi_get_var() call. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
78b1ccc4 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use u16_strsize() to get u16 string buffer size Use u16_strsize() to simplify the u16 string buffer size calculation. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c67d3c9e |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix going one directory up issue The directory name in eficonfig menu entry contains the '\' separator. strcmp() argument ".." is wrong and one directory up handling does not work correctly. strcmp() argument must include '\' separator. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c3b5af63 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add UEFI Secure Boot Key enrollment interface This commit adds the menu-driven UEFI Secure Boot Key enrollment interface. User can enroll PK, KEK, db and dbx by selecting file. Only the signed EFI Signature List(s) with an authenticated header, typically '.auth' file, is accepted. To clear the PK, KEK, db and dbx, user needs to enroll the null key signed by PK or KEK. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
21faf4ef |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use protocol interface for file selection EFI_SIMPLE_FILE_SYSTEM_PROTOCOL is not always provided by U-Boot. Use protocol interface functions instead of U-Boot internal functions. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d6566113 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose eficonfig_create_device_path() Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use eficonfig_create_device_path() to construct the full device path from device path of the volume and file path, so move it out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d571f9b2 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation All the eficonfig menus other than "Change Boot Order" use 'eficonfig_entry' structure for each menu entry. This commit refactors change boot order implementation to use 'eficonfig_entry' structure same as other menus to have consistent menu handling. This commit also simplifies the data->active handling when KEY_SPACE is pressed, and sizeof() parameter. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
8961e93e |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose append entry function Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use append_entry() and append_quit_entry() to construct the menu, so move them out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
a84040ab |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor file selection handling eficonfig_select_file_handler() is commonly used to select the file. eficonfig_display_select_file_option() adds an additional menu to clear the selected file. eficonfig_display_select_file_option() is not always necessary for the file selection process, so it must be outside of eficonfig_select_file_handler(). This commit also renames the following functions to avoid confusion. eficonfig_select_file_handler() -> eficonfig_process_select_file() eficonfig_select_file() -> eficonfig_show_file_selection() eficonfig_display_select_file_option() -> eficonfig_process_show_file_option() Finally, test_eficonfig.py need to be updated to get aligned with the above modification. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
1167e88a |
|
14-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix missing variable initialization The 'ret' variable must be initialized before use in eficonfig_delete_invalid_boot_option(). Fixes: c416f1c0bc ("bootmenu: add removable media entries") Addresses-Coverity: 376207 ("Uninitialized variables") Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
3d595ac5 |
|
09-Nov-2022 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: remove superfluous if in eficonfig_edit_boot_option Goto for an immediately succeeding label is superfluous. Fixes: 87d791423ac6 ("eficonfig: menu-driven addition of UEFI boot option") Addresses-Coverity: 376202 ("Identical code for different branches") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
9945bc4f |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Fix incorrect return code of boot option update Correct the return code for out-of-memory and no boot option found Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
339b527b |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Move bootorder and bootoption apis to lib Rename and move bootorder and bootoption apis from cmd to lib for re-use between eficonfig and bootmgr Fix 'unexpected indentation' when 'make htmldocs' after functions are moved Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
2c0b0c31 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_SECURE_BOOT This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_SECURE_BOOT defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
83f3d121 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_MM_COMM_TEE This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_MM_COMM_TEE defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
88df3634 |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: CTRL+S to save the boot order 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>
|
#
45f5319f |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
menu: remove CTRL+C to quit On the sandbox called without "--terminal raw" CTRL+C leaves U-Boot, "ESC/CTRL+C to quit" is misleading. Let's remove CTRL+C to quit key handling from bootmenu and eficonfig menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
|
#
8dbd0a0f |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add vertical scroll support The current eficonfig menu does not support vertical scroll, so it can not display the menu entries greater than the console row size. This commit add the vertial scroll support. The console size is retrieved by SIMPLE_TEXT_OUTPUT_PROTOCOL.QueryMode() service, then calculates the row size for menu entry by subtracting menu header and description row size from the console row size. "start" and "end" are added in the efimenu structure. "start" keeps the menu entry index at the top, "end" keeps the bottom menu entry index. item_data_print() menu function only draws the menu entry between "start" and "end". This commit also fixes the issue that "Save" and "Quit" entries can be moved by BKEY_PLUS in change boot order menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
0d590852 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation This commit removes the change boot order specific menu implementation. The change boot order implementation calls eficonfig_process_common() same as other menus. The change boot order menu requires own item_data_print and item_choice implementation, but display_statusline function can be a same function as other menus. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
cd160b27 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor eficonfig_process_common function Current change boot order implementation does not call eficonfig_process_common() and call own menu functions for display_statusline, item_data_print and item_choice. Change boot order functionality should call eficonfig_process_common() to improve maintenanceability. This commit is a preparation to remove the change boot order specific implementation. The menu functions (display_statusline, item_data_print and item_choice) are added as argument of eficonfig_process_common(). The menu description string displayed at the bottom of the menu is also added as argument. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
32bab0ea |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Make use of CLI character processing Avoid duplicating some of the escape-sequence processing here and use the CLI function instead. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
d0ca98db |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Update bootmenu_loop() to return the code Use the return value to save having to pass around a pointer. This also resolves any ambiguity about what *key contains when the function is called. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
2da4a15e |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Rename KEY_... to BKEY_... This enum values conflict with linux/input.h so rename them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
64550274 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: avoid SetVariable between GetNextVariableName calls The current code calls efi_set_variable_int() to delete the invalid boot option between calls to efi_get_next_variable_name_int(), it may produce unpredictable results. This commit moves removal of the invalid boot option outside of the efi_get_next_variable_name_int() calls. EFI_NOT_FOUND returned from efi_get_next_variable_name_int() indicates we retrieved all EFI variables, it should be treated as EFI_SUCEESS. To address the checkpatch warning of too many leading tabs, combine two if statement into one. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
ce327084 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: carve out efi_get_next_variable_name_int calls To retrieve the EFI variable name by efi_get_next_variable_name_int(), the sequence of alloc -> efi_get_next_variable_name_int -> realloc -> efi_get_next_variable_name_int is required. In current code, this sequence repeatedly appears in the several functions. It should be curved out a common function. This commit also fixes the missing free() of var_name16 in eficonfig_delete_invalid_boot_option(). Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
140a8959 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use efi_get_next_variable_name_int() eficonfig command reads all possible UEFI load options from 0x0000 to 0xFFFF to construct the menu. This takes too much time in some environment. This commit uses efi_get_next_variable_name_int() to read all existing UEFI load options to significantlly reduce the count of efi_get_var() call. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
78b1ccc4 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use u16_strsize() to get u16 string buffer size Use u16_strsize() to simplify the u16 string buffer size calculation. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c67d3c9e |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix going one directory up issue The directory name in eficonfig menu entry contains the '\' separator. strcmp() argument ".." is wrong and one directory up handling does not work correctly. strcmp() argument must include '\' separator. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c3b5af63 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add UEFI Secure Boot Key enrollment interface This commit adds the menu-driven UEFI Secure Boot Key enrollment interface. User can enroll PK, KEK, db and dbx by selecting file. Only the signed EFI Signature List(s) with an authenticated header, typically '.auth' file, is accepted. To clear the PK, KEK, db and dbx, user needs to enroll the null key signed by PK or KEK. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
21faf4ef |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use protocol interface for file selection EFI_SIMPLE_FILE_SYSTEM_PROTOCOL is not always provided by U-Boot. Use protocol interface functions instead of U-Boot internal functions. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d6566113 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose eficonfig_create_device_path() Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use eficonfig_create_device_path() to construct the full device path from device path of the volume and file path, so move it out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d571f9b2 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation All the eficonfig menus other than "Change Boot Order" use 'eficonfig_entry' structure for each menu entry. This commit refactors change boot order implementation to use 'eficonfig_entry' structure same as other menus to have consistent menu handling. This commit also simplifies the data->active handling when KEY_SPACE is pressed, and sizeof() parameter. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
8961e93e |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose append entry function Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use append_entry() and append_quit_entry() to construct the menu, so move them out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
a84040ab |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor file selection handling eficonfig_select_file_handler() is commonly used to select the file. eficonfig_display_select_file_option() adds an additional menu to clear the selected file. eficonfig_display_select_file_option() is not always necessary for the file selection process, so it must be outside of eficonfig_select_file_handler(). This commit also renames the following functions to avoid confusion. eficonfig_select_file_handler() -> eficonfig_process_select_file() eficonfig_select_file() -> eficonfig_show_file_selection() eficonfig_display_select_file_option() -> eficonfig_process_show_file_option() Finally, test_eficonfig.py need to be updated to get aligned with the above modification. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
1167e88a |
|
14-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix missing variable initialization The 'ret' variable must be initialized before use in eficonfig_delete_invalid_boot_option(). Fixes: c416f1c0bc ("bootmenu: add removable media entries") Addresses-Coverity: 376207 ("Uninitialized variables") Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
3d595ac5 |
|
09-Nov-2022 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: remove superfluous if in eficonfig_edit_boot_option Goto for an immediately succeeding label is superfluous. Fixes: 87d791423ac6 ("eficonfig: menu-driven addition of UEFI boot option") Addresses-Coverity: 376202 ("Identical code for different branches") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
9945bc4f |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Fix incorrect return code of boot option update Correct the return code for out-of-memory and no boot option found Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
339b527b |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Move bootorder and bootoption apis to lib Rename and move bootorder and bootoption apis from cmd to lib for re-use between eficonfig and bootmgr Fix 'unexpected indentation' when 'make htmldocs' after functions are moved Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
2c0b0c31 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_SECURE_BOOT This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_SECURE_BOOT defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
83f3d121 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_MM_COMM_TEE This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_MM_COMM_TEE defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
88df3634 |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: CTRL+S to save the boot order 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>
|
#
45f5319f |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
menu: remove CTRL+C to quit On the sandbox called without "--terminal raw" CTRL+C leaves U-Boot, "ESC/CTRL+C to quit" is misleading. Let's remove CTRL+C to quit key handling from bootmenu and eficonfig menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
|
#
8dbd0a0f |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add vertical scroll support The current eficonfig menu does not support vertical scroll, so it can not display the menu entries greater than the console row size. This commit add the vertial scroll support. The console size is retrieved by SIMPLE_TEXT_OUTPUT_PROTOCOL.QueryMode() service, then calculates the row size for menu entry by subtracting menu header and description row size from the console row size. "start" and "end" are added in the efimenu structure. "start" keeps the menu entry index at the top, "end" keeps the bottom menu entry index. item_data_print() menu function only draws the menu entry between "start" and "end". This commit also fixes the issue that "Save" and "Quit" entries can be moved by BKEY_PLUS in change boot order menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
0d590852 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation This commit removes the change boot order specific menu implementation. The change boot order implementation calls eficonfig_process_common() same as other menus. The change boot order menu requires own item_data_print and item_choice implementation, but display_statusline function can be a same function as other menus. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
cd160b27 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor eficonfig_process_common function Current change boot order implementation does not call eficonfig_process_common() and call own menu functions for display_statusline, item_data_print and item_choice. Change boot order functionality should call eficonfig_process_common() to improve maintenanceability. This commit is a preparation to remove the change boot order specific implementation. The menu functions (display_statusline, item_data_print and item_choice) are added as argument of eficonfig_process_common(). The menu description string displayed at the bottom of the menu is also added as argument. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
32bab0ea |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Make use of CLI character processing Avoid duplicating some of the escape-sequence processing here and use the CLI function instead. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
d0ca98db |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Update bootmenu_loop() to return the code Use the return value to save having to pass around a pointer. This also resolves any ambiguity about what *key contains when the function is called. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
2da4a15e |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Rename KEY_... to BKEY_... This enum values conflict with linux/input.h so rename them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
64550274 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: avoid SetVariable between GetNextVariableName calls The current code calls efi_set_variable_int() to delete the invalid boot option between calls to efi_get_next_variable_name_int(), it may produce unpredictable results. This commit moves removal of the invalid boot option outside of the efi_get_next_variable_name_int() calls. EFI_NOT_FOUND returned from efi_get_next_variable_name_int() indicates we retrieved all EFI variables, it should be treated as EFI_SUCEESS. To address the checkpatch warning of too many leading tabs, combine two if statement into one. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
ce327084 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: carve out efi_get_next_variable_name_int calls To retrieve the EFI variable name by efi_get_next_variable_name_int(), the sequence of alloc -> efi_get_next_variable_name_int -> realloc -> efi_get_next_variable_name_int is required. In current code, this sequence repeatedly appears in the several functions. It should be curved out a common function. This commit also fixes the missing free() of var_name16 in eficonfig_delete_invalid_boot_option(). Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
140a8959 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use efi_get_next_variable_name_int() eficonfig command reads all possible UEFI load options from 0x0000 to 0xFFFF to construct the menu. This takes too much time in some environment. This commit uses efi_get_next_variable_name_int() to read all existing UEFI load options to significantlly reduce the count of efi_get_var() call. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
78b1ccc4 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use u16_strsize() to get u16 string buffer size Use u16_strsize() to simplify the u16 string buffer size calculation. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c67d3c9e |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix going one directory up issue The directory name in eficonfig menu entry contains the '\' separator. strcmp() argument ".." is wrong and one directory up handling does not work correctly. strcmp() argument must include '\' separator. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c3b5af63 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add UEFI Secure Boot Key enrollment interface This commit adds the menu-driven UEFI Secure Boot Key enrollment interface. User can enroll PK, KEK, db and dbx by selecting file. Only the signed EFI Signature List(s) with an authenticated header, typically '.auth' file, is accepted. To clear the PK, KEK, db and dbx, user needs to enroll the null key signed by PK or KEK. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
21faf4ef |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use protocol interface for file selection EFI_SIMPLE_FILE_SYSTEM_PROTOCOL is not always provided by U-Boot. Use protocol interface functions instead of U-Boot internal functions. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d6566113 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose eficonfig_create_device_path() Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use eficonfig_create_device_path() to construct the full device path from device path of the volume and file path, so move it out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d571f9b2 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation All the eficonfig menus other than "Change Boot Order" use 'eficonfig_entry' structure for each menu entry. This commit refactors change boot order implementation to use 'eficonfig_entry' structure same as other menus to have consistent menu handling. This commit also simplifies the data->active handling when KEY_SPACE is pressed, and sizeof() parameter. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
8961e93e |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose append entry function Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use append_entry() and append_quit_entry() to construct the menu, so move them out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
a84040ab |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor file selection handling eficonfig_select_file_handler() is commonly used to select the file. eficonfig_display_select_file_option() adds an additional menu to clear the selected file. eficonfig_display_select_file_option() is not always necessary for the file selection process, so it must be outside of eficonfig_select_file_handler(). This commit also renames the following functions to avoid confusion. eficonfig_select_file_handler() -> eficonfig_process_select_file() eficonfig_select_file() -> eficonfig_show_file_selection() eficonfig_display_select_file_option() -> eficonfig_process_show_file_option() Finally, test_eficonfig.py need to be updated to get aligned with the above modification. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
1167e88a |
|
14-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix missing variable initialization The 'ret' variable must be initialized before use in eficonfig_delete_invalid_boot_option(). Fixes: c416f1c0bc ("bootmenu: add removable media entries") Addresses-Coverity: 376207 ("Uninitialized variables") Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
3d595ac5 |
|
09-Nov-2022 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: remove superfluous if in eficonfig_edit_boot_option Goto for an immediately succeeding label is superfluous. Fixes: 87d791423ac6 ("eficonfig: menu-driven addition of UEFI boot option") Addresses-Coverity: 376202 ("Identical code for different branches") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
9945bc4f |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Fix incorrect return code of boot option update Correct the return code for out-of-memory and no boot option found Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
339b527b |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Move bootorder and bootoption apis to lib Rename and move bootorder and bootoption apis from cmd to lib for re-use between eficonfig and bootmgr Fix 'unexpected indentation' when 'make htmldocs' after functions are moved Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
2c0b0c31 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_SECURE_BOOT This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_SECURE_BOOT defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
83f3d121 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_MM_COMM_TEE This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_MM_COMM_TEE defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
88df3634 |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: CTRL+S to save the boot order 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>
|
#
45f5319f |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
menu: remove CTRL+C to quit On the sandbox called without "--terminal raw" CTRL+C leaves U-Boot, "ESC/CTRL+C to quit" is misleading. Let's remove CTRL+C to quit key handling from bootmenu and eficonfig menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
|
#
8dbd0a0f |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add vertical scroll support The current eficonfig menu does not support vertical scroll, so it can not display the menu entries greater than the console row size. This commit add the vertial scroll support. The console size is retrieved by SIMPLE_TEXT_OUTPUT_PROTOCOL.QueryMode() service, then calculates the row size for menu entry by subtracting menu header and description row size from the console row size. "start" and "end" are added in the efimenu structure. "start" keeps the menu entry index at the top, "end" keeps the bottom menu entry index. item_data_print() menu function only draws the menu entry between "start" and "end". This commit also fixes the issue that "Save" and "Quit" entries can be moved by BKEY_PLUS in change boot order menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
0d590852 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation This commit removes the change boot order specific menu implementation. The change boot order implementation calls eficonfig_process_common() same as other menus. The change boot order menu requires own item_data_print and item_choice implementation, but display_statusline function can be a same function as other menus. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
cd160b27 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor eficonfig_process_common function Current change boot order implementation does not call eficonfig_process_common() and call own menu functions for display_statusline, item_data_print and item_choice. Change boot order functionality should call eficonfig_process_common() to improve maintenanceability. This commit is a preparation to remove the change boot order specific implementation. The menu functions (display_statusline, item_data_print and item_choice) are added as argument of eficonfig_process_common(). The menu description string displayed at the bottom of the menu is also added as argument. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
32bab0ea |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Make use of CLI character processing Avoid duplicating some of the escape-sequence processing here and use the CLI function instead. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
d0ca98db |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Update bootmenu_loop() to return the code Use the return value to save having to pass around a pointer. This also resolves any ambiguity about what *key contains when the function is called. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
2da4a15e |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Rename KEY_... to BKEY_... This enum values conflict with linux/input.h so rename them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
64550274 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: avoid SetVariable between GetNextVariableName calls The current code calls efi_set_variable_int() to delete the invalid boot option between calls to efi_get_next_variable_name_int(), it may produce unpredictable results. This commit moves removal of the invalid boot option outside of the efi_get_next_variable_name_int() calls. EFI_NOT_FOUND returned from efi_get_next_variable_name_int() indicates we retrieved all EFI variables, it should be treated as EFI_SUCEESS. To address the checkpatch warning of too many leading tabs, combine two if statement into one. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
ce327084 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: carve out efi_get_next_variable_name_int calls To retrieve the EFI variable name by efi_get_next_variable_name_int(), the sequence of alloc -> efi_get_next_variable_name_int -> realloc -> efi_get_next_variable_name_int is required. In current code, this sequence repeatedly appears in the several functions. It should be curved out a common function. This commit also fixes the missing free() of var_name16 in eficonfig_delete_invalid_boot_option(). Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
140a8959 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use efi_get_next_variable_name_int() eficonfig command reads all possible UEFI load options from 0x0000 to 0xFFFF to construct the menu. This takes too much time in some environment. This commit uses efi_get_next_variable_name_int() to read all existing UEFI load options to significantlly reduce the count of efi_get_var() call. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
78b1ccc4 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use u16_strsize() to get u16 string buffer size Use u16_strsize() to simplify the u16 string buffer size calculation. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c67d3c9e |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix going one directory up issue The directory name in eficonfig menu entry contains the '\' separator. strcmp() argument ".." is wrong and one directory up handling does not work correctly. strcmp() argument must include '\' separator. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c3b5af63 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add UEFI Secure Boot Key enrollment interface This commit adds the menu-driven UEFI Secure Boot Key enrollment interface. User can enroll PK, KEK, db and dbx by selecting file. Only the signed EFI Signature List(s) with an authenticated header, typically '.auth' file, is accepted. To clear the PK, KEK, db and dbx, user needs to enroll the null key signed by PK or KEK. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
21faf4ef |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use protocol interface for file selection EFI_SIMPLE_FILE_SYSTEM_PROTOCOL is not always provided by U-Boot. Use protocol interface functions instead of U-Boot internal functions. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d6566113 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose eficonfig_create_device_path() Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use eficonfig_create_device_path() to construct the full device path from device path of the volume and file path, so move it out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d571f9b2 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation All the eficonfig menus other than "Change Boot Order" use 'eficonfig_entry' structure for each menu entry. This commit refactors change boot order implementation to use 'eficonfig_entry' structure same as other menus to have consistent menu handling. This commit also simplifies the data->active handling when KEY_SPACE is pressed, and sizeof() parameter. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
8961e93e |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose append entry function Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use append_entry() and append_quit_entry() to construct the menu, so move them out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
a84040ab |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor file selection handling eficonfig_select_file_handler() is commonly used to select the file. eficonfig_display_select_file_option() adds an additional menu to clear the selected file. eficonfig_display_select_file_option() is not always necessary for the file selection process, so it must be outside of eficonfig_select_file_handler(). This commit also renames the following functions to avoid confusion. eficonfig_select_file_handler() -> eficonfig_process_select_file() eficonfig_select_file() -> eficonfig_show_file_selection() eficonfig_display_select_file_option() -> eficonfig_process_show_file_option() Finally, test_eficonfig.py need to be updated to get aligned with the above modification. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
1167e88a |
|
14-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix missing variable initialization The 'ret' variable must be initialized before use in eficonfig_delete_invalid_boot_option(). Fixes: c416f1c0bc ("bootmenu: add removable media entries") Addresses-Coverity: 376207 ("Uninitialized variables") Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
3d595ac5 |
|
09-Nov-2022 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: remove superfluous if in eficonfig_edit_boot_option Goto for an immediately succeeding label is superfluous. Fixes: 87d791423ac6 ("eficonfig: menu-driven addition of UEFI boot option") Addresses-Coverity: 376202 ("Identical code for different branches") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
9945bc4f |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Fix incorrect return code of boot option update Correct the return code for out-of-memory and no boot option found Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
339b527b |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Move bootorder and bootoption apis to lib Rename and move bootorder and bootoption apis from cmd to lib for re-use between eficonfig and bootmgr Fix 'unexpected indentation' when 'make htmldocs' after functions are moved Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
2c0b0c31 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_SECURE_BOOT This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_SECURE_BOOT defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
83f3d121 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_MM_COMM_TEE This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_MM_COMM_TEE defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
88df3634 |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: CTRL+S to save the boot order 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>
|
#
45f5319f |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
menu: remove CTRL+C to quit On the sandbox called without "--terminal raw" CTRL+C leaves U-Boot, "ESC/CTRL+C to quit" is misleading. Let's remove CTRL+C to quit key handling from bootmenu and eficonfig menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
|
#
8dbd0a0f |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add vertical scroll support The current eficonfig menu does not support vertical scroll, so it can not display the menu entries greater than the console row size. This commit add the vertial scroll support. The console size is retrieved by SIMPLE_TEXT_OUTPUT_PROTOCOL.QueryMode() service, then calculates the row size for menu entry by subtracting menu header and description row size from the console row size. "start" and "end" are added in the efimenu structure. "start" keeps the menu entry index at the top, "end" keeps the bottom menu entry index. item_data_print() menu function only draws the menu entry between "start" and "end". This commit also fixes the issue that "Save" and "Quit" entries can be moved by BKEY_PLUS in change boot order menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
0d590852 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation This commit removes the change boot order specific menu implementation. The change boot order implementation calls eficonfig_process_common() same as other menus. The change boot order menu requires own item_data_print and item_choice implementation, but display_statusline function can be a same function as other menus. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
cd160b27 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor eficonfig_process_common function Current change boot order implementation does not call eficonfig_process_common() and call own menu functions for display_statusline, item_data_print and item_choice. Change boot order functionality should call eficonfig_process_common() to improve maintenanceability. This commit is a preparation to remove the change boot order specific implementation. The menu functions (display_statusline, item_data_print and item_choice) are added as argument of eficonfig_process_common(). The menu description string displayed at the bottom of the menu is also added as argument. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
32bab0ea |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Make use of CLI character processing Avoid duplicating some of the escape-sequence processing here and use the CLI function instead. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
d0ca98db |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Update bootmenu_loop() to return the code Use the return value to save having to pass around a pointer. This also resolves any ambiguity about what *key contains when the function is called. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
2da4a15e |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Rename KEY_... to BKEY_... This enum values conflict with linux/input.h so rename them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
64550274 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: avoid SetVariable between GetNextVariableName calls The current code calls efi_set_variable_int() to delete the invalid boot option between calls to efi_get_next_variable_name_int(), it may produce unpredictable results. This commit moves removal of the invalid boot option outside of the efi_get_next_variable_name_int() calls. EFI_NOT_FOUND returned from efi_get_next_variable_name_int() indicates we retrieved all EFI variables, it should be treated as EFI_SUCEESS. To address the checkpatch warning of too many leading tabs, combine two if statement into one. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
ce327084 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: carve out efi_get_next_variable_name_int calls To retrieve the EFI variable name by efi_get_next_variable_name_int(), the sequence of alloc -> efi_get_next_variable_name_int -> realloc -> efi_get_next_variable_name_int is required. In current code, this sequence repeatedly appears in the several functions. It should be curved out a common function. This commit also fixes the missing free() of var_name16 in eficonfig_delete_invalid_boot_option(). Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
140a8959 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use efi_get_next_variable_name_int() eficonfig command reads all possible UEFI load options from 0x0000 to 0xFFFF to construct the menu. This takes too much time in some environment. This commit uses efi_get_next_variable_name_int() to read all existing UEFI load options to significantlly reduce the count of efi_get_var() call. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
78b1ccc4 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use u16_strsize() to get u16 string buffer size Use u16_strsize() to simplify the u16 string buffer size calculation. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c67d3c9e |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix going one directory up issue The directory name in eficonfig menu entry contains the '\' separator. strcmp() argument ".." is wrong and one directory up handling does not work correctly. strcmp() argument must include '\' separator. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c3b5af63 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add UEFI Secure Boot Key enrollment interface This commit adds the menu-driven UEFI Secure Boot Key enrollment interface. User can enroll PK, KEK, db and dbx by selecting file. Only the signed EFI Signature List(s) with an authenticated header, typically '.auth' file, is accepted. To clear the PK, KEK, db and dbx, user needs to enroll the null key signed by PK or KEK. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
21faf4ef |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use protocol interface for file selection EFI_SIMPLE_FILE_SYSTEM_PROTOCOL is not always provided by U-Boot. Use protocol interface functions instead of U-Boot internal functions. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d6566113 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose eficonfig_create_device_path() Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use eficonfig_create_device_path() to construct the full device path from device path of the volume and file path, so move it out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d571f9b2 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation All the eficonfig menus other than "Change Boot Order" use 'eficonfig_entry' structure for each menu entry. This commit refactors change boot order implementation to use 'eficonfig_entry' structure same as other menus to have consistent menu handling. This commit also simplifies the data->active handling when KEY_SPACE is pressed, and sizeof() parameter. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
8961e93e |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose append entry function Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use append_entry() and append_quit_entry() to construct the menu, so move them out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
a84040ab |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor file selection handling eficonfig_select_file_handler() is commonly used to select the file. eficonfig_display_select_file_option() adds an additional menu to clear the selected file. eficonfig_display_select_file_option() is not always necessary for the file selection process, so it must be outside of eficonfig_select_file_handler(). This commit also renames the following functions to avoid confusion. eficonfig_select_file_handler() -> eficonfig_process_select_file() eficonfig_select_file() -> eficonfig_show_file_selection() eficonfig_display_select_file_option() -> eficonfig_process_show_file_option() Finally, test_eficonfig.py need to be updated to get aligned with the above modification. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
1167e88a |
|
14-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix missing variable initialization The 'ret' variable must be initialized before use in eficonfig_delete_invalid_boot_option(). Fixes: c416f1c0bc ("bootmenu: add removable media entries") Addresses-Coverity: 376207 ("Uninitialized variables") Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
3d595ac5 |
|
09-Nov-2022 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: remove superfluous if in eficonfig_edit_boot_option Goto for an immediately succeeding label is superfluous. Fixes: 87d791423ac6 ("eficonfig: menu-driven addition of UEFI boot option") Addresses-Coverity: 376202 ("Identical code for different branches") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
9945bc4f |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Fix incorrect return code of boot option update Correct the return code for out-of-memory and no boot option found Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
339b527b |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Move bootorder and bootoption apis to lib Rename and move bootorder and bootoption apis from cmd to lib for re-use between eficonfig and bootmgr Fix 'unexpected indentation' when 'make htmldocs' after functions are moved Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
2c0b0c31 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_SECURE_BOOT This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_SECURE_BOOT defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
83f3d121 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_MM_COMM_TEE This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_MM_COMM_TEE defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
88df3634 |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: CTRL+S to save the boot order 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>
|
#
45f5319f |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
menu: remove CTRL+C to quit On the sandbox called without "--terminal raw" CTRL+C leaves U-Boot, "ESC/CTRL+C to quit" is misleading. Let's remove CTRL+C to quit key handling from bootmenu and eficonfig menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
|
#
8dbd0a0f |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add vertical scroll support The current eficonfig menu does not support vertical scroll, so it can not display the menu entries greater than the console row size. This commit add the vertial scroll support. The console size is retrieved by SIMPLE_TEXT_OUTPUT_PROTOCOL.QueryMode() service, then calculates the row size for menu entry by subtracting menu header and description row size from the console row size. "start" and "end" are added in the efimenu structure. "start" keeps the menu entry index at the top, "end" keeps the bottom menu entry index. item_data_print() menu function only draws the menu entry between "start" and "end". This commit also fixes the issue that "Save" and "Quit" entries can be moved by BKEY_PLUS in change boot order menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
0d590852 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation This commit removes the change boot order specific menu implementation. The change boot order implementation calls eficonfig_process_common() same as other menus. The change boot order menu requires own item_data_print and item_choice implementation, but display_statusline function can be a same function as other menus. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
cd160b27 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor eficonfig_process_common function Current change boot order implementation does not call eficonfig_process_common() and call own menu functions for display_statusline, item_data_print and item_choice. Change boot order functionality should call eficonfig_process_common() to improve maintenanceability. This commit is a preparation to remove the change boot order specific implementation. The menu functions (display_statusline, item_data_print and item_choice) are added as argument of eficonfig_process_common(). The menu description string displayed at the bottom of the menu is also added as argument. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
32bab0ea |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Make use of CLI character processing Avoid duplicating some of the escape-sequence processing here and use the CLI function instead. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
d0ca98db |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Update bootmenu_loop() to return the code Use the return value to save having to pass around a pointer. This also resolves any ambiguity about what *key contains when the function is called. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
2da4a15e |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Rename KEY_... to BKEY_... This enum values conflict with linux/input.h so rename them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
64550274 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: avoid SetVariable between GetNextVariableName calls The current code calls efi_set_variable_int() to delete the invalid boot option between calls to efi_get_next_variable_name_int(), it may produce unpredictable results. This commit moves removal of the invalid boot option outside of the efi_get_next_variable_name_int() calls. EFI_NOT_FOUND returned from efi_get_next_variable_name_int() indicates we retrieved all EFI variables, it should be treated as EFI_SUCEESS. To address the checkpatch warning of too many leading tabs, combine two if statement into one. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
ce327084 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: carve out efi_get_next_variable_name_int calls To retrieve the EFI variable name by efi_get_next_variable_name_int(), the sequence of alloc -> efi_get_next_variable_name_int -> realloc -> efi_get_next_variable_name_int is required. In current code, this sequence repeatedly appears in the several functions. It should be curved out a common function. This commit also fixes the missing free() of var_name16 in eficonfig_delete_invalid_boot_option(). Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
140a8959 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use efi_get_next_variable_name_int() eficonfig command reads all possible UEFI load options from 0x0000 to 0xFFFF to construct the menu. This takes too much time in some environment. This commit uses efi_get_next_variable_name_int() to read all existing UEFI load options to significantlly reduce the count of efi_get_var() call. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
78b1ccc4 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use u16_strsize() to get u16 string buffer size Use u16_strsize() to simplify the u16 string buffer size calculation. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c67d3c9e |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix going one directory up issue The directory name in eficonfig menu entry contains the '\' separator. strcmp() argument ".." is wrong and one directory up handling does not work correctly. strcmp() argument must include '\' separator. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c3b5af63 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add UEFI Secure Boot Key enrollment interface This commit adds the menu-driven UEFI Secure Boot Key enrollment interface. User can enroll PK, KEK, db and dbx by selecting file. Only the signed EFI Signature List(s) with an authenticated header, typically '.auth' file, is accepted. To clear the PK, KEK, db and dbx, user needs to enroll the null key signed by PK or KEK. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
21faf4ef |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use protocol interface for file selection EFI_SIMPLE_FILE_SYSTEM_PROTOCOL is not always provided by U-Boot. Use protocol interface functions instead of U-Boot internal functions. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d6566113 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose eficonfig_create_device_path() Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use eficonfig_create_device_path() to construct the full device path from device path of the volume and file path, so move it out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d571f9b2 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation All the eficonfig menus other than "Change Boot Order" use 'eficonfig_entry' structure for each menu entry. This commit refactors change boot order implementation to use 'eficonfig_entry' structure same as other menus to have consistent menu handling. This commit also simplifies the data->active handling when KEY_SPACE is pressed, and sizeof() parameter. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
8961e93e |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose append entry function Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use append_entry() and append_quit_entry() to construct the menu, so move them out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
a84040ab |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor file selection handling eficonfig_select_file_handler() is commonly used to select the file. eficonfig_display_select_file_option() adds an additional menu to clear the selected file. eficonfig_display_select_file_option() is not always necessary for the file selection process, so it must be outside of eficonfig_select_file_handler(). This commit also renames the following functions to avoid confusion. eficonfig_select_file_handler() -> eficonfig_process_select_file() eficonfig_select_file() -> eficonfig_show_file_selection() eficonfig_display_select_file_option() -> eficonfig_process_show_file_option() Finally, test_eficonfig.py need to be updated to get aligned with the above modification. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
1167e88a |
|
14-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix missing variable initialization The 'ret' variable must be initialized before use in eficonfig_delete_invalid_boot_option(). Fixes: c416f1c0bc ("bootmenu: add removable media entries") Addresses-Coverity: 376207 ("Uninitialized variables") Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
3d595ac5 |
|
09-Nov-2022 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: remove superfluous if in eficonfig_edit_boot_option Goto for an immediately succeeding label is superfluous. Fixes: 87d791423ac6 ("eficonfig: menu-driven addition of UEFI boot option") Addresses-Coverity: 376202 ("Identical code for different branches") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
9945bc4f |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Fix incorrect return code of boot option update Correct the return code for out-of-memory and no boot option found Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
339b527b |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Move bootorder and bootoption apis to lib Rename and move bootorder and bootoption apis from cmd to lib for re-use between eficonfig and bootmgr Fix 'unexpected indentation' when 'make htmldocs' after functions are moved Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
2c0b0c31 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_SECURE_BOOT This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_SECURE_BOOT defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
83f3d121 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_MM_COMM_TEE This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_MM_COMM_TEE defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
88df3634 |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: CTRL+S to save the boot order 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>
|
#
45f5319f |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
menu: remove CTRL+C to quit On the sandbox called without "--terminal raw" CTRL+C leaves U-Boot, "ESC/CTRL+C to quit" is misleading. Let's remove CTRL+C to quit key handling from bootmenu and eficonfig menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
|
#
8dbd0a0f |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add vertical scroll support The current eficonfig menu does not support vertical scroll, so it can not display the menu entries greater than the console row size. This commit add the vertial scroll support. The console size is retrieved by SIMPLE_TEXT_OUTPUT_PROTOCOL.QueryMode() service, then calculates the row size for menu entry by subtracting menu header and description row size from the console row size. "start" and "end" are added in the efimenu structure. "start" keeps the menu entry index at the top, "end" keeps the bottom menu entry index. item_data_print() menu function only draws the menu entry between "start" and "end". This commit also fixes the issue that "Save" and "Quit" entries can be moved by BKEY_PLUS in change boot order menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
0d590852 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation This commit removes the change boot order specific menu implementation. The change boot order implementation calls eficonfig_process_common() same as other menus. The change boot order menu requires own item_data_print and item_choice implementation, but display_statusline function can be a same function as other menus. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
cd160b27 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor eficonfig_process_common function Current change boot order implementation does not call eficonfig_process_common() and call own menu functions for display_statusline, item_data_print and item_choice. Change boot order functionality should call eficonfig_process_common() to improve maintenanceability. This commit is a preparation to remove the change boot order specific implementation. The menu functions (display_statusline, item_data_print and item_choice) are added as argument of eficonfig_process_common(). The menu description string displayed at the bottom of the menu is also added as argument. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
32bab0ea |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Make use of CLI character processing Avoid duplicating some of the escape-sequence processing here and use the CLI function instead. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
d0ca98db |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Update bootmenu_loop() to return the code Use the return value to save having to pass around a pointer. This also resolves any ambiguity about what *key contains when the function is called. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
2da4a15e |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Rename KEY_... to BKEY_... This enum values conflict with linux/input.h so rename them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
64550274 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: avoid SetVariable between GetNextVariableName calls The current code calls efi_set_variable_int() to delete the invalid boot option between calls to efi_get_next_variable_name_int(), it may produce unpredictable results. This commit moves removal of the invalid boot option outside of the efi_get_next_variable_name_int() calls. EFI_NOT_FOUND returned from efi_get_next_variable_name_int() indicates we retrieved all EFI variables, it should be treated as EFI_SUCEESS. To address the checkpatch warning of too many leading tabs, combine two if statement into one. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
ce327084 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: carve out efi_get_next_variable_name_int calls To retrieve the EFI variable name by efi_get_next_variable_name_int(), the sequence of alloc -> efi_get_next_variable_name_int -> realloc -> efi_get_next_variable_name_int is required. In current code, this sequence repeatedly appears in the several functions. It should be curved out a common function. This commit also fixes the missing free() of var_name16 in eficonfig_delete_invalid_boot_option(). Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
140a8959 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use efi_get_next_variable_name_int() eficonfig command reads all possible UEFI load options from 0x0000 to 0xFFFF to construct the menu. This takes too much time in some environment. This commit uses efi_get_next_variable_name_int() to read all existing UEFI load options to significantlly reduce the count of efi_get_var() call. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
78b1ccc4 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use u16_strsize() to get u16 string buffer size Use u16_strsize() to simplify the u16 string buffer size calculation. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c67d3c9e |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix going one directory up issue The directory name in eficonfig menu entry contains the '\' separator. strcmp() argument ".." is wrong and one directory up handling does not work correctly. strcmp() argument must include '\' separator. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c3b5af63 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add UEFI Secure Boot Key enrollment interface This commit adds the menu-driven UEFI Secure Boot Key enrollment interface. User can enroll PK, KEK, db and dbx by selecting file. Only the signed EFI Signature List(s) with an authenticated header, typically '.auth' file, is accepted. To clear the PK, KEK, db and dbx, user needs to enroll the null key signed by PK or KEK. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
21faf4ef |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use protocol interface for file selection EFI_SIMPLE_FILE_SYSTEM_PROTOCOL is not always provided by U-Boot. Use protocol interface functions instead of U-Boot internal functions. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d6566113 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose eficonfig_create_device_path() Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use eficonfig_create_device_path() to construct the full device path from device path of the volume and file path, so move it out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d571f9b2 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation All the eficonfig menus other than "Change Boot Order" use 'eficonfig_entry' structure for each menu entry. This commit refactors change boot order implementation to use 'eficonfig_entry' structure same as other menus to have consistent menu handling. This commit also simplifies the data->active handling when KEY_SPACE is pressed, and sizeof() parameter. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
8961e93e |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose append entry function Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use append_entry() and append_quit_entry() to construct the menu, so move them out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
a84040ab |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor file selection handling eficonfig_select_file_handler() is commonly used to select the file. eficonfig_display_select_file_option() adds an additional menu to clear the selected file. eficonfig_display_select_file_option() is not always necessary for the file selection process, so it must be outside of eficonfig_select_file_handler(). This commit also renames the following functions to avoid confusion. eficonfig_select_file_handler() -> eficonfig_process_select_file() eficonfig_select_file() -> eficonfig_show_file_selection() eficonfig_display_select_file_option() -> eficonfig_process_show_file_option() Finally, test_eficonfig.py need to be updated to get aligned with the above modification. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
1167e88a |
|
14-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix missing variable initialization The 'ret' variable must be initialized before use in eficonfig_delete_invalid_boot_option(). Fixes: c416f1c0bc ("bootmenu: add removable media entries") Addresses-Coverity: 376207 ("Uninitialized variables") Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
3d595ac5 |
|
09-Nov-2022 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: remove superfluous if in eficonfig_edit_boot_option Goto for an immediately succeeding label is superfluous. Fixes: 87d791423ac6 ("eficonfig: menu-driven addition of UEFI boot option") Addresses-Coverity: 376202 ("Identical code for different branches") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
9945bc4f |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Fix incorrect return code of boot option update Correct the return code for out-of-memory and no boot option found Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
339b527b |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Move bootorder and bootoption apis to lib Rename and move bootorder and bootoption apis from cmd to lib for re-use between eficonfig and bootmgr Fix 'unexpected indentation' when 'make htmldocs' after functions are moved Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
2c0b0c31 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_SECURE_BOOT This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_SECURE_BOOT defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
83f3d121 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_MM_COMM_TEE This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_MM_COMM_TEE defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
88df3634 |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: CTRL+S to save the boot order 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>
|
#
45f5319f |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
menu: remove CTRL+C to quit On the sandbox called without "--terminal raw" CTRL+C leaves U-Boot, "ESC/CTRL+C to quit" is misleading. Let's remove CTRL+C to quit key handling from bootmenu and eficonfig menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
|
#
8dbd0a0f |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add vertical scroll support The current eficonfig menu does not support vertical scroll, so it can not display the menu entries greater than the console row size. This commit add the vertial scroll support. The console size is retrieved by SIMPLE_TEXT_OUTPUT_PROTOCOL.QueryMode() service, then calculates the row size for menu entry by subtracting menu header and description row size from the console row size. "start" and "end" are added in the efimenu structure. "start" keeps the menu entry index at the top, "end" keeps the bottom menu entry index. item_data_print() menu function only draws the menu entry between "start" and "end". This commit also fixes the issue that "Save" and "Quit" entries can be moved by BKEY_PLUS in change boot order menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
0d590852 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation This commit removes the change boot order specific menu implementation. The change boot order implementation calls eficonfig_process_common() same as other menus. The change boot order menu requires own item_data_print and item_choice implementation, but display_statusline function can be a same function as other menus. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
cd160b27 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor eficonfig_process_common function Current change boot order implementation does not call eficonfig_process_common() and call own menu functions for display_statusline, item_data_print and item_choice. Change boot order functionality should call eficonfig_process_common() to improve maintenanceability. This commit is a preparation to remove the change boot order specific implementation. The menu functions (display_statusline, item_data_print and item_choice) are added as argument of eficonfig_process_common(). The menu description string displayed at the bottom of the menu is also added as argument. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
32bab0ea |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Make use of CLI character processing Avoid duplicating some of the escape-sequence processing here and use the CLI function instead. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
d0ca98db |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Update bootmenu_loop() to return the code Use the return value to save having to pass around a pointer. This also resolves any ambiguity about what *key contains when the function is called. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
2da4a15e |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Rename KEY_... to BKEY_... This enum values conflict with linux/input.h so rename them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
64550274 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: avoid SetVariable between GetNextVariableName calls The current code calls efi_set_variable_int() to delete the invalid boot option between calls to efi_get_next_variable_name_int(), it may produce unpredictable results. This commit moves removal of the invalid boot option outside of the efi_get_next_variable_name_int() calls. EFI_NOT_FOUND returned from efi_get_next_variable_name_int() indicates we retrieved all EFI variables, it should be treated as EFI_SUCEESS. To address the checkpatch warning of too many leading tabs, combine two if statement into one. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
ce327084 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: carve out efi_get_next_variable_name_int calls To retrieve the EFI variable name by efi_get_next_variable_name_int(), the sequence of alloc -> efi_get_next_variable_name_int -> realloc -> efi_get_next_variable_name_int is required. In current code, this sequence repeatedly appears in the several functions. It should be curved out a common function. This commit also fixes the missing free() of var_name16 in eficonfig_delete_invalid_boot_option(). Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
140a8959 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use efi_get_next_variable_name_int() eficonfig command reads all possible UEFI load options from 0x0000 to 0xFFFF to construct the menu. This takes too much time in some environment. This commit uses efi_get_next_variable_name_int() to read all existing UEFI load options to significantlly reduce the count of efi_get_var() call. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
78b1ccc4 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use u16_strsize() to get u16 string buffer size Use u16_strsize() to simplify the u16 string buffer size calculation. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c67d3c9e |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix going one directory up issue The directory name in eficonfig menu entry contains the '\' separator. strcmp() argument ".." is wrong and one directory up handling does not work correctly. strcmp() argument must include '\' separator. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c3b5af63 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add UEFI Secure Boot Key enrollment interface This commit adds the menu-driven UEFI Secure Boot Key enrollment interface. User can enroll PK, KEK, db and dbx by selecting file. Only the signed EFI Signature List(s) with an authenticated header, typically '.auth' file, is accepted. To clear the PK, KEK, db and dbx, user needs to enroll the null key signed by PK or KEK. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
21faf4ef |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use protocol interface for file selection EFI_SIMPLE_FILE_SYSTEM_PROTOCOL is not always provided by U-Boot. Use protocol interface functions instead of U-Boot internal functions. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d6566113 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose eficonfig_create_device_path() Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use eficonfig_create_device_path() to construct the full device path from device path of the volume and file path, so move it out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d571f9b2 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation All the eficonfig menus other than "Change Boot Order" use 'eficonfig_entry' structure for each menu entry. This commit refactors change boot order implementation to use 'eficonfig_entry' structure same as other menus to have consistent menu handling. This commit also simplifies the data->active handling when KEY_SPACE is pressed, and sizeof() parameter. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
8961e93e |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose append entry function Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use append_entry() and append_quit_entry() to construct the menu, so move them out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
a84040ab |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor file selection handling eficonfig_select_file_handler() is commonly used to select the file. eficonfig_display_select_file_option() adds an additional menu to clear the selected file. eficonfig_display_select_file_option() is not always necessary for the file selection process, so it must be outside of eficonfig_select_file_handler(). This commit also renames the following functions to avoid confusion. eficonfig_select_file_handler() -> eficonfig_process_select_file() eficonfig_select_file() -> eficonfig_show_file_selection() eficonfig_display_select_file_option() -> eficonfig_process_show_file_option() Finally, test_eficonfig.py need to be updated to get aligned with the above modification. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
1167e88a |
|
14-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix missing variable initialization The 'ret' variable must be initialized before use in eficonfig_delete_invalid_boot_option(). Fixes: c416f1c0bc ("bootmenu: add removable media entries") Addresses-Coverity: 376207 ("Uninitialized variables") Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
3d595ac5 |
|
09-Nov-2022 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: remove superfluous if in eficonfig_edit_boot_option Goto for an immediately succeeding label is superfluous. Fixes: 87d791423ac6 ("eficonfig: menu-driven addition of UEFI boot option") Addresses-Coverity: 376202 ("Identical code for different branches") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
9945bc4f |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Fix incorrect return code of boot option update Correct the return code for out-of-memory and no boot option found Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
339b527b |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Move bootorder and bootoption apis to lib Rename and move bootorder and bootoption apis from cmd to lib for re-use between eficonfig and bootmgr Fix 'unexpected indentation' when 'make htmldocs' after functions are moved Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
2c0b0c31 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_SECURE_BOOT This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_SECURE_BOOT defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
83f3d121 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_MM_COMM_TEE This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_MM_COMM_TEE defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
88df3634 |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: CTRL+S to save the boot order 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>
|
#
45f5319f |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
menu: remove CTRL+C to quit On the sandbox called without "--terminal raw" CTRL+C leaves U-Boot, "ESC/CTRL+C to quit" is misleading. Let's remove CTRL+C to quit key handling from bootmenu and eficonfig menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
|
#
8dbd0a0f |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add vertical scroll support The current eficonfig menu does not support vertical scroll, so it can not display the menu entries greater than the console row size. This commit add the vertial scroll support. The console size is retrieved by SIMPLE_TEXT_OUTPUT_PROTOCOL.QueryMode() service, then calculates the row size for menu entry by subtracting menu header and description row size from the console row size. "start" and "end" are added in the efimenu structure. "start" keeps the menu entry index at the top, "end" keeps the bottom menu entry index. item_data_print() menu function only draws the menu entry between "start" and "end". This commit also fixes the issue that "Save" and "Quit" entries can be moved by BKEY_PLUS in change boot order menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
0d590852 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation This commit removes the change boot order specific menu implementation. The change boot order implementation calls eficonfig_process_common() same as other menus. The change boot order menu requires own item_data_print and item_choice implementation, but display_statusline function can be a same function as other menus. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
cd160b27 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor eficonfig_process_common function Current change boot order implementation does not call eficonfig_process_common() and call own menu functions for display_statusline, item_data_print and item_choice. Change boot order functionality should call eficonfig_process_common() to improve maintenanceability. This commit is a preparation to remove the change boot order specific implementation. The menu functions (display_statusline, item_data_print and item_choice) are added as argument of eficonfig_process_common(). The menu description string displayed at the bottom of the menu is also added as argument. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
32bab0ea |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Make use of CLI character processing Avoid duplicating some of the escape-sequence processing here and use the CLI function instead. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
d0ca98db |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Update bootmenu_loop() to return the code Use the return value to save having to pass around a pointer. This also resolves any ambiguity about what *key contains when the function is called. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
2da4a15e |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Rename KEY_... to BKEY_... This enum values conflict with linux/input.h so rename them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
64550274 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: avoid SetVariable between GetNextVariableName calls The current code calls efi_set_variable_int() to delete the invalid boot option between calls to efi_get_next_variable_name_int(), it may produce unpredictable results. This commit moves removal of the invalid boot option outside of the efi_get_next_variable_name_int() calls. EFI_NOT_FOUND returned from efi_get_next_variable_name_int() indicates we retrieved all EFI variables, it should be treated as EFI_SUCEESS. To address the checkpatch warning of too many leading tabs, combine two if statement into one. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
ce327084 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: carve out efi_get_next_variable_name_int calls To retrieve the EFI variable name by efi_get_next_variable_name_int(), the sequence of alloc -> efi_get_next_variable_name_int -> realloc -> efi_get_next_variable_name_int is required. In current code, this sequence repeatedly appears in the several functions. It should be curved out a common function. This commit also fixes the missing free() of var_name16 in eficonfig_delete_invalid_boot_option(). Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
140a8959 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use efi_get_next_variable_name_int() eficonfig command reads all possible UEFI load options from 0x0000 to 0xFFFF to construct the menu. This takes too much time in some environment. This commit uses efi_get_next_variable_name_int() to read all existing UEFI load options to significantlly reduce the count of efi_get_var() call. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
78b1ccc4 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use u16_strsize() to get u16 string buffer size Use u16_strsize() to simplify the u16 string buffer size calculation. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c67d3c9e |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix going one directory up issue The directory name in eficonfig menu entry contains the '\' separator. strcmp() argument ".." is wrong and one directory up handling does not work correctly. strcmp() argument must include '\' separator. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c3b5af63 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add UEFI Secure Boot Key enrollment interface This commit adds the menu-driven UEFI Secure Boot Key enrollment interface. User can enroll PK, KEK, db and dbx by selecting file. Only the signed EFI Signature List(s) with an authenticated header, typically '.auth' file, is accepted. To clear the PK, KEK, db and dbx, user needs to enroll the null key signed by PK or KEK. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
21faf4ef |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use protocol interface for file selection EFI_SIMPLE_FILE_SYSTEM_PROTOCOL is not always provided by U-Boot. Use protocol interface functions instead of U-Boot internal functions. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d6566113 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose eficonfig_create_device_path() Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use eficonfig_create_device_path() to construct the full device path from device path of the volume and file path, so move it out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d571f9b2 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation All the eficonfig menus other than "Change Boot Order" use 'eficonfig_entry' structure for each menu entry. This commit refactors change boot order implementation to use 'eficonfig_entry' structure same as other menus to have consistent menu handling. This commit also simplifies the data->active handling when KEY_SPACE is pressed, and sizeof() parameter. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
8961e93e |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose append entry function Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use append_entry() and append_quit_entry() to construct the menu, so move them out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
a84040ab |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor file selection handling eficonfig_select_file_handler() is commonly used to select the file. eficonfig_display_select_file_option() adds an additional menu to clear the selected file. eficonfig_display_select_file_option() is not always necessary for the file selection process, so it must be outside of eficonfig_select_file_handler(). This commit also renames the following functions to avoid confusion. eficonfig_select_file_handler() -> eficonfig_process_select_file() eficonfig_select_file() -> eficonfig_show_file_selection() eficonfig_display_select_file_option() -> eficonfig_process_show_file_option() Finally, test_eficonfig.py need to be updated to get aligned with the above modification. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
1167e88a |
|
14-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix missing variable initialization The 'ret' variable must be initialized before use in eficonfig_delete_invalid_boot_option(). Fixes: c416f1c0bc ("bootmenu: add removable media entries") Addresses-Coverity: 376207 ("Uninitialized variables") Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
3d595ac5 |
|
09-Nov-2022 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: remove superfluous if in eficonfig_edit_boot_option Goto for an immediately succeeding label is superfluous. Fixes: 87d791423ac6 ("eficonfig: menu-driven addition of UEFI boot option") Addresses-Coverity: 376202 ("Identical code for different branches") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
9945bc4f |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Fix incorrect return code of boot option update Correct the return code for out-of-memory and no boot option found Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
339b527b |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Move bootorder and bootoption apis to lib Rename and move bootorder and bootoption apis from cmd to lib for re-use between eficonfig and bootmgr Fix 'unexpected indentation' when 'make htmldocs' after functions are moved Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
2c0b0c31 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_SECURE_BOOT This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_SECURE_BOOT defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
83f3d121 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_MM_COMM_TEE This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_MM_COMM_TEE defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
88df3634 |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: CTRL+S to save the boot order 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>
|
#
45f5319f |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
menu: remove CTRL+C to quit On the sandbox called without "--terminal raw" CTRL+C leaves U-Boot, "ESC/CTRL+C to quit" is misleading. Let's remove CTRL+C to quit key handling from bootmenu and eficonfig menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
|
#
8dbd0a0f |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add vertical scroll support The current eficonfig menu does not support vertical scroll, so it can not display the menu entries greater than the console row size. This commit add the vertial scroll support. The console size is retrieved by SIMPLE_TEXT_OUTPUT_PROTOCOL.QueryMode() service, then calculates the row size for menu entry by subtracting menu header and description row size from the console row size. "start" and "end" are added in the efimenu structure. "start" keeps the menu entry index at the top, "end" keeps the bottom menu entry index. item_data_print() menu function only draws the menu entry between "start" and "end". This commit also fixes the issue that "Save" and "Quit" entries can be moved by BKEY_PLUS in change boot order menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
0d590852 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation This commit removes the change boot order specific menu implementation. The change boot order implementation calls eficonfig_process_common() same as other menus. The change boot order menu requires own item_data_print and item_choice implementation, but display_statusline function can be a same function as other menus. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
cd160b27 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor eficonfig_process_common function Current change boot order implementation does not call eficonfig_process_common() and call own menu functions for display_statusline, item_data_print and item_choice. Change boot order functionality should call eficonfig_process_common() to improve maintenanceability. This commit is a preparation to remove the change boot order specific implementation. The menu functions (display_statusline, item_data_print and item_choice) are added as argument of eficonfig_process_common(). The menu description string displayed at the bottom of the menu is also added as argument. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
32bab0ea |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Make use of CLI character processing Avoid duplicating some of the escape-sequence processing here and use the CLI function instead. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
d0ca98db |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Update bootmenu_loop() to return the code Use the return value to save having to pass around a pointer. This also resolves any ambiguity about what *key contains when the function is called. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
2da4a15e |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Rename KEY_... to BKEY_... This enum values conflict with linux/input.h so rename them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
64550274 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: avoid SetVariable between GetNextVariableName calls The current code calls efi_set_variable_int() to delete the invalid boot option between calls to efi_get_next_variable_name_int(), it may produce unpredictable results. This commit moves removal of the invalid boot option outside of the efi_get_next_variable_name_int() calls. EFI_NOT_FOUND returned from efi_get_next_variable_name_int() indicates we retrieved all EFI variables, it should be treated as EFI_SUCEESS. To address the checkpatch warning of too many leading tabs, combine two if statement into one. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
ce327084 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: carve out efi_get_next_variable_name_int calls To retrieve the EFI variable name by efi_get_next_variable_name_int(), the sequence of alloc -> efi_get_next_variable_name_int -> realloc -> efi_get_next_variable_name_int is required. In current code, this sequence repeatedly appears in the several functions. It should be curved out a common function. This commit also fixes the missing free() of var_name16 in eficonfig_delete_invalid_boot_option(). Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
140a8959 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use efi_get_next_variable_name_int() eficonfig command reads all possible UEFI load options from 0x0000 to 0xFFFF to construct the menu. This takes too much time in some environment. This commit uses efi_get_next_variable_name_int() to read all existing UEFI load options to significantlly reduce the count of efi_get_var() call. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
78b1ccc4 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use u16_strsize() to get u16 string buffer size Use u16_strsize() to simplify the u16 string buffer size calculation. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c67d3c9e |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix going one directory up issue The directory name in eficonfig menu entry contains the '\' separator. strcmp() argument ".." is wrong and one directory up handling does not work correctly. strcmp() argument must include '\' separator. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c3b5af63 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add UEFI Secure Boot Key enrollment interface This commit adds the menu-driven UEFI Secure Boot Key enrollment interface. User can enroll PK, KEK, db and dbx by selecting file. Only the signed EFI Signature List(s) with an authenticated header, typically '.auth' file, is accepted. To clear the PK, KEK, db and dbx, user needs to enroll the null key signed by PK or KEK. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
21faf4ef |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use protocol interface for file selection EFI_SIMPLE_FILE_SYSTEM_PROTOCOL is not always provided by U-Boot. Use protocol interface functions instead of U-Boot internal functions. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d6566113 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose eficonfig_create_device_path() Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use eficonfig_create_device_path() to construct the full device path from device path of the volume and file path, so move it out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d571f9b2 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation All the eficonfig menus other than "Change Boot Order" use 'eficonfig_entry' structure for each menu entry. This commit refactors change boot order implementation to use 'eficonfig_entry' structure same as other menus to have consistent menu handling. This commit also simplifies the data->active handling when KEY_SPACE is pressed, and sizeof() parameter. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
8961e93e |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose append entry function Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use append_entry() and append_quit_entry() to construct the menu, so move them out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
a84040ab |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor file selection handling eficonfig_select_file_handler() is commonly used to select the file. eficonfig_display_select_file_option() adds an additional menu to clear the selected file. eficonfig_display_select_file_option() is not always necessary for the file selection process, so it must be outside of eficonfig_select_file_handler(). This commit also renames the following functions to avoid confusion. eficonfig_select_file_handler() -> eficonfig_process_select_file() eficonfig_select_file() -> eficonfig_show_file_selection() eficonfig_display_select_file_option() -> eficonfig_process_show_file_option() Finally, test_eficonfig.py need to be updated to get aligned with the above modification. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
1167e88a |
|
14-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix missing variable initialization The 'ret' variable must be initialized before use in eficonfig_delete_invalid_boot_option(). Fixes: c416f1c0bc ("bootmenu: add removable media entries") Addresses-Coverity: 376207 ("Uninitialized variables") Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
3d595ac5 |
|
09-Nov-2022 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: remove superfluous if in eficonfig_edit_boot_option Goto for an immediately succeeding label is superfluous. Fixes: 87d791423ac6 ("eficonfig: menu-driven addition of UEFI boot option") Addresses-Coverity: 376202 ("Identical code for different branches") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
9945bc4f |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Fix incorrect return code of boot option update Correct the return code for out-of-memory and no boot option found Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
339b527b |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Move bootorder and bootoption apis to lib Rename and move bootorder and bootoption apis from cmd to lib for re-use between eficonfig and bootmgr Fix 'unexpected indentation' when 'make htmldocs' after functions are moved Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
2c0b0c31 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_SECURE_BOOT This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_SECURE_BOOT defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
83f3d121 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_MM_COMM_TEE This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_MM_COMM_TEE defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
88df3634 |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: CTRL+S to save the boot order 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>
|
#
45f5319f |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
menu: remove CTRL+C to quit On the sandbox called without "--terminal raw" CTRL+C leaves U-Boot, "ESC/CTRL+C to quit" is misleading. Let's remove CTRL+C to quit key handling from bootmenu and eficonfig menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
|
#
8dbd0a0f |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add vertical scroll support The current eficonfig menu does not support vertical scroll, so it can not display the menu entries greater than the console row size. This commit add the vertial scroll support. The console size is retrieved by SIMPLE_TEXT_OUTPUT_PROTOCOL.QueryMode() service, then calculates the row size for menu entry by subtracting menu header and description row size from the console row size. "start" and "end" are added in the efimenu structure. "start" keeps the menu entry index at the top, "end" keeps the bottom menu entry index. item_data_print() menu function only draws the menu entry between "start" and "end". This commit also fixes the issue that "Save" and "Quit" entries can be moved by BKEY_PLUS in change boot order menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
0d590852 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation This commit removes the change boot order specific menu implementation. The change boot order implementation calls eficonfig_process_common() same as other menus. The change boot order menu requires own item_data_print and item_choice implementation, but display_statusline function can be a same function as other menus. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
cd160b27 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor eficonfig_process_common function Current change boot order implementation does not call eficonfig_process_common() and call own menu functions for display_statusline, item_data_print and item_choice. Change boot order functionality should call eficonfig_process_common() to improve maintenanceability. This commit is a preparation to remove the change boot order specific implementation. The menu functions (display_statusline, item_data_print and item_choice) are added as argument of eficonfig_process_common(). The menu description string displayed at the bottom of the menu is also added as argument. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
32bab0ea |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Make use of CLI character processing Avoid duplicating some of the escape-sequence processing here and use the CLI function instead. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
d0ca98db |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Update bootmenu_loop() to return the code Use the return value to save having to pass around a pointer. This also resolves any ambiguity about what *key contains when the function is called. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
2da4a15e |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Rename KEY_... to BKEY_... This enum values conflict with linux/input.h so rename them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
64550274 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: avoid SetVariable between GetNextVariableName calls The current code calls efi_set_variable_int() to delete the invalid boot option between calls to efi_get_next_variable_name_int(), it may produce unpredictable results. This commit moves removal of the invalid boot option outside of the efi_get_next_variable_name_int() calls. EFI_NOT_FOUND returned from efi_get_next_variable_name_int() indicates we retrieved all EFI variables, it should be treated as EFI_SUCEESS. To address the checkpatch warning of too many leading tabs, combine two if statement into one. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
ce327084 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: carve out efi_get_next_variable_name_int calls To retrieve the EFI variable name by efi_get_next_variable_name_int(), the sequence of alloc -> efi_get_next_variable_name_int -> realloc -> efi_get_next_variable_name_int is required. In current code, this sequence repeatedly appears in the several functions. It should be curved out a common function. This commit also fixes the missing free() of var_name16 in eficonfig_delete_invalid_boot_option(). Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
140a8959 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use efi_get_next_variable_name_int() eficonfig command reads all possible UEFI load options from 0x0000 to 0xFFFF to construct the menu. This takes too much time in some environment. This commit uses efi_get_next_variable_name_int() to read all existing UEFI load options to significantlly reduce the count of efi_get_var() call. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
78b1ccc4 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use u16_strsize() to get u16 string buffer size Use u16_strsize() to simplify the u16 string buffer size calculation. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c67d3c9e |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix going one directory up issue The directory name in eficonfig menu entry contains the '\' separator. strcmp() argument ".." is wrong and one directory up handling does not work correctly. strcmp() argument must include '\' separator. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c3b5af63 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add UEFI Secure Boot Key enrollment interface This commit adds the menu-driven UEFI Secure Boot Key enrollment interface. User can enroll PK, KEK, db and dbx by selecting file. Only the signed EFI Signature List(s) with an authenticated header, typically '.auth' file, is accepted. To clear the PK, KEK, db and dbx, user needs to enroll the null key signed by PK or KEK. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
21faf4ef |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use protocol interface for file selection EFI_SIMPLE_FILE_SYSTEM_PROTOCOL is not always provided by U-Boot. Use protocol interface functions instead of U-Boot internal functions. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d6566113 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose eficonfig_create_device_path() Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use eficonfig_create_device_path() to construct the full device path from device path of the volume and file path, so move it out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d571f9b2 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation All the eficonfig menus other than "Change Boot Order" use 'eficonfig_entry' structure for each menu entry. This commit refactors change boot order implementation to use 'eficonfig_entry' structure same as other menus to have consistent menu handling. This commit also simplifies the data->active handling when KEY_SPACE is pressed, and sizeof() parameter. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
8961e93e |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose append entry function Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use append_entry() and append_quit_entry() to construct the menu, so move them out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
a84040ab |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor file selection handling eficonfig_select_file_handler() is commonly used to select the file. eficonfig_display_select_file_option() adds an additional menu to clear the selected file. eficonfig_display_select_file_option() is not always necessary for the file selection process, so it must be outside of eficonfig_select_file_handler(). This commit also renames the following functions to avoid confusion. eficonfig_select_file_handler() -> eficonfig_process_select_file() eficonfig_select_file() -> eficonfig_show_file_selection() eficonfig_display_select_file_option() -> eficonfig_process_show_file_option() Finally, test_eficonfig.py need to be updated to get aligned with the above modification. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
1167e88a |
|
14-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix missing variable initialization The 'ret' variable must be initialized before use in eficonfig_delete_invalid_boot_option(). Fixes: c416f1c0bc ("bootmenu: add removable media entries") Addresses-Coverity: 376207 ("Uninitialized variables") Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
3d595ac5 |
|
09-Nov-2022 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: remove superfluous if in eficonfig_edit_boot_option Goto for an immediately succeeding label is superfluous. Fixes: 87d791423ac6 ("eficonfig: menu-driven addition of UEFI boot option") Addresses-Coverity: 376202 ("Identical code for different branches") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
9945bc4f |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Fix incorrect return code of boot option update Correct the return code for out-of-memory and no boot option found Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
339b527b |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Move bootorder and bootoption apis to lib Rename and move bootorder and bootoption apis from cmd to lib for re-use between eficonfig and bootmgr Fix 'unexpected indentation' when 'make htmldocs' after functions are moved Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
2c0b0c31 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_SECURE_BOOT This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_SECURE_BOOT defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
83f3d121 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_MM_COMM_TEE This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_MM_COMM_TEE defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
88df3634 |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: CTRL+S to save the boot order 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>
|
#
45f5319f |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
menu: remove CTRL+C to quit On the sandbox called without "--terminal raw" CTRL+C leaves U-Boot, "ESC/CTRL+C to quit" is misleading. Let's remove CTRL+C to quit key handling from bootmenu and eficonfig menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
|
#
8dbd0a0f |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add vertical scroll support The current eficonfig menu does not support vertical scroll, so it can not display the menu entries greater than the console row size. This commit add the vertial scroll support. The console size is retrieved by SIMPLE_TEXT_OUTPUT_PROTOCOL.QueryMode() service, then calculates the row size for menu entry by subtracting menu header and description row size from the console row size. "start" and "end" are added in the efimenu structure. "start" keeps the menu entry index at the top, "end" keeps the bottom menu entry index. item_data_print() menu function only draws the menu entry between "start" and "end". This commit also fixes the issue that "Save" and "Quit" entries can be moved by BKEY_PLUS in change boot order menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
0d590852 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation This commit removes the change boot order specific menu implementation. The change boot order implementation calls eficonfig_process_common() same as other menus. The change boot order menu requires own item_data_print and item_choice implementation, but display_statusline function can be a same function as other menus. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
cd160b27 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor eficonfig_process_common function Current change boot order implementation does not call eficonfig_process_common() and call own menu functions for display_statusline, item_data_print and item_choice. Change boot order functionality should call eficonfig_process_common() to improve maintenanceability. This commit is a preparation to remove the change boot order specific implementation. The menu functions (display_statusline, item_data_print and item_choice) are added as argument of eficonfig_process_common(). The menu description string displayed at the bottom of the menu is also added as argument. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
32bab0ea |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Make use of CLI character processing Avoid duplicating some of the escape-sequence processing here and use the CLI function instead. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
d0ca98db |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Update bootmenu_loop() to return the code Use the return value to save having to pass around a pointer. This also resolves any ambiguity about what *key contains when the function is called. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
2da4a15e |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Rename KEY_... to BKEY_... This enum values conflict with linux/input.h so rename them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
64550274 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: avoid SetVariable between GetNextVariableName calls The current code calls efi_set_variable_int() to delete the invalid boot option between calls to efi_get_next_variable_name_int(), it may produce unpredictable results. This commit moves removal of the invalid boot option outside of the efi_get_next_variable_name_int() calls. EFI_NOT_FOUND returned from efi_get_next_variable_name_int() indicates we retrieved all EFI variables, it should be treated as EFI_SUCEESS. To address the checkpatch warning of too many leading tabs, combine two if statement into one. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
ce327084 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: carve out efi_get_next_variable_name_int calls To retrieve the EFI variable name by efi_get_next_variable_name_int(), the sequence of alloc -> efi_get_next_variable_name_int -> realloc -> efi_get_next_variable_name_int is required. In current code, this sequence repeatedly appears in the several functions. It should be curved out a common function. This commit also fixes the missing free() of var_name16 in eficonfig_delete_invalid_boot_option(). Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
140a8959 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use efi_get_next_variable_name_int() eficonfig command reads all possible UEFI load options from 0x0000 to 0xFFFF to construct the menu. This takes too much time in some environment. This commit uses efi_get_next_variable_name_int() to read all existing UEFI load options to significantlly reduce the count of efi_get_var() call. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
78b1ccc4 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use u16_strsize() to get u16 string buffer size Use u16_strsize() to simplify the u16 string buffer size calculation. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c67d3c9e |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix going one directory up issue The directory name in eficonfig menu entry contains the '\' separator. strcmp() argument ".." is wrong and one directory up handling does not work correctly. strcmp() argument must include '\' separator. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c3b5af63 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add UEFI Secure Boot Key enrollment interface This commit adds the menu-driven UEFI Secure Boot Key enrollment interface. User can enroll PK, KEK, db and dbx by selecting file. Only the signed EFI Signature List(s) with an authenticated header, typically '.auth' file, is accepted. To clear the PK, KEK, db and dbx, user needs to enroll the null key signed by PK or KEK. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
21faf4ef |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use protocol interface for file selection EFI_SIMPLE_FILE_SYSTEM_PROTOCOL is not always provided by U-Boot. Use protocol interface functions instead of U-Boot internal functions. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d6566113 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose eficonfig_create_device_path() Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use eficonfig_create_device_path() to construct the full device path from device path of the volume and file path, so move it out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d571f9b2 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation All the eficonfig menus other than "Change Boot Order" use 'eficonfig_entry' structure for each menu entry. This commit refactors change boot order implementation to use 'eficonfig_entry' structure same as other menus to have consistent menu handling. This commit also simplifies the data->active handling when KEY_SPACE is pressed, and sizeof() parameter. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
8961e93e |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose append entry function Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use append_entry() and append_quit_entry() to construct the menu, so move them out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
a84040ab |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor file selection handling eficonfig_select_file_handler() is commonly used to select the file. eficonfig_display_select_file_option() adds an additional menu to clear the selected file. eficonfig_display_select_file_option() is not always necessary for the file selection process, so it must be outside of eficonfig_select_file_handler(). This commit also renames the following functions to avoid confusion. eficonfig_select_file_handler() -> eficonfig_process_select_file() eficonfig_select_file() -> eficonfig_show_file_selection() eficonfig_display_select_file_option() -> eficonfig_process_show_file_option() Finally, test_eficonfig.py need to be updated to get aligned with the above modification. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
1167e88a |
|
14-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix missing variable initialization The 'ret' variable must be initialized before use in eficonfig_delete_invalid_boot_option(). Fixes: c416f1c0bc ("bootmenu: add removable media entries") Addresses-Coverity: 376207 ("Uninitialized variables") Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
3d595ac5 |
|
09-Nov-2022 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: remove superfluous if in eficonfig_edit_boot_option Goto for an immediately succeeding label is superfluous. Fixes: 87d791423ac6 ("eficonfig: menu-driven addition of UEFI boot option") Addresses-Coverity: 376202 ("Identical code for different branches") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
9945bc4f |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Fix incorrect return code of boot option update Correct the return code for out-of-memory and no boot option found Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
339b527b |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Move bootorder and bootoption apis to lib Rename and move bootorder and bootoption apis from cmd to lib for re-use between eficonfig and bootmgr Fix 'unexpected indentation' when 'make htmldocs' after functions are moved Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
2c0b0c31 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_SECURE_BOOT This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_SECURE_BOOT defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
83f3d121 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_MM_COMM_TEE This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_MM_COMM_TEE defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
88df3634 |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: CTRL+S to save the boot order 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>
|
#
45f5319f |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
menu: remove CTRL+C to quit On the sandbox called without "--terminal raw" CTRL+C leaves U-Boot, "ESC/CTRL+C to quit" is misleading. Let's remove CTRL+C to quit key handling from bootmenu and eficonfig menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
|
#
8dbd0a0f |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add vertical scroll support The current eficonfig menu does not support vertical scroll, so it can not display the menu entries greater than the console row size. This commit add the vertial scroll support. The console size is retrieved by SIMPLE_TEXT_OUTPUT_PROTOCOL.QueryMode() service, then calculates the row size for menu entry by subtracting menu header and description row size from the console row size. "start" and "end" are added in the efimenu structure. "start" keeps the menu entry index at the top, "end" keeps the bottom menu entry index. item_data_print() menu function only draws the menu entry between "start" and "end". This commit also fixes the issue that "Save" and "Quit" entries can be moved by BKEY_PLUS in change boot order menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
0d590852 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation This commit removes the change boot order specific menu implementation. The change boot order implementation calls eficonfig_process_common() same as other menus. The change boot order menu requires own item_data_print and item_choice implementation, but display_statusline function can be a same function as other menus. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
cd160b27 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor eficonfig_process_common function Current change boot order implementation does not call eficonfig_process_common() and call own menu functions for display_statusline, item_data_print and item_choice. Change boot order functionality should call eficonfig_process_common() to improve maintenanceability. This commit is a preparation to remove the change boot order specific implementation. The menu functions (display_statusline, item_data_print and item_choice) are added as argument of eficonfig_process_common(). The menu description string displayed at the bottom of the menu is also added as argument. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
32bab0ea |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Make use of CLI character processing Avoid duplicating some of the escape-sequence processing here and use the CLI function instead. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
d0ca98db |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Update bootmenu_loop() to return the code Use the return value to save having to pass around a pointer. This also resolves any ambiguity about what *key contains when the function is called. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
2da4a15e |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Rename KEY_... to BKEY_... This enum values conflict with linux/input.h so rename them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
64550274 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: avoid SetVariable between GetNextVariableName calls The current code calls efi_set_variable_int() to delete the invalid boot option between calls to efi_get_next_variable_name_int(), it may produce unpredictable results. This commit moves removal of the invalid boot option outside of the efi_get_next_variable_name_int() calls. EFI_NOT_FOUND returned from efi_get_next_variable_name_int() indicates we retrieved all EFI variables, it should be treated as EFI_SUCEESS. To address the checkpatch warning of too many leading tabs, combine two if statement into one. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
ce327084 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: carve out efi_get_next_variable_name_int calls To retrieve the EFI variable name by efi_get_next_variable_name_int(), the sequence of alloc -> efi_get_next_variable_name_int -> realloc -> efi_get_next_variable_name_int is required. In current code, this sequence repeatedly appears in the several functions. It should be curved out a common function. This commit also fixes the missing free() of var_name16 in eficonfig_delete_invalid_boot_option(). Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
140a8959 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use efi_get_next_variable_name_int() eficonfig command reads all possible UEFI load options from 0x0000 to 0xFFFF to construct the menu. This takes too much time in some environment. This commit uses efi_get_next_variable_name_int() to read all existing UEFI load options to significantlly reduce the count of efi_get_var() call. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
78b1ccc4 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use u16_strsize() to get u16 string buffer size Use u16_strsize() to simplify the u16 string buffer size calculation. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c67d3c9e |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix going one directory up issue The directory name in eficonfig menu entry contains the '\' separator. strcmp() argument ".." is wrong and one directory up handling does not work correctly. strcmp() argument must include '\' separator. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c3b5af63 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add UEFI Secure Boot Key enrollment interface This commit adds the menu-driven UEFI Secure Boot Key enrollment interface. User can enroll PK, KEK, db and dbx by selecting file. Only the signed EFI Signature List(s) with an authenticated header, typically '.auth' file, is accepted. To clear the PK, KEK, db and dbx, user needs to enroll the null key signed by PK or KEK. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
21faf4ef |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use protocol interface for file selection EFI_SIMPLE_FILE_SYSTEM_PROTOCOL is not always provided by U-Boot. Use protocol interface functions instead of U-Boot internal functions. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d6566113 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose eficonfig_create_device_path() Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use eficonfig_create_device_path() to construct the full device path from device path of the volume and file path, so move it out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d571f9b2 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation All the eficonfig menus other than "Change Boot Order" use 'eficonfig_entry' structure for each menu entry. This commit refactors change boot order implementation to use 'eficonfig_entry' structure same as other menus to have consistent menu handling. This commit also simplifies the data->active handling when KEY_SPACE is pressed, and sizeof() parameter. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
8961e93e |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose append entry function Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use append_entry() and append_quit_entry() to construct the menu, so move them out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
a84040ab |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor file selection handling eficonfig_select_file_handler() is commonly used to select the file. eficonfig_display_select_file_option() adds an additional menu to clear the selected file. eficonfig_display_select_file_option() is not always necessary for the file selection process, so it must be outside of eficonfig_select_file_handler(). This commit also renames the following functions to avoid confusion. eficonfig_select_file_handler() -> eficonfig_process_select_file() eficonfig_select_file() -> eficonfig_show_file_selection() eficonfig_display_select_file_option() -> eficonfig_process_show_file_option() Finally, test_eficonfig.py need to be updated to get aligned with the above modification. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
1167e88a |
|
14-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix missing variable initialization The 'ret' variable must be initialized before use in eficonfig_delete_invalid_boot_option(). Fixes: c416f1c0bc ("bootmenu: add removable media entries") Addresses-Coverity: 376207 ("Uninitialized variables") Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
3d595ac5 |
|
09-Nov-2022 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: remove superfluous if in eficonfig_edit_boot_option Goto for an immediately succeeding label is superfluous. Fixes: 87d791423ac6 ("eficonfig: menu-driven addition of UEFI boot option") Addresses-Coverity: 376202 ("Identical code for different branches") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
9945bc4f |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Fix incorrect return code of boot option update Correct the return code for out-of-memory and no boot option found Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
339b527b |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Move bootorder and bootoption apis to lib Rename and move bootorder and bootoption apis from cmd to lib for re-use between eficonfig and bootmgr Fix 'unexpected indentation' when 'make htmldocs' after functions are moved Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
2c0b0c31 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_SECURE_BOOT This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_SECURE_BOOT defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
83f3d121 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_MM_COMM_TEE This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_MM_COMM_TEE defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
88df3634 |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: CTRL+S to save the boot order 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>
|
#
45f5319f |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
menu: remove CTRL+C to quit On the sandbox called without "--terminal raw" CTRL+C leaves U-Boot, "ESC/CTRL+C to quit" is misleading. Let's remove CTRL+C to quit key handling from bootmenu and eficonfig menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
|
#
8dbd0a0f |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add vertical scroll support The current eficonfig menu does not support vertical scroll, so it can not display the menu entries greater than the console row size. This commit add the vertial scroll support. The console size is retrieved by SIMPLE_TEXT_OUTPUT_PROTOCOL.QueryMode() service, then calculates the row size for menu entry by subtracting menu header and description row size from the console row size. "start" and "end" are added in the efimenu structure. "start" keeps the menu entry index at the top, "end" keeps the bottom menu entry index. item_data_print() menu function only draws the menu entry between "start" and "end". This commit also fixes the issue that "Save" and "Quit" entries can be moved by BKEY_PLUS in change boot order menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
0d590852 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation This commit removes the change boot order specific menu implementation. The change boot order implementation calls eficonfig_process_common() same as other menus. The change boot order menu requires own item_data_print and item_choice implementation, but display_statusline function can be a same function as other menus. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
cd160b27 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor eficonfig_process_common function Current change boot order implementation does not call eficonfig_process_common() and call own menu functions for display_statusline, item_data_print and item_choice. Change boot order functionality should call eficonfig_process_common() to improve maintenanceability. This commit is a preparation to remove the change boot order specific implementation. The menu functions (display_statusline, item_data_print and item_choice) are added as argument of eficonfig_process_common(). The menu description string displayed at the bottom of the menu is also added as argument. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
32bab0ea |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Make use of CLI character processing Avoid duplicating some of the escape-sequence processing here and use the CLI function instead. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
d0ca98db |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Update bootmenu_loop() to return the code Use the return value to save having to pass around a pointer. This also resolves any ambiguity about what *key contains when the function is called. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
2da4a15e |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Rename KEY_... to BKEY_... This enum values conflict with linux/input.h so rename them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
64550274 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: avoid SetVariable between GetNextVariableName calls The current code calls efi_set_variable_int() to delete the invalid boot option between calls to efi_get_next_variable_name_int(), it may produce unpredictable results. This commit moves removal of the invalid boot option outside of the efi_get_next_variable_name_int() calls. EFI_NOT_FOUND returned from efi_get_next_variable_name_int() indicates we retrieved all EFI variables, it should be treated as EFI_SUCEESS. To address the checkpatch warning of too many leading tabs, combine two if statement into one. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
ce327084 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: carve out efi_get_next_variable_name_int calls To retrieve the EFI variable name by efi_get_next_variable_name_int(), the sequence of alloc -> efi_get_next_variable_name_int -> realloc -> efi_get_next_variable_name_int is required. In current code, this sequence repeatedly appears in the several functions. It should be curved out a common function. This commit also fixes the missing free() of var_name16 in eficonfig_delete_invalid_boot_option(). Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
140a8959 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use efi_get_next_variable_name_int() eficonfig command reads all possible UEFI load options from 0x0000 to 0xFFFF to construct the menu. This takes too much time in some environment. This commit uses efi_get_next_variable_name_int() to read all existing UEFI load options to significantlly reduce the count of efi_get_var() call. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
78b1ccc4 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use u16_strsize() to get u16 string buffer size Use u16_strsize() to simplify the u16 string buffer size calculation. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c67d3c9e |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix going one directory up issue The directory name in eficonfig menu entry contains the '\' separator. strcmp() argument ".." is wrong and one directory up handling does not work correctly. strcmp() argument must include '\' separator. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c3b5af63 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add UEFI Secure Boot Key enrollment interface This commit adds the menu-driven UEFI Secure Boot Key enrollment interface. User can enroll PK, KEK, db and dbx by selecting file. Only the signed EFI Signature List(s) with an authenticated header, typically '.auth' file, is accepted. To clear the PK, KEK, db and dbx, user needs to enroll the null key signed by PK or KEK. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
21faf4ef |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use protocol interface for file selection EFI_SIMPLE_FILE_SYSTEM_PROTOCOL is not always provided by U-Boot. Use protocol interface functions instead of U-Boot internal functions. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d6566113 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose eficonfig_create_device_path() Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use eficonfig_create_device_path() to construct the full device path from device path of the volume and file path, so move it out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d571f9b2 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation All the eficonfig menus other than "Change Boot Order" use 'eficonfig_entry' structure for each menu entry. This commit refactors change boot order implementation to use 'eficonfig_entry' structure same as other menus to have consistent menu handling. This commit also simplifies the data->active handling when KEY_SPACE is pressed, and sizeof() parameter. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
8961e93e |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose append entry function Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use append_entry() and append_quit_entry() to construct the menu, so move them out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
a84040ab |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor file selection handling eficonfig_select_file_handler() is commonly used to select the file. eficonfig_display_select_file_option() adds an additional menu to clear the selected file. eficonfig_display_select_file_option() is not always necessary for the file selection process, so it must be outside of eficonfig_select_file_handler(). This commit also renames the following functions to avoid confusion. eficonfig_select_file_handler() -> eficonfig_process_select_file() eficonfig_select_file() -> eficonfig_show_file_selection() eficonfig_display_select_file_option() -> eficonfig_process_show_file_option() Finally, test_eficonfig.py need to be updated to get aligned with the above modification. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
1167e88a |
|
14-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix missing variable initialization The 'ret' variable must be initialized before use in eficonfig_delete_invalid_boot_option(). Fixes: c416f1c0bc ("bootmenu: add removable media entries") Addresses-Coverity: 376207 ("Uninitialized variables") Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
3d595ac5 |
|
09-Nov-2022 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: remove superfluous if in eficonfig_edit_boot_option Goto for an immediately succeeding label is superfluous. Fixes: 87d791423ac6 ("eficonfig: menu-driven addition of UEFI boot option") Addresses-Coverity: 376202 ("Identical code for different branches") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
9945bc4f |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Fix incorrect return code of boot option update Correct the return code for out-of-memory and no boot option found Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
339b527b |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Move bootorder and bootoption apis to lib Rename and move bootorder and bootoption apis from cmd to lib for re-use between eficonfig and bootmgr Fix 'unexpected indentation' when 'make htmldocs' after functions are moved Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
2c0b0c31 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_SECURE_BOOT This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_SECURE_BOOT defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
83f3d121 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_MM_COMM_TEE This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_MM_COMM_TEE defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
88df3634 |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: CTRL+S to save the boot order 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>
|
#
45f5319f |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
menu: remove CTRL+C to quit On the sandbox called without "--terminal raw" CTRL+C leaves U-Boot, "ESC/CTRL+C to quit" is misleading. Let's remove CTRL+C to quit key handling from bootmenu and eficonfig menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
|
#
8dbd0a0f |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add vertical scroll support The current eficonfig menu does not support vertical scroll, so it can not display the menu entries greater than the console row size. This commit add the vertial scroll support. The console size is retrieved by SIMPLE_TEXT_OUTPUT_PROTOCOL.QueryMode() service, then calculates the row size for menu entry by subtracting menu header and description row size from the console row size. "start" and "end" are added in the efimenu structure. "start" keeps the menu entry index at the top, "end" keeps the bottom menu entry index. item_data_print() menu function only draws the menu entry between "start" and "end". This commit also fixes the issue that "Save" and "Quit" entries can be moved by BKEY_PLUS in change boot order menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
0d590852 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation This commit removes the change boot order specific menu implementation. The change boot order implementation calls eficonfig_process_common() same as other menus. The change boot order menu requires own item_data_print and item_choice implementation, but display_statusline function can be a same function as other menus. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
cd160b27 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor eficonfig_process_common function Current change boot order implementation does not call eficonfig_process_common() and call own menu functions for display_statusline, item_data_print and item_choice. Change boot order functionality should call eficonfig_process_common() to improve maintenanceability. This commit is a preparation to remove the change boot order specific implementation. The menu functions (display_statusline, item_data_print and item_choice) are added as argument of eficonfig_process_common(). The menu description string displayed at the bottom of the menu is also added as argument. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
32bab0ea |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Make use of CLI character processing Avoid duplicating some of the escape-sequence processing here and use the CLI function instead. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
d0ca98db |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Update bootmenu_loop() to return the code Use the return value to save having to pass around a pointer. This also resolves any ambiguity about what *key contains when the function is called. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
2da4a15e |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Rename KEY_... to BKEY_... This enum values conflict with linux/input.h so rename them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
64550274 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: avoid SetVariable between GetNextVariableName calls The current code calls efi_set_variable_int() to delete the invalid boot option between calls to efi_get_next_variable_name_int(), it may produce unpredictable results. This commit moves removal of the invalid boot option outside of the efi_get_next_variable_name_int() calls. EFI_NOT_FOUND returned from efi_get_next_variable_name_int() indicates we retrieved all EFI variables, it should be treated as EFI_SUCEESS. To address the checkpatch warning of too many leading tabs, combine two if statement into one. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
ce327084 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: carve out efi_get_next_variable_name_int calls To retrieve the EFI variable name by efi_get_next_variable_name_int(), the sequence of alloc -> efi_get_next_variable_name_int -> realloc -> efi_get_next_variable_name_int is required. In current code, this sequence repeatedly appears in the several functions. It should be curved out a common function. This commit also fixes the missing free() of var_name16 in eficonfig_delete_invalid_boot_option(). Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
140a8959 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use efi_get_next_variable_name_int() eficonfig command reads all possible UEFI load options from 0x0000 to 0xFFFF to construct the menu. This takes too much time in some environment. This commit uses efi_get_next_variable_name_int() to read all existing UEFI load options to significantlly reduce the count of efi_get_var() call. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
78b1ccc4 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use u16_strsize() to get u16 string buffer size Use u16_strsize() to simplify the u16 string buffer size calculation. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c67d3c9e |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix going one directory up issue The directory name in eficonfig menu entry contains the '\' separator. strcmp() argument ".." is wrong and one directory up handling does not work correctly. strcmp() argument must include '\' separator. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c3b5af63 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add UEFI Secure Boot Key enrollment interface This commit adds the menu-driven UEFI Secure Boot Key enrollment interface. User can enroll PK, KEK, db and dbx by selecting file. Only the signed EFI Signature List(s) with an authenticated header, typically '.auth' file, is accepted. To clear the PK, KEK, db and dbx, user needs to enroll the null key signed by PK or KEK. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
21faf4ef |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use protocol interface for file selection EFI_SIMPLE_FILE_SYSTEM_PROTOCOL is not always provided by U-Boot. Use protocol interface functions instead of U-Boot internal functions. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d6566113 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose eficonfig_create_device_path() Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use eficonfig_create_device_path() to construct the full device path from device path of the volume and file path, so move it out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d571f9b2 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation All the eficonfig menus other than "Change Boot Order" use 'eficonfig_entry' structure for each menu entry. This commit refactors change boot order implementation to use 'eficonfig_entry' structure same as other menus to have consistent menu handling. This commit also simplifies the data->active handling when KEY_SPACE is pressed, and sizeof() parameter. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
8961e93e |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose append entry function Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use append_entry() and append_quit_entry() to construct the menu, so move them out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
a84040ab |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor file selection handling eficonfig_select_file_handler() is commonly used to select the file. eficonfig_display_select_file_option() adds an additional menu to clear the selected file. eficonfig_display_select_file_option() is not always necessary for the file selection process, so it must be outside of eficonfig_select_file_handler(). This commit also renames the following functions to avoid confusion. eficonfig_select_file_handler() -> eficonfig_process_select_file() eficonfig_select_file() -> eficonfig_show_file_selection() eficonfig_display_select_file_option() -> eficonfig_process_show_file_option() Finally, test_eficonfig.py need to be updated to get aligned with the above modification. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
1167e88a |
|
14-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix missing variable initialization The 'ret' variable must be initialized before use in eficonfig_delete_invalid_boot_option(). Fixes: c416f1c0bc ("bootmenu: add removable media entries") Addresses-Coverity: 376207 ("Uninitialized variables") Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
3d595ac5 |
|
09-Nov-2022 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: remove superfluous if in eficonfig_edit_boot_option Goto for an immediately succeeding label is superfluous. Fixes: 87d791423ac6 ("eficonfig: menu-driven addition of UEFI boot option") Addresses-Coverity: 376202 ("Identical code for different branches") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
9945bc4f |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Fix incorrect return code of boot option update Correct the return code for out-of-memory and no boot option found Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
339b527b |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Move bootorder and bootoption apis to lib Rename and move bootorder and bootoption apis from cmd to lib for re-use between eficonfig and bootmgr Fix 'unexpected indentation' when 'make htmldocs' after functions are moved Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
2c0b0c31 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_SECURE_BOOT This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_SECURE_BOOT defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
83f3d121 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_MM_COMM_TEE This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_MM_COMM_TEE defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
88df3634 |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: CTRL+S to save the boot order 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>
|
#
45f5319f |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
menu: remove CTRL+C to quit On the sandbox called without "--terminal raw" CTRL+C leaves U-Boot, "ESC/CTRL+C to quit" is misleading. Let's remove CTRL+C to quit key handling from bootmenu and eficonfig menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
|
#
8dbd0a0f |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add vertical scroll support The current eficonfig menu does not support vertical scroll, so it can not display the menu entries greater than the console row size. This commit add the vertial scroll support. The console size is retrieved by SIMPLE_TEXT_OUTPUT_PROTOCOL.QueryMode() service, then calculates the row size for menu entry by subtracting menu header and description row size from the console row size. "start" and "end" are added in the efimenu structure. "start" keeps the menu entry index at the top, "end" keeps the bottom menu entry index. item_data_print() menu function only draws the menu entry between "start" and "end". This commit also fixes the issue that "Save" and "Quit" entries can be moved by BKEY_PLUS in change boot order menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
0d590852 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation This commit removes the change boot order specific menu implementation. The change boot order implementation calls eficonfig_process_common() same as other menus. The change boot order menu requires own item_data_print and item_choice implementation, but display_statusline function can be a same function as other menus. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
cd160b27 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor eficonfig_process_common function Current change boot order implementation does not call eficonfig_process_common() and call own menu functions for display_statusline, item_data_print and item_choice. Change boot order functionality should call eficonfig_process_common() to improve maintenanceability. This commit is a preparation to remove the change boot order specific implementation. The menu functions (display_statusline, item_data_print and item_choice) are added as argument of eficonfig_process_common(). The menu description string displayed at the bottom of the menu is also added as argument. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
32bab0ea |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Make use of CLI character processing Avoid duplicating some of the escape-sequence processing here and use the CLI function instead. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
d0ca98db |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Update bootmenu_loop() to return the code Use the return value to save having to pass around a pointer. This also resolves any ambiguity about what *key contains when the function is called. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
2da4a15e |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Rename KEY_... to BKEY_... This enum values conflict with linux/input.h so rename them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
64550274 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: avoid SetVariable between GetNextVariableName calls The current code calls efi_set_variable_int() to delete the invalid boot option between calls to efi_get_next_variable_name_int(), it may produce unpredictable results. This commit moves removal of the invalid boot option outside of the efi_get_next_variable_name_int() calls. EFI_NOT_FOUND returned from efi_get_next_variable_name_int() indicates we retrieved all EFI variables, it should be treated as EFI_SUCEESS. To address the checkpatch warning of too many leading tabs, combine two if statement into one. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
ce327084 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: carve out efi_get_next_variable_name_int calls To retrieve the EFI variable name by efi_get_next_variable_name_int(), the sequence of alloc -> efi_get_next_variable_name_int -> realloc -> efi_get_next_variable_name_int is required. In current code, this sequence repeatedly appears in the several functions. It should be curved out a common function. This commit also fixes the missing free() of var_name16 in eficonfig_delete_invalid_boot_option(). Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
140a8959 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use efi_get_next_variable_name_int() eficonfig command reads all possible UEFI load options from 0x0000 to 0xFFFF to construct the menu. This takes too much time in some environment. This commit uses efi_get_next_variable_name_int() to read all existing UEFI load options to significantlly reduce the count of efi_get_var() call. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
78b1ccc4 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use u16_strsize() to get u16 string buffer size Use u16_strsize() to simplify the u16 string buffer size calculation. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c67d3c9e |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix going one directory up issue The directory name in eficonfig menu entry contains the '\' separator. strcmp() argument ".." is wrong and one directory up handling does not work correctly. strcmp() argument must include '\' separator. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c3b5af63 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add UEFI Secure Boot Key enrollment interface This commit adds the menu-driven UEFI Secure Boot Key enrollment interface. User can enroll PK, KEK, db and dbx by selecting file. Only the signed EFI Signature List(s) with an authenticated header, typically '.auth' file, is accepted. To clear the PK, KEK, db and dbx, user needs to enroll the null key signed by PK or KEK. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
21faf4ef |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use protocol interface for file selection EFI_SIMPLE_FILE_SYSTEM_PROTOCOL is not always provided by U-Boot. Use protocol interface functions instead of U-Boot internal functions. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d6566113 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose eficonfig_create_device_path() Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use eficonfig_create_device_path() to construct the full device path from device path of the volume and file path, so move it out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d571f9b2 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation All the eficonfig menus other than "Change Boot Order" use 'eficonfig_entry' structure for each menu entry. This commit refactors change boot order implementation to use 'eficonfig_entry' structure same as other menus to have consistent menu handling. This commit also simplifies the data->active handling when KEY_SPACE is pressed, and sizeof() parameter. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
8961e93e |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose append entry function Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use append_entry() and append_quit_entry() to construct the menu, so move them out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
a84040ab |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor file selection handling eficonfig_select_file_handler() is commonly used to select the file. eficonfig_display_select_file_option() adds an additional menu to clear the selected file. eficonfig_display_select_file_option() is not always necessary for the file selection process, so it must be outside of eficonfig_select_file_handler(). This commit also renames the following functions to avoid confusion. eficonfig_select_file_handler() -> eficonfig_process_select_file() eficonfig_select_file() -> eficonfig_show_file_selection() eficonfig_display_select_file_option() -> eficonfig_process_show_file_option() Finally, test_eficonfig.py need to be updated to get aligned with the above modification. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
1167e88a |
|
14-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix missing variable initialization The 'ret' variable must be initialized before use in eficonfig_delete_invalid_boot_option(). Fixes: c416f1c0bc ("bootmenu: add removable media entries") Addresses-Coverity: 376207 ("Uninitialized variables") Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
3d595ac5 |
|
09-Nov-2022 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: remove superfluous if in eficonfig_edit_boot_option Goto for an immediately succeeding label is superfluous. Fixes: 87d791423ac6 ("eficonfig: menu-driven addition of UEFI boot option") Addresses-Coverity: 376202 ("Identical code for different branches") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
9945bc4f |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Fix incorrect return code of boot option update Correct the return code for out-of-memory and no boot option found Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
339b527b |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Move bootorder and bootoption apis to lib Rename and move bootorder and bootoption apis from cmd to lib for re-use between eficonfig and bootmgr Fix 'unexpected indentation' when 'make htmldocs' after functions are moved Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
2c0b0c31 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_SECURE_BOOT This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_SECURE_BOOT defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
83f3d121 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_MM_COMM_TEE This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_MM_COMM_TEE defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
88df3634 |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: CTRL+S to save the boot order 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>
|
#
45f5319f |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
menu: remove CTRL+C to quit On the sandbox called without "--terminal raw" CTRL+C leaves U-Boot, "ESC/CTRL+C to quit" is misleading. Let's remove CTRL+C to quit key handling from bootmenu and eficonfig menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
|
#
8dbd0a0f |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add vertical scroll support The current eficonfig menu does not support vertical scroll, so it can not display the menu entries greater than the console row size. This commit add the vertial scroll support. The console size is retrieved by SIMPLE_TEXT_OUTPUT_PROTOCOL.QueryMode() service, then calculates the row size for menu entry by subtracting menu header and description row size from the console row size. "start" and "end" are added in the efimenu structure. "start" keeps the menu entry index at the top, "end" keeps the bottom menu entry index. item_data_print() menu function only draws the menu entry between "start" and "end". This commit also fixes the issue that "Save" and "Quit" entries can be moved by BKEY_PLUS in change boot order menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
0d590852 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation This commit removes the change boot order specific menu implementation. The change boot order implementation calls eficonfig_process_common() same as other menus. The change boot order menu requires own item_data_print and item_choice implementation, but display_statusline function can be a same function as other menus. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
cd160b27 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor eficonfig_process_common function Current change boot order implementation does not call eficonfig_process_common() and call own menu functions for display_statusline, item_data_print and item_choice. Change boot order functionality should call eficonfig_process_common() to improve maintenanceability. This commit is a preparation to remove the change boot order specific implementation. The menu functions (display_statusline, item_data_print and item_choice) are added as argument of eficonfig_process_common(). The menu description string displayed at the bottom of the menu is also added as argument. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
32bab0ea |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Make use of CLI character processing Avoid duplicating some of the escape-sequence processing here and use the CLI function instead. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
d0ca98db |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Update bootmenu_loop() to return the code Use the return value to save having to pass around a pointer. This also resolves any ambiguity about what *key contains when the function is called. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
2da4a15e |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Rename KEY_... to BKEY_... This enum values conflict with linux/input.h so rename them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
64550274 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: avoid SetVariable between GetNextVariableName calls The current code calls efi_set_variable_int() to delete the invalid boot option between calls to efi_get_next_variable_name_int(), it may produce unpredictable results. This commit moves removal of the invalid boot option outside of the efi_get_next_variable_name_int() calls. EFI_NOT_FOUND returned from efi_get_next_variable_name_int() indicates we retrieved all EFI variables, it should be treated as EFI_SUCEESS. To address the checkpatch warning of too many leading tabs, combine two if statement into one. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
ce327084 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: carve out efi_get_next_variable_name_int calls To retrieve the EFI variable name by efi_get_next_variable_name_int(), the sequence of alloc -> efi_get_next_variable_name_int -> realloc -> efi_get_next_variable_name_int is required. In current code, this sequence repeatedly appears in the several functions. It should be curved out a common function. This commit also fixes the missing free() of var_name16 in eficonfig_delete_invalid_boot_option(). Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
140a8959 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use efi_get_next_variable_name_int() eficonfig command reads all possible UEFI load options from 0x0000 to 0xFFFF to construct the menu. This takes too much time in some environment. This commit uses efi_get_next_variable_name_int() to read all existing UEFI load options to significantlly reduce the count of efi_get_var() call. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
78b1ccc4 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use u16_strsize() to get u16 string buffer size Use u16_strsize() to simplify the u16 string buffer size calculation. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c67d3c9e |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix going one directory up issue The directory name in eficonfig menu entry contains the '\' separator. strcmp() argument ".." is wrong and one directory up handling does not work correctly. strcmp() argument must include '\' separator. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c3b5af63 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add UEFI Secure Boot Key enrollment interface This commit adds the menu-driven UEFI Secure Boot Key enrollment interface. User can enroll PK, KEK, db and dbx by selecting file. Only the signed EFI Signature List(s) with an authenticated header, typically '.auth' file, is accepted. To clear the PK, KEK, db and dbx, user needs to enroll the null key signed by PK or KEK. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
21faf4ef |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use protocol interface for file selection EFI_SIMPLE_FILE_SYSTEM_PROTOCOL is not always provided by U-Boot. Use protocol interface functions instead of U-Boot internal functions. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d6566113 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose eficonfig_create_device_path() Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use eficonfig_create_device_path() to construct the full device path from device path of the volume and file path, so move it out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d571f9b2 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation All the eficonfig menus other than "Change Boot Order" use 'eficonfig_entry' structure for each menu entry. This commit refactors change boot order implementation to use 'eficonfig_entry' structure same as other menus to have consistent menu handling. This commit also simplifies the data->active handling when KEY_SPACE is pressed, and sizeof() parameter. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
8961e93e |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose append entry function Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use append_entry() and append_quit_entry() to construct the menu, so move them out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
a84040ab |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor file selection handling eficonfig_select_file_handler() is commonly used to select the file. eficonfig_display_select_file_option() adds an additional menu to clear the selected file. eficonfig_display_select_file_option() is not always necessary for the file selection process, so it must be outside of eficonfig_select_file_handler(). This commit also renames the following functions to avoid confusion. eficonfig_select_file_handler() -> eficonfig_process_select_file() eficonfig_select_file() -> eficonfig_show_file_selection() eficonfig_display_select_file_option() -> eficonfig_process_show_file_option() Finally, test_eficonfig.py need to be updated to get aligned with the above modification. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
1167e88a |
|
14-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix missing variable initialization The 'ret' variable must be initialized before use in eficonfig_delete_invalid_boot_option(). Fixes: c416f1c0bc ("bootmenu: add removable media entries") Addresses-Coverity: 376207 ("Uninitialized variables") Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
3d595ac5 |
|
09-Nov-2022 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: remove superfluous if in eficonfig_edit_boot_option Goto for an immediately succeeding label is superfluous. Fixes: 87d791423ac6 ("eficonfig: menu-driven addition of UEFI boot option") Addresses-Coverity: 376202 ("Identical code for different branches") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
9945bc4f |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Fix incorrect return code of boot option update Correct the return code for out-of-memory and no boot option found Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
339b527b |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Move bootorder and bootoption apis to lib Rename and move bootorder and bootoption apis from cmd to lib for re-use between eficonfig and bootmgr Fix 'unexpected indentation' when 'make htmldocs' after functions are moved Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
2c0b0c31 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_SECURE_BOOT This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_SECURE_BOOT defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
83f3d121 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_MM_COMM_TEE This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_MM_COMM_TEE defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
88df3634 |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: CTRL+S to save the boot order 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>
|
#
45f5319f |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
menu: remove CTRL+C to quit On the sandbox called without "--terminal raw" CTRL+C leaves U-Boot, "ESC/CTRL+C to quit" is misleading. Let's remove CTRL+C to quit key handling from bootmenu and eficonfig menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
|
#
8dbd0a0f |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add vertical scroll support The current eficonfig menu does not support vertical scroll, so it can not display the menu entries greater than the console row size. This commit add the vertial scroll support. The console size is retrieved by SIMPLE_TEXT_OUTPUT_PROTOCOL.QueryMode() service, then calculates the row size for menu entry by subtracting menu header and description row size from the console row size. "start" and "end" are added in the efimenu structure. "start" keeps the menu entry index at the top, "end" keeps the bottom menu entry index. item_data_print() menu function only draws the menu entry between "start" and "end". This commit also fixes the issue that "Save" and "Quit" entries can be moved by BKEY_PLUS in change boot order menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
0d590852 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation This commit removes the change boot order specific menu implementation. The change boot order implementation calls eficonfig_process_common() same as other menus. The change boot order menu requires own item_data_print and item_choice implementation, but display_statusline function can be a same function as other menus. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
cd160b27 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor eficonfig_process_common function Current change boot order implementation does not call eficonfig_process_common() and call own menu functions for display_statusline, item_data_print and item_choice. Change boot order functionality should call eficonfig_process_common() to improve maintenanceability. This commit is a preparation to remove the change boot order specific implementation. The menu functions (display_statusline, item_data_print and item_choice) are added as argument of eficonfig_process_common(). The menu description string displayed at the bottom of the menu is also added as argument. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
32bab0ea |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Make use of CLI character processing Avoid duplicating some of the escape-sequence processing here and use the CLI function instead. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
d0ca98db |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Update bootmenu_loop() to return the code Use the return value to save having to pass around a pointer. This also resolves any ambiguity about what *key contains when the function is called. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
2da4a15e |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Rename KEY_... to BKEY_... This enum values conflict with linux/input.h so rename them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
64550274 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: avoid SetVariable between GetNextVariableName calls The current code calls efi_set_variable_int() to delete the invalid boot option between calls to efi_get_next_variable_name_int(), it may produce unpredictable results. This commit moves removal of the invalid boot option outside of the efi_get_next_variable_name_int() calls. EFI_NOT_FOUND returned from efi_get_next_variable_name_int() indicates we retrieved all EFI variables, it should be treated as EFI_SUCEESS. To address the checkpatch warning of too many leading tabs, combine two if statement into one. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
ce327084 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: carve out efi_get_next_variable_name_int calls To retrieve the EFI variable name by efi_get_next_variable_name_int(), the sequence of alloc -> efi_get_next_variable_name_int -> realloc -> efi_get_next_variable_name_int is required. In current code, this sequence repeatedly appears in the several functions. It should be curved out a common function. This commit also fixes the missing free() of var_name16 in eficonfig_delete_invalid_boot_option(). Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
140a8959 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use efi_get_next_variable_name_int() eficonfig command reads all possible UEFI load options from 0x0000 to 0xFFFF to construct the menu. This takes too much time in some environment. This commit uses efi_get_next_variable_name_int() to read all existing UEFI load options to significantlly reduce the count of efi_get_var() call. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
78b1ccc4 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use u16_strsize() to get u16 string buffer size Use u16_strsize() to simplify the u16 string buffer size calculation. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c67d3c9e |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix going one directory up issue The directory name in eficonfig menu entry contains the '\' separator. strcmp() argument ".." is wrong and one directory up handling does not work correctly. strcmp() argument must include '\' separator. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c3b5af63 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add UEFI Secure Boot Key enrollment interface This commit adds the menu-driven UEFI Secure Boot Key enrollment interface. User can enroll PK, KEK, db and dbx by selecting file. Only the signed EFI Signature List(s) with an authenticated header, typically '.auth' file, is accepted. To clear the PK, KEK, db and dbx, user needs to enroll the null key signed by PK or KEK. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
21faf4ef |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use protocol interface for file selection EFI_SIMPLE_FILE_SYSTEM_PROTOCOL is not always provided by U-Boot. Use protocol interface functions instead of U-Boot internal functions. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d6566113 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose eficonfig_create_device_path() Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use eficonfig_create_device_path() to construct the full device path from device path of the volume and file path, so move it out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d571f9b2 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation All the eficonfig menus other than "Change Boot Order" use 'eficonfig_entry' structure for each menu entry. This commit refactors change boot order implementation to use 'eficonfig_entry' structure same as other menus to have consistent menu handling. This commit also simplifies the data->active handling when KEY_SPACE is pressed, and sizeof() parameter. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
8961e93e |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose append entry function Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use append_entry() and append_quit_entry() to construct the menu, so move them out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
a84040ab |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor file selection handling eficonfig_select_file_handler() is commonly used to select the file. eficonfig_display_select_file_option() adds an additional menu to clear the selected file. eficonfig_display_select_file_option() is not always necessary for the file selection process, so it must be outside of eficonfig_select_file_handler(). This commit also renames the following functions to avoid confusion. eficonfig_select_file_handler() -> eficonfig_process_select_file() eficonfig_select_file() -> eficonfig_show_file_selection() eficonfig_display_select_file_option() -> eficonfig_process_show_file_option() Finally, test_eficonfig.py need to be updated to get aligned with the above modification. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
1167e88a |
|
14-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix missing variable initialization The 'ret' variable must be initialized before use in eficonfig_delete_invalid_boot_option(). Fixes: c416f1c0bc ("bootmenu: add removable media entries") Addresses-Coverity: 376207 ("Uninitialized variables") Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
3d595ac5 |
|
09-Nov-2022 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: remove superfluous if in eficonfig_edit_boot_option Goto for an immediately succeeding label is superfluous. Fixes: 87d791423ac6 ("eficonfig: menu-driven addition of UEFI boot option") Addresses-Coverity: 376202 ("Identical code for different branches") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
9945bc4f |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Fix incorrect return code of boot option update Correct the return code for out-of-memory and no boot option found Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
339b527b |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Move bootorder and bootoption apis to lib Rename and move bootorder and bootoption apis from cmd to lib for re-use between eficonfig and bootmgr Fix 'unexpected indentation' when 'make htmldocs' after functions are moved Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
2c0b0c31 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_SECURE_BOOT This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_SECURE_BOOT defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
83f3d121 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_MM_COMM_TEE This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_MM_COMM_TEE defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
88df3634 |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: CTRL+S to save the boot order 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>
|
#
45f5319f |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
menu: remove CTRL+C to quit On the sandbox called without "--terminal raw" CTRL+C leaves U-Boot, "ESC/CTRL+C to quit" is misleading. Let's remove CTRL+C to quit key handling from bootmenu and eficonfig menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
|
#
8dbd0a0f |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add vertical scroll support The current eficonfig menu does not support vertical scroll, so it can not display the menu entries greater than the console row size. This commit add the vertial scroll support. The console size is retrieved by SIMPLE_TEXT_OUTPUT_PROTOCOL.QueryMode() service, then calculates the row size for menu entry by subtracting menu header and description row size from the console row size. "start" and "end" are added in the efimenu structure. "start" keeps the menu entry index at the top, "end" keeps the bottom menu entry index. item_data_print() menu function only draws the menu entry between "start" and "end". This commit also fixes the issue that "Save" and "Quit" entries can be moved by BKEY_PLUS in change boot order menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
0d590852 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation This commit removes the change boot order specific menu implementation. The change boot order implementation calls eficonfig_process_common() same as other menus. The change boot order menu requires own item_data_print and item_choice implementation, but display_statusline function can be a same function as other menus. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
cd160b27 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor eficonfig_process_common function Current change boot order implementation does not call eficonfig_process_common() and call own menu functions for display_statusline, item_data_print and item_choice. Change boot order functionality should call eficonfig_process_common() to improve maintenanceability. This commit is a preparation to remove the change boot order specific implementation. The menu functions (display_statusline, item_data_print and item_choice) are added as argument of eficonfig_process_common(). The menu description string displayed at the bottom of the menu is also added as argument. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
32bab0ea |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Make use of CLI character processing Avoid duplicating some of the escape-sequence processing here and use the CLI function instead. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
d0ca98db |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Update bootmenu_loop() to return the code Use the return value to save having to pass around a pointer. This also resolves any ambiguity about what *key contains when the function is called. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
2da4a15e |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Rename KEY_... to BKEY_... This enum values conflict with linux/input.h so rename them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
64550274 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: avoid SetVariable between GetNextVariableName calls The current code calls efi_set_variable_int() to delete the invalid boot option between calls to efi_get_next_variable_name_int(), it may produce unpredictable results. This commit moves removal of the invalid boot option outside of the efi_get_next_variable_name_int() calls. EFI_NOT_FOUND returned from efi_get_next_variable_name_int() indicates we retrieved all EFI variables, it should be treated as EFI_SUCEESS. To address the checkpatch warning of too many leading tabs, combine two if statement into one. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
ce327084 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: carve out efi_get_next_variable_name_int calls To retrieve the EFI variable name by efi_get_next_variable_name_int(), the sequence of alloc -> efi_get_next_variable_name_int -> realloc -> efi_get_next_variable_name_int is required. In current code, this sequence repeatedly appears in the several functions. It should be curved out a common function. This commit also fixes the missing free() of var_name16 in eficonfig_delete_invalid_boot_option(). Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
140a8959 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use efi_get_next_variable_name_int() eficonfig command reads all possible UEFI load options from 0x0000 to 0xFFFF to construct the menu. This takes too much time in some environment. This commit uses efi_get_next_variable_name_int() to read all existing UEFI load options to significantlly reduce the count of efi_get_var() call. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
78b1ccc4 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use u16_strsize() to get u16 string buffer size Use u16_strsize() to simplify the u16 string buffer size calculation. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c67d3c9e |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix going one directory up issue The directory name in eficonfig menu entry contains the '\' separator. strcmp() argument ".." is wrong and one directory up handling does not work correctly. strcmp() argument must include '\' separator. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c3b5af63 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add UEFI Secure Boot Key enrollment interface This commit adds the menu-driven UEFI Secure Boot Key enrollment interface. User can enroll PK, KEK, db and dbx by selecting file. Only the signed EFI Signature List(s) with an authenticated header, typically '.auth' file, is accepted. To clear the PK, KEK, db and dbx, user needs to enroll the null key signed by PK or KEK. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
21faf4ef |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use protocol interface for file selection EFI_SIMPLE_FILE_SYSTEM_PROTOCOL is not always provided by U-Boot. Use protocol interface functions instead of U-Boot internal functions. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d6566113 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose eficonfig_create_device_path() Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use eficonfig_create_device_path() to construct the full device path from device path of the volume and file path, so move it out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d571f9b2 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation All the eficonfig menus other than "Change Boot Order" use 'eficonfig_entry' structure for each menu entry. This commit refactors change boot order implementation to use 'eficonfig_entry' structure same as other menus to have consistent menu handling. This commit also simplifies the data->active handling when KEY_SPACE is pressed, and sizeof() parameter. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
8961e93e |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose append entry function Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use append_entry() and append_quit_entry() to construct the menu, so move them out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
a84040ab |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor file selection handling eficonfig_select_file_handler() is commonly used to select the file. eficonfig_display_select_file_option() adds an additional menu to clear the selected file. eficonfig_display_select_file_option() is not always necessary for the file selection process, so it must be outside of eficonfig_select_file_handler(). This commit also renames the following functions to avoid confusion. eficonfig_select_file_handler() -> eficonfig_process_select_file() eficonfig_select_file() -> eficonfig_show_file_selection() eficonfig_display_select_file_option() -> eficonfig_process_show_file_option() Finally, test_eficonfig.py need to be updated to get aligned with the above modification. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
1167e88a |
|
14-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix missing variable initialization The 'ret' variable must be initialized before use in eficonfig_delete_invalid_boot_option(). Fixes: c416f1c0bc ("bootmenu: add removable media entries") Addresses-Coverity: 376207 ("Uninitialized variables") Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
3d595ac5 |
|
09-Nov-2022 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: remove superfluous if in eficonfig_edit_boot_option Goto for an immediately succeeding label is superfluous. Fixes: 87d791423ac6 ("eficonfig: menu-driven addition of UEFI boot option") Addresses-Coverity: 376202 ("Identical code for different branches") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
9945bc4f |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Fix incorrect return code of boot option update Correct the return code for out-of-memory and no boot option found Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
339b527b |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Move bootorder and bootoption apis to lib Rename and move bootorder and bootoption apis from cmd to lib for re-use between eficonfig and bootmgr Fix 'unexpected indentation' when 'make htmldocs' after functions are moved Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
2c0b0c31 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_SECURE_BOOT This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_SECURE_BOOT defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
83f3d121 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_MM_COMM_TEE This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_MM_COMM_TEE defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
88df3634 |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: CTRL+S to save the boot order 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>
|
#
45f5319f |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
menu: remove CTRL+C to quit On the sandbox called without "--terminal raw" CTRL+C leaves U-Boot, "ESC/CTRL+C to quit" is misleading. Let's remove CTRL+C to quit key handling from bootmenu and eficonfig menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
|
#
8dbd0a0f |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add vertical scroll support The current eficonfig menu does not support vertical scroll, so it can not display the menu entries greater than the console row size. This commit add the vertial scroll support. The console size is retrieved by SIMPLE_TEXT_OUTPUT_PROTOCOL.QueryMode() service, then calculates the row size for menu entry by subtracting menu header and description row size from the console row size. "start" and "end" are added in the efimenu structure. "start" keeps the menu entry index at the top, "end" keeps the bottom menu entry index. item_data_print() menu function only draws the menu entry between "start" and "end". This commit also fixes the issue that "Save" and "Quit" entries can be moved by BKEY_PLUS in change boot order menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
0d590852 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation This commit removes the change boot order specific menu implementation. The change boot order implementation calls eficonfig_process_common() same as other menus. The change boot order menu requires own item_data_print and item_choice implementation, but display_statusline function can be a same function as other menus. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
cd160b27 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor eficonfig_process_common function Current change boot order implementation does not call eficonfig_process_common() and call own menu functions for display_statusline, item_data_print and item_choice. Change boot order functionality should call eficonfig_process_common() to improve maintenanceability. This commit is a preparation to remove the change boot order specific implementation. The menu functions (display_statusline, item_data_print and item_choice) are added as argument of eficonfig_process_common(). The menu description string displayed at the bottom of the menu is also added as argument. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
32bab0ea |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Make use of CLI character processing Avoid duplicating some of the escape-sequence processing here and use the CLI function instead. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
d0ca98db |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Update bootmenu_loop() to return the code Use the return value to save having to pass around a pointer. This also resolves any ambiguity about what *key contains when the function is called. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
2da4a15e |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Rename KEY_... to BKEY_... This enum values conflict with linux/input.h so rename them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
64550274 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: avoid SetVariable between GetNextVariableName calls The current code calls efi_set_variable_int() to delete the invalid boot option between calls to efi_get_next_variable_name_int(), it may produce unpredictable results. This commit moves removal of the invalid boot option outside of the efi_get_next_variable_name_int() calls. EFI_NOT_FOUND returned from efi_get_next_variable_name_int() indicates we retrieved all EFI variables, it should be treated as EFI_SUCEESS. To address the checkpatch warning of too many leading tabs, combine two if statement into one. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
ce327084 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: carve out efi_get_next_variable_name_int calls To retrieve the EFI variable name by efi_get_next_variable_name_int(), the sequence of alloc -> efi_get_next_variable_name_int -> realloc -> efi_get_next_variable_name_int is required. In current code, this sequence repeatedly appears in the several functions. It should be curved out a common function. This commit also fixes the missing free() of var_name16 in eficonfig_delete_invalid_boot_option(). Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
140a8959 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use efi_get_next_variable_name_int() eficonfig command reads all possible UEFI load options from 0x0000 to 0xFFFF to construct the menu. This takes too much time in some environment. This commit uses efi_get_next_variable_name_int() to read all existing UEFI load options to significantlly reduce the count of efi_get_var() call. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
78b1ccc4 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use u16_strsize() to get u16 string buffer size Use u16_strsize() to simplify the u16 string buffer size calculation. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c67d3c9e |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix going one directory up issue The directory name in eficonfig menu entry contains the '\' separator. strcmp() argument ".." is wrong and one directory up handling does not work correctly. strcmp() argument must include '\' separator. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c3b5af63 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add UEFI Secure Boot Key enrollment interface This commit adds the menu-driven UEFI Secure Boot Key enrollment interface. User can enroll PK, KEK, db and dbx by selecting file. Only the signed EFI Signature List(s) with an authenticated header, typically '.auth' file, is accepted. To clear the PK, KEK, db and dbx, user needs to enroll the null key signed by PK or KEK. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
21faf4ef |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use protocol interface for file selection EFI_SIMPLE_FILE_SYSTEM_PROTOCOL is not always provided by U-Boot. Use protocol interface functions instead of U-Boot internal functions. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d6566113 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose eficonfig_create_device_path() Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use eficonfig_create_device_path() to construct the full device path from device path of the volume and file path, so move it out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d571f9b2 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation All the eficonfig menus other than "Change Boot Order" use 'eficonfig_entry' structure for each menu entry. This commit refactors change boot order implementation to use 'eficonfig_entry' structure same as other menus to have consistent menu handling. This commit also simplifies the data->active handling when KEY_SPACE is pressed, and sizeof() parameter. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
8961e93e |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose append entry function Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use append_entry() and append_quit_entry() to construct the menu, so move them out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
a84040ab |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor file selection handling eficonfig_select_file_handler() is commonly used to select the file. eficonfig_display_select_file_option() adds an additional menu to clear the selected file. eficonfig_display_select_file_option() is not always necessary for the file selection process, so it must be outside of eficonfig_select_file_handler(). This commit also renames the following functions to avoid confusion. eficonfig_select_file_handler() -> eficonfig_process_select_file() eficonfig_select_file() -> eficonfig_show_file_selection() eficonfig_display_select_file_option() -> eficonfig_process_show_file_option() Finally, test_eficonfig.py need to be updated to get aligned with the above modification. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
1167e88a |
|
14-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix missing variable initialization The 'ret' variable must be initialized before use in eficonfig_delete_invalid_boot_option(). Fixes: c416f1c0bc ("bootmenu: add removable media entries") Addresses-Coverity: 376207 ("Uninitialized variables") Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
3d595ac5 |
|
09-Nov-2022 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: remove superfluous if in eficonfig_edit_boot_option Goto for an immediately succeeding label is superfluous. Fixes: 87d791423ac6 ("eficonfig: menu-driven addition of UEFI boot option") Addresses-Coverity: 376202 ("Identical code for different branches") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
9945bc4f |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Fix incorrect return code of boot option update Correct the return code for out-of-memory and no boot option found Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
339b527b |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Move bootorder and bootoption apis to lib Rename and move bootorder and bootoption apis from cmd to lib for re-use between eficonfig and bootmgr Fix 'unexpected indentation' when 'make htmldocs' after functions are moved Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
2c0b0c31 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_SECURE_BOOT This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_SECURE_BOOT defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
83f3d121 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_MM_COMM_TEE This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_MM_COMM_TEE defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
88df3634 |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: CTRL+S to save the boot order 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>
|
#
45f5319f |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
menu: remove CTRL+C to quit On the sandbox called without "--terminal raw" CTRL+C leaves U-Boot, "ESC/CTRL+C to quit" is misleading. Let's remove CTRL+C to quit key handling from bootmenu and eficonfig menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
|
#
8dbd0a0f |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add vertical scroll support The current eficonfig menu does not support vertical scroll, so it can not display the menu entries greater than the console row size. This commit add the vertial scroll support. The console size is retrieved by SIMPLE_TEXT_OUTPUT_PROTOCOL.QueryMode() service, then calculates the row size for menu entry by subtracting menu header and description row size from the console row size. "start" and "end" are added in the efimenu structure. "start" keeps the menu entry index at the top, "end" keeps the bottom menu entry index. item_data_print() menu function only draws the menu entry between "start" and "end". This commit also fixes the issue that "Save" and "Quit" entries can be moved by BKEY_PLUS in change boot order menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
0d590852 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation This commit removes the change boot order specific menu implementation. The change boot order implementation calls eficonfig_process_common() same as other menus. The change boot order menu requires own item_data_print and item_choice implementation, but display_statusline function can be a same function as other menus. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
cd160b27 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor eficonfig_process_common function Current change boot order implementation does not call eficonfig_process_common() and call own menu functions for display_statusline, item_data_print and item_choice. Change boot order functionality should call eficonfig_process_common() to improve maintenanceability. This commit is a preparation to remove the change boot order specific implementation. The menu functions (display_statusline, item_data_print and item_choice) are added as argument of eficonfig_process_common(). The menu description string displayed at the bottom of the menu is also added as argument. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
32bab0ea |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Make use of CLI character processing Avoid duplicating some of the escape-sequence processing here and use the CLI function instead. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
d0ca98db |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Update bootmenu_loop() to return the code Use the return value to save having to pass around a pointer. This also resolves any ambiguity about what *key contains when the function is called. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
2da4a15e |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Rename KEY_... to BKEY_... This enum values conflict with linux/input.h so rename them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
64550274 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: avoid SetVariable between GetNextVariableName calls The current code calls efi_set_variable_int() to delete the invalid boot option between calls to efi_get_next_variable_name_int(), it may produce unpredictable results. This commit moves removal of the invalid boot option outside of the efi_get_next_variable_name_int() calls. EFI_NOT_FOUND returned from efi_get_next_variable_name_int() indicates we retrieved all EFI variables, it should be treated as EFI_SUCEESS. To address the checkpatch warning of too many leading tabs, combine two if statement into one. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
ce327084 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: carve out efi_get_next_variable_name_int calls To retrieve the EFI variable name by efi_get_next_variable_name_int(), the sequence of alloc -> efi_get_next_variable_name_int -> realloc -> efi_get_next_variable_name_int is required. In current code, this sequence repeatedly appears in the several functions. It should be curved out a common function. This commit also fixes the missing free() of var_name16 in eficonfig_delete_invalid_boot_option(). Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
140a8959 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use efi_get_next_variable_name_int() eficonfig command reads all possible UEFI load options from 0x0000 to 0xFFFF to construct the menu. This takes too much time in some environment. This commit uses efi_get_next_variable_name_int() to read all existing UEFI load options to significantlly reduce the count of efi_get_var() call. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
78b1ccc4 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use u16_strsize() to get u16 string buffer size Use u16_strsize() to simplify the u16 string buffer size calculation. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c67d3c9e |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix going one directory up issue The directory name in eficonfig menu entry contains the '\' separator. strcmp() argument ".." is wrong and one directory up handling does not work correctly. strcmp() argument must include '\' separator. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c3b5af63 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add UEFI Secure Boot Key enrollment interface This commit adds the menu-driven UEFI Secure Boot Key enrollment interface. User can enroll PK, KEK, db and dbx by selecting file. Only the signed EFI Signature List(s) with an authenticated header, typically '.auth' file, is accepted. To clear the PK, KEK, db and dbx, user needs to enroll the null key signed by PK or KEK. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
21faf4ef |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use protocol interface for file selection EFI_SIMPLE_FILE_SYSTEM_PROTOCOL is not always provided by U-Boot. Use protocol interface functions instead of U-Boot internal functions. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d6566113 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose eficonfig_create_device_path() Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use eficonfig_create_device_path() to construct the full device path from device path of the volume and file path, so move it out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d571f9b2 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation All the eficonfig menus other than "Change Boot Order" use 'eficonfig_entry' structure for each menu entry. This commit refactors change boot order implementation to use 'eficonfig_entry' structure same as other menus to have consistent menu handling. This commit also simplifies the data->active handling when KEY_SPACE is pressed, and sizeof() parameter. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
8961e93e |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose append entry function Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use append_entry() and append_quit_entry() to construct the menu, so move them out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
a84040ab |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor file selection handling eficonfig_select_file_handler() is commonly used to select the file. eficonfig_display_select_file_option() adds an additional menu to clear the selected file. eficonfig_display_select_file_option() is not always necessary for the file selection process, so it must be outside of eficonfig_select_file_handler(). This commit also renames the following functions to avoid confusion. eficonfig_select_file_handler() -> eficonfig_process_select_file() eficonfig_select_file() -> eficonfig_show_file_selection() eficonfig_display_select_file_option() -> eficonfig_process_show_file_option() Finally, test_eficonfig.py need to be updated to get aligned with the above modification. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
1167e88a |
|
14-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix missing variable initialization The 'ret' variable must be initialized before use in eficonfig_delete_invalid_boot_option(). Fixes: c416f1c0bc ("bootmenu: add removable media entries") Addresses-Coverity: 376207 ("Uninitialized variables") Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
3d595ac5 |
|
09-Nov-2022 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: remove superfluous if in eficonfig_edit_boot_option Goto for an immediately succeeding label is superfluous. Fixes: 87d791423ac6 ("eficonfig: menu-driven addition of UEFI boot option") Addresses-Coverity: 376202 ("Identical code for different branches") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
9945bc4f |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Fix incorrect return code of boot option update Correct the return code for out-of-memory and no boot option found Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
339b527b |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Move bootorder and bootoption apis to lib Rename and move bootorder and bootoption apis from cmd to lib for re-use between eficonfig and bootmgr Fix 'unexpected indentation' when 'make htmldocs' after functions are moved Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
2c0b0c31 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_SECURE_BOOT This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_SECURE_BOOT defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
83f3d121 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_MM_COMM_TEE This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_MM_COMM_TEE defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
88df3634 |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: CTRL+S to save the boot order 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>
|
#
45f5319f |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
menu: remove CTRL+C to quit On the sandbox called without "--terminal raw" CTRL+C leaves U-Boot, "ESC/CTRL+C to quit" is misleading. Let's remove CTRL+C to quit key handling from bootmenu and eficonfig menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
|
#
8dbd0a0f |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add vertical scroll support The current eficonfig menu does not support vertical scroll, so it can not display the menu entries greater than the console row size. This commit add the vertial scroll support. The console size is retrieved by SIMPLE_TEXT_OUTPUT_PROTOCOL.QueryMode() service, then calculates the row size for menu entry by subtracting menu header and description row size from the console row size. "start" and "end" are added in the efimenu structure. "start" keeps the menu entry index at the top, "end" keeps the bottom menu entry index. item_data_print() menu function only draws the menu entry between "start" and "end". This commit also fixes the issue that "Save" and "Quit" entries can be moved by BKEY_PLUS in change boot order menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
0d590852 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation This commit removes the change boot order specific menu implementation. The change boot order implementation calls eficonfig_process_common() same as other menus. The change boot order menu requires own item_data_print and item_choice implementation, but display_statusline function can be a same function as other menus. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
cd160b27 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor eficonfig_process_common function Current change boot order implementation does not call eficonfig_process_common() and call own menu functions for display_statusline, item_data_print and item_choice. Change boot order functionality should call eficonfig_process_common() to improve maintenanceability. This commit is a preparation to remove the change boot order specific implementation. The menu functions (display_statusline, item_data_print and item_choice) are added as argument of eficonfig_process_common(). The menu description string displayed at the bottom of the menu is also added as argument. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
32bab0ea |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Make use of CLI character processing Avoid duplicating some of the escape-sequence processing here and use the CLI function instead. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
d0ca98db |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Update bootmenu_loop() to return the code Use the return value to save having to pass around a pointer. This also resolves any ambiguity about what *key contains when the function is called. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
2da4a15e |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Rename KEY_... to BKEY_... This enum values conflict with linux/input.h so rename them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
64550274 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: avoid SetVariable between GetNextVariableName calls The current code calls efi_set_variable_int() to delete the invalid boot option between calls to efi_get_next_variable_name_int(), it may produce unpredictable results. This commit moves removal of the invalid boot option outside of the efi_get_next_variable_name_int() calls. EFI_NOT_FOUND returned from efi_get_next_variable_name_int() indicates we retrieved all EFI variables, it should be treated as EFI_SUCEESS. To address the checkpatch warning of too many leading tabs, combine two if statement into one. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
ce327084 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: carve out efi_get_next_variable_name_int calls To retrieve the EFI variable name by efi_get_next_variable_name_int(), the sequence of alloc -> efi_get_next_variable_name_int -> realloc -> efi_get_next_variable_name_int is required. In current code, this sequence repeatedly appears in the several functions. It should be curved out a common function. This commit also fixes the missing free() of var_name16 in eficonfig_delete_invalid_boot_option(). Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
140a8959 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use efi_get_next_variable_name_int() eficonfig command reads all possible UEFI load options from 0x0000 to 0xFFFF to construct the menu. This takes too much time in some environment. This commit uses efi_get_next_variable_name_int() to read all existing UEFI load options to significantlly reduce the count of efi_get_var() call. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
78b1ccc4 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use u16_strsize() to get u16 string buffer size Use u16_strsize() to simplify the u16 string buffer size calculation. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c67d3c9e |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix going one directory up issue The directory name in eficonfig menu entry contains the '\' separator. strcmp() argument ".." is wrong and one directory up handling does not work correctly. strcmp() argument must include '\' separator. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c3b5af63 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add UEFI Secure Boot Key enrollment interface This commit adds the menu-driven UEFI Secure Boot Key enrollment interface. User can enroll PK, KEK, db and dbx by selecting file. Only the signed EFI Signature List(s) with an authenticated header, typically '.auth' file, is accepted. To clear the PK, KEK, db and dbx, user needs to enroll the null key signed by PK or KEK. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
21faf4ef |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use protocol interface for file selection EFI_SIMPLE_FILE_SYSTEM_PROTOCOL is not always provided by U-Boot. Use protocol interface functions instead of U-Boot internal functions. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d6566113 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose eficonfig_create_device_path() Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use eficonfig_create_device_path() to construct the full device path from device path of the volume and file path, so move it out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d571f9b2 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation All the eficonfig menus other than "Change Boot Order" use 'eficonfig_entry' structure for each menu entry. This commit refactors change boot order implementation to use 'eficonfig_entry' structure same as other menus to have consistent menu handling. This commit also simplifies the data->active handling when KEY_SPACE is pressed, and sizeof() parameter. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
8961e93e |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose append entry function Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use append_entry() and append_quit_entry() to construct the menu, so move them out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
a84040ab |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor file selection handling eficonfig_select_file_handler() is commonly used to select the file. eficonfig_display_select_file_option() adds an additional menu to clear the selected file. eficonfig_display_select_file_option() is not always necessary for the file selection process, so it must be outside of eficonfig_select_file_handler(). This commit also renames the following functions to avoid confusion. eficonfig_select_file_handler() -> eficonfig_process_select_file() eficonfig_select_file() -> eficonfig_show_file_selection() eficonfig_display_select_file_option() -> eficonfig_process_show_file_option() Finally, test_eficonfig.py need to be updated to get aligned with the above modification. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
1167e88a |
|
14-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix missing variable initialization The 'ret' variable must be initialized before use in eficonfig_delete_invalid_boot_option(). Fixes: c416f1c0bc ("bootmenu: add removable media entries") Addresses-Coverity: 376207 ("Uninitialized variables") Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
3d595ac5 |
|
09-Nov-2022 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: remove superfluous if in eficonfig_edit_boot_option Goto for an immediately succeeding label is superfluous. Fixes: 87d791423ac6 ("eficonfig: menu-driven addition of UEFI boot option") Addresses-Coverity: 376202 ("Identical code for different branches") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
9945bc4f |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Fix incorrect return code of boot option update Correct the return code for out-of-memory and no boot option found Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
339b527b |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Move bootorder and bootoption apis to lib Rename and move bootorder and bootoption apis from cmd to lib for re-use between eficonfig and bootmgr Fix 'unexpected indentation' when 'make htmldocs' after functions are moved Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
2c0b0c31 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_SECURE_BOOT This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_SECURE_BOOT defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
83f3d121 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_MM_COMM_TEE This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_MM_COMM_TEE defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
88df3634 |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: CTRL+S to save the boot order 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>
|
#
45f5319f |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
menu: remove CTRL+C to quit On the sandbox called without "--terminal raw" CTRL+C leaves U-Boot, "ESC/CTRL+C to quit" is misleading. Let's remove CTRL+C to quit key handling from bootmenu and eficonfig menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
|
#
8dbd0a0f |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add vertical scroll support The current eficonfig menu does not support vertical scroll, so it can not display the menu entries greater than the console row size. This commit add the vertial scroll support. The console size is retrieved by SIMPLE_TEXT_OUTPUT_PROTOCOL.QueryMode() service, then calculates the row size for menu entry by subtracting menu header and description row size from the console row size. "start" and "end" are added in the efimenu structure. "start" keeps the menu entry index at the top, "end" keeps the bottom menu entry index. item_data_print() menu function only draws the menu entry between "start" and "end". This commit also fixes the issue that "Save" and "Quit" entries can be moved by BKEY_PLUS in change boot order menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
0d590852 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation This commit removes the change boot order specific menu implementation. The change boot order implementation calls eficonfig_process_common() same as other menus. The change boot order menu requires own item_data_print and item_choice implementation, but display_statusline function can be a same function as other menus. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
cd160b27 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor eficonfig_process_common function Current change boot order implementation does not call eficonfig_process_common() and call own menu functions for display_statusline, item_data_print and item_choice. Change boot order functionality should call eficonfig_process_common() to improve maintenanceability. This commit is a preparation to remove the change boot order specific implementation. The menu functions (display_statusline, item_data_print and item_choice) are added as argument of eficonfig_process_common(). The menu description string displayed at the bottom of the menu is also added as argument. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
32bab0ea |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Make use of CLI character processing Avoid duplicating some of the escape-sequence processing here and use the CLI function instead. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
d0ca98db |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Update bootmenu_loop() to return the code Use the return value to save having to pass around a pointer. This also resolves any ambiguity about what *key contains when the function is called. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
2da4a15e |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Rename KEY_... to BKEY_... This enum values conflict with linux/input.h so rename them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
64550274 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: avoid SetVariable between GetNextVariableName calls The current code calls efi_set_variable_int() to delete the invalid boot option between calls to efi_get_next_variable_name_int(), it may produce unpredictable results. This commit moves removal of the invalid boot option outside of the efi_get_next_variable_name_int() calls. EFI_NOT_FOUND returned from efi_get_next_variable_name_int() indicates we retrieved all EFI variables, it should be treated as EFI_SUCEESS. To address the checkpatch warning of too many leading tabs, combine two if statement into one. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
ce327084 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: carve out efi_get_next_variable_name_int calls To retrieve the EFI variable name by efi_get_next_variable_name_int(), the sequence of alloc -> efi_get_next_variable_name_int -> realloc -> efi_get_next_variable_name_int is required. In current code, this sequence repeatedly appears in the several functions. It should be curved out a common function. This commit also fixes the missing free() of var_name16 in eficonfig_delete_invalid_boot_option(). Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
140a8959 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use efi_get_next_variable_name_int() eficonfig command reads all possible UEFI load options from 0x0000 to 0xFFFF to construct the menu. This takes too much time in some environment. This commit uses efi_get_next_variable_name_int() to read all existing UEFI load options to significantlly reduce the count of efi_get_var() call. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
78b1ccc4 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use u16_strsize() to get u16 string buffer size Use u16_strsize() to simplify the u16 string buffer size calculation. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c67d3c9e |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix going one directory up issue The directory name in eficonfig menu entry contains the '\' separator. strcmp() argument ".." is wrong and one directory up handling does not work correctly. strcmp() argument must include '\' separator. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c3b5af63 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add UEFI Secure Boot Key enrollment interface This commit adds the menu-driven UEFI Secure Boot Key enrollment interface. User can enroll PK, KEK, db and dbx by selecting file. Only the signed EFI Signature List(s) with an authenticated header, typically '.auth' file, is accepted. To clear the PK, KEK, db and dbx, user needs to enroll the null key signed by PK or KEK. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
21faf4ef |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use protocol interface for file selection EFI_SIMPLE_FILE_SYSTEM_PROTOCOL is not always provided by U-Boot. Use protocol interface functions instead of U-Boot internal functions. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d6566113 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose eficonfig_create_device_path() Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use eficonfig_create_device_path() to construct the full device path from device path of the volume and file path, so move it out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d571f9b2 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation All the eficonfig menus other than "Change Boot Order" use 'eficonfig_entry' structure for each menu entry. This commit refactors change boot order implementation to use 'eficonfig_entry' structure same as other menus to have consistent menu handling. This commit also simplifies the data->active handling when KEY_SPACE is pressed, and sizeof() parameter. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
8961e93e |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose append entry function Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use append_entry() and append_quit_entry() to construct the menu, so move them out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
a84040ab |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor file selection handling eficonfig_select_file_handler() is commonly used to select the file. eficonfig_display_select_file_option() adds an additional menu to clear the selected file. eficonfig_display_select_file_option() is not always necessary for the file selection process, so it must be outside of eficonfig_select_file_handler(). This commit also renames the following functions to avoid confusion. eficonfig_select_file_handler() -> eficonfig_process_select_file() eficonfig_select_file() -> eficonfig_show_file_selection() eficonfig_display_select_file_option() -> eficonfig_process_show_file_option() Finally, test_eficonfig.py need to be updated to get aligned with the above modification. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
1167e88a |
|
14-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix missing variable initialization The 'ret' variable must be initialized before use in eficonfig_delete_invalid_boot_option(). Fixes: c416f1c0bc ("bootmenu: add removable media entries") Addresses-Coverity: 376207 ("Uninitialized variables") Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
3d595ac5 |
|
09-Nov-2022 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: remove superfluous if in eficonfig_edit_boot_option Goto for an immediately succeeding label is superfluous. Fixes: 87d791423ac6 ("eficonfig: menu-driven addition of UEFI boot option") Addresses-Coverity: 376202 ("Identical code for different branches") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
9945bc4f |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Fix incorrect return code of boot option update Correct the return code for out-of-memory and no boot option found Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
339b527b |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Move bootorder and bootoption apis to lib Rename and move bootorder and bootoption apis from cmd to lib for re-use between eficonfig and bootmgr Fix 'unexpected indentation' when 'make htmldocs' after functions are moved Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
2c0b0c31 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_SECURE_BOOT This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_SECURE_BOOT defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
83f3d121 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_MM_COMM_TEE This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_MM_COMM_TEE defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
88df3634 |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: CTRL+S to save the boot order 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>
|
#
45f5319f |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
menu: remove CTRL+C to quit On the sandbox called without "--terminal raw" CTRL+C leaves U-Boot, "ESC/CTRL+C to quit" is misleading. Let's remove CTRL+C to quit key handling from bootmenu and eficonfig menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
|
#
8dbd0a0f |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add vertical scroll support The current eficonfig menu does not support vertical scroll, so it can not display the menu entries greater than the console row size. This commit add the vertial scroll support. The console size is retrieved by SIMPLE_TEXT_OUTPUT_PROTOCOL.QueryMode() service, then calculates the row size for menu entry by subtracting menu header and description row size from the console row size. "start" and "end" are added in the efimenu structure. "start" keeps the menu entry index at the top, "end" keeps the bottom menu entry index. item_data_print() menu function only draws the menu entry between "start" and "end". This commit also fixes the issue that "Save" and "Quit" entries can be moved by BKEY_PLUS in change boot order menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
0d590852 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation This commit removes the change boot order specific menu implementation. The change boot order implementation calls eficonfig_process_common() same as other menus. The change boot order menu requires own item_data_print and item_choice implementation, but display_statusline function can be a same function as other menus. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
cd160b27 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor eficonfig_process_common function Current change boot order implementation does not call eficonfig_process_common() and call own menu functions for display_statusline, item_data_print and item_choice. Change boot order functionality should call eficonfig_process_common() to improve maintenanceability. This commit is a preparation to remove the change boot order specific implementation. The menu functions (display_statusline, item_data_print and item_choice) are added as argument of eficonfig_process_common(). The menu description string displayed at the bottom of the menu is also added as argument. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
32bab0ea |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Make use of CLI character processing Avoid duplicating some of the escape-sequence processing here and use the CLI function instead. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
d0ca98db |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Update bootmenu_loop() to return the code Use the return value to save having to pass around a pointer. This also resolves any ambiguity about what *key contains when the function is called. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
2da4a15e |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Rename KEY_... to BKEY_... This enum values conflict with linux/input.h so rename them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
64550274 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: avoid SetVariable between GetNextVariableName calls The current code calls efi_set_variable_int() to delete the invalid boot option between calls to efi_get_next_variable_name_int(), it may produce unpredictable results. This commit moves removal of the invalid boot option outside of the efi_get_next_variable_name_int() calls. EFI_NOT_FOUND returned from efi_get_next_variable_name_int() indicates we retrieved all EFI variables, it should be treated as EFI_SUCEESS. To address the checkpatch warning of too many leading tabs, combine two if statement into one. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
ce327084 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: carve out efi_get_next_variable_name_int calls To retrieve the EFI variable name by efi_get_next_variable_name_int(), the sequence of alloc -> efi_get_next_variable_name_int -> realloc -> efi_get_next_variable_name_int is required. In current code, this sequence repeatedly appears in the several functions. It should be curved out a common function. This commit also fixes the missing free() of var_name16 in eficonfig_delete_invalid_boot_option(). Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
140a8959 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use efi_get_next_variable_name_int() eficonfig command reads all possible UEFI load options from 0x0000 to 0xFFFF to construct the menu. This takes too much time in some environment. This commit uses efi_get_next_variable_name_int() to read all existing UEFI load options to significantlly reduce the count of efi_get_var() call. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
78b1ccc4 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use u16_strsize() to get u16 string buffer size Use u16_strsize() to simplify the u16 string buffer size calculation. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c67d3c9e |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix going one directory up issue The directory name in eficonfig menu entry contains the '\' separator. strcmp() argument ".." is wrong and one directory up handling does not work correctly. strcmp() argument must include '\' separator. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c3b5af63 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add UEFI Secure Boot Key enrollment interface This commit adds the menu-driven UEFI Secure Boot Key enrollment interface. User can enroll PK, KEK, db and dbx by selecting file. Only the signed EFI Signature List(s) with an authenticated header, typically '.auth' file, is accepted. To clear the PK, KEK, db and dbx, user needs to enroll the null key signed by PK or KEK. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
21faf4ef |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use protocol interface for file selection EFI_SIMPLE_FILE_SYSTEM_PROTOCOL is not always provided by U-Boot. Use protocol interface functions instead of U-Boot internal functions. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d6566113 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose eficonfig_create_device_path() Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use eficonfig_create_device_path() to construct the full device path from device path of the volume and file path, so move it out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d571f9b2 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation All the eficonfig menus other than "Change Boot Order" use 'eficonfig_entry' structure for each menu entry. This commit refactors change boot order implementation to use 'eficonfig_entry' structure same as other menus to have consistent menu handling. This commit also simplifies the data->active handling when KEY_SPACE is pressed, and sizeof() parameter. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
8961e93e |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose append entry function Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use append_entry() and append_quit_entry() to construct the menu, so move them out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
a84040ab |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor file selection handling eficonfig_select_file_handler() is commonly used to select the file. eficonfig_display_select_file_option() adds an additional menu to clear the selected file. eficonfig_display_select_file_option() is not always necessary for the file selection process, so it must be outside of eficonfig_select_file_handler(). This commit also renames the following functions to avoid confusion. eficonfig_select_file_handler() -> eficonfig_process_select_file() eficonfig_select_file() -> eficonfig_show_file_selection() eficonfig_display_select_file_option() -> eficonfig_process_show_file_option() Finally, test_eficonfig.py need to be updated to get aligned with the above modification. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
1167e88a |
|
14-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix missing variable initialization The 'ret' variable must be initialized before use in eficonfig_delete_invalid_boot_option(). Fixes: c416f1c0bc ("bootmenu: add removable media entries") Addresses-Coverity: 376207 ("Uninitialized variables") Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
3d595ac5 |
|
09-Nov-2022 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: remove superfluous if in eficonfig_edit_boot_option Goto for an immediately succeeding label is superfluous. Fixes: 87d791423ac6 ("eficonfig: menu-driven addition of UEFI boot option") Addresses-Coverity: 376202 ("Identical code for different branches") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
9945bc4f |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Fix incorrect return code of boot option update Correct the return code for out-of-memory and no boot option found Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
339b527b |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Move bootorder and bootoption apis to lib Rename and move bootorder and bootoption apis from cmd to lib for re-use between eficonfig and bootmgr Fix 'unexpected indentation' when 'make htmldocs' after functions are moved Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
2c0b0c31 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_SECURE_BOOT This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_SECURE_BOOT defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
83f3d121 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_MM_COMM_TEE This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_MM_COMM_TEE defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
88df3634 |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: CTRL+S to save the boot order 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>
|
#
45f5319f |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
menu: remove CTRL+C to quit On the sandbox called without "--terminal raw" CTRL+C leaves U-Boot, "ESC/CTRL+C to quit" is misleading. Let's remove CTRL+C to quit key handling from bootmenu and eficonfig menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
|
#
8dbd0a0f |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add vertical scroll support The current eficonfig menu does not support vertical scroll, so it can not display the menu entries greater than the console row size. This commit add the vertial scroll support. The console size is retrieved by SIMPLE_TEXT_OUTPUT_PROTOCOL.QueryMode() service, then calculates the row size for menu entry by subtracting menu header and description row size from the console row size. "start" and "end" are added in the efimenu structure. "start" keeps the menu entry index at the top, "end" keeps the bottom menu entry index. item_data_print() menu function only draws the menu entry between "start" and "end". This commit also fixes the issue that "Save" and "Quit" entries can be moved by BKEY_PLUS in change boot order menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
0d590852 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation This commit removes the change boot order specific menu implementation. The change boot order implementation calls eficonfig_process_common() same as other menus. The change boot order menu requires own item_data_print and item_choice implementation, but display_statusline function can be a same function as other menus. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
cd160b27 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor eficonfig_process_common function Current change boot order implementation does not call eficonfig_process_common() and call own menu functions for display_statusline, item_data_print and item_choice. Change boot order functionality should call eficonfig_process_common() to improve maintenanceability. This commit is a preparation to remove the change boot order specific implementation. The menu functions (display_statusline, item_data_print and item_choice) are added as argument of eficonfig_process_common(). The menu description string displayed at the bottom of the menu is also added as argument. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
32bab0ea |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Make use of CLI character processing Avoid duplicating some of the escape-sequence processing here and use the CLI function instead. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
d0ca98db |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Update bootmenu_loop() to return the code Use the return value to save having to pass around a pointer. This also resolves any ambiguity about what *key contains when the function is called. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
2da4a15e |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Rename KEY_... to BKEY_... This enum values conflict with linux/input.h so rename them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
64550274 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: avoid SetVariable between GetNextVariableName calls The current code calls efi_set_variable_int() to delete the invalid boot option between calls to efi_get_next_variable_name_int(), it may produce unpredictable results. This commit moves removal of the invalid boot option outside of the efi_get_next_variable_name_int() calls. EFI_NOT_FOUND returned from efi_get_next_variable_name_int() indicates we retrieved all EFI variables, it should be treated as EFI_SUCEESS. To address the checkpatch warning of too many leading tabs, combine two if statement into one. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
ce327084 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: carve out efi_get_next_variable_name_int calls To retrieve the EFI variable name by efi_get_next_variable_name_int(), the sequence of alloc -> efi_get_next_variable_name_int -> realloc -> efi_get_next_variable_name_int is required. In current code, this sequence repeatedly appears in the several functions. It should be curved out a common function. This commit also fixes the missing free() of var_name16 in eficonfig_delete_invalid_boot_option(). Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
140a8959 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use efi_get_next_variable_name_int() eficonfig command reads all possible UEFI load options from 0x0000 to 0xFFFF to construct the menu. This takes too much time in some environment. This commit uses efi_get_next_variable_name_int() to read all existing UEFI load options to significantlly reduce the count of efi_get_var() call. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
78b1ccc4 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use u16_strsize() to get u16 string buffer size Use u16_strsize() to simplify the u16 string buffer size calculation. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c67d3c9e |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix going one directory up issue The directory name in eficonfig menu entry contains the '\' separator. strcmp() argument ".." is wrong and one directory up handling does not work correctly. strcmp() argument must include '\' separator. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c3b5af63 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add UEFI Secure Boot Key enrollment interface This commit adds the menu-driven UEFI Secure Boot Key enrollment interface. User can enroll PK, KEK, db and dbx by selecting file. Only the signed EFI Signature List(s) with an authenticated header, typically '.auth' file, is accepted. To clear the PK, KEK, db and dbx, user needs to enroll the null key signed by PK or KEK. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
21faf4ef |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use protocol interface for file selection EFI_SIMPLE_FILE_SYSTEM_PROTOCOL is not always provided by U-Boot. Use protocol interface functions instead of U-Boot internal functions. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d6566113 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose eficonfig_create_device_path() Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use eficonfig_create_device_path() to construct the full device path from device path of the volume and file path, so move it out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d571f9b2 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation All the eficonfig menus other than "Change Boot Order" use 'eficonfig_entry' structure for each menu entry. This commit refactors change boot order implementation to use 'eficonfig_entry' structure same as other menus to have consistent menu handling. This commit also simplifies the data->active handling when KEY_SPACE is pressed, and sizeof() parameter. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
8961e93e |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose append entry function Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use append_entry() and append_quit_entry() to construct the menu, so move them out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
a84040ab |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor file selection handling eficonfig_select_file_handler() is commonly used to select the file. eficonfig_display_select_file_option() adds an additional menu to clear the selected file. eficonfig_display_select_file_option() is not always necessary for the file selection process, so it must be outside of eficonfig_select_file_handler(). This commit also renames the following functions to avoid confusion. eficonfig_select_file_handler() -> eficonfig_process_select_file() eficonfig_select_file() -> eficonfig_show_file_selection() eficonfig_display_select_file_option() -> eficonfig_process_show_file_option() Finally, test_eficonfig.py need to be updated to get aligned with the above modification. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
1167e88a |
|
14-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix missing variable initialization The 'ret' variable must be initialized before use in eficonfig_delete_invalid_boot_option(). Fixes: c416f1c0bc ("bootmenu: add removable media entries") Addresses-Coverity: 376207 ("Uninitialized variables") Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
3d595ac5 |
|
09-Nov-2022 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: remove superfluous if in eficonfig_edit_boot_option Goto for an immediately succeeding label is superfluous. Fixes: 87d791423ac6 ("eficonfig: menu-driven addition of UEFI boot option") Addresses-Coverity: 376202 ("Identical code for different branches") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
9945bc4f |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Fix incorrect return code of boot option update Correct the return code for out-of-memory and no boot option found Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
339b527b |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Move bootorder and bootoption apis to lib Rename and move bootorder and bootoption apis from cmd to lib for re-use between eficonfig and bootmgr Fix 'unexpected indentation' when 'make htmldocs' after functions are moved Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
2c0b0c31 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_SECURE_BOOT This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_SECURE_BOOT defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
83f3d121 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_MM_COMM_TEE This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_MM_COMM_TEE defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
88df3634 |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: CTRL+S to save the boot order 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>
|
#
45f5319f |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
menu: remove CTRL+C to quit On the sandbox called without "--terminal raw" CTRL+C leaves U-Boot, "ESC/CTRL+C to quit" is misleading. Let's remove CTRL+C to quit key handling from bootmenu and eficonfig menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
|
#
8dbd0a0f |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add vertical scroll support The current eficonfig menu does not support vertical scroll, so it can not display the menu entries greater than the console row size. This commit add the vertial scroll support. The console size is retrieved by SIMPLE_TEXT_OUTPUT_PROTOCOL.QueryMode() service, then calculates the row size for menu entry by subtracting menu header and description row size from the console row size. "start" and "end" are added in the efimenu structure. "start" keeps the menu entry index at the top, "end" keeps the bottom menu entry index. item_data_print() menu function only draws the menu entry between "start" and "end". This commit also fixes the issue that "Save" and "Quit" entries can be moved by BKEY_PLUS in change boot order menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
0d590852 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation This commit removes the change boot order specific menu implementation. The change boot order implementation calls eficonfig_process_common() same as other menus. The change boot order menu requires own item_data_print and item_choice implementation, but display_statusline function can be a same function as other menus. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
cd160b27 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor eficonfig_process_common function Current change boot order implementation does not call eficonfig_process_common() and call own menu functions for display_statusline, item_data_print and item_choice. Change boot order functionality should call eficonfig_process_common() to improve maintenanceability. This commit is a preparation to remove the change boot order specific implementation. The menu functions (display_statusline, item_data_print and item_choice) are added as argument of eficonfig_process_common(). The menu description string displayed at the bottom of the menu is also added as argument. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
32bab0ea |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Make use of CLI character processing Avoid duplicating some of the escape-sequence processing here and use the CLI function instead. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
d0ca98db |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Update bootmenu_loop() to return the code Use the return value to save having to pass around a pointer. This also resolves any ambiguity about what *key contains when the function is called. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
2da4a15e |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Rename KEY_... to BKEY_... This enum values conflict with linux/input.h so rename them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
64550274 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: avoid SetVariable between GetNextVariableName calls The current code calls efi_set_variable_int() to delete the invalid boot option between calls to efi_get_next_variable_name_int(), it may produce unpredictable results. This commit moves removal of the invalid boot option outside of the efi_get_next_variable_name_int() calls. EFI_NOT_FOUND returned from efi_get_next_variable_name_int() indicates we retrieved all EFI variables, it should be treated as EFI_SUCEESS. To address the checkpatch warning of too many leading tabs, combine two if statement into one. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
ce327084 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: carve out efi_get_next_variable_name_int calls To retrieve the EFI variable name by efi_get_next_variable_name_int(), the sequence of alloc -> efi_get_next_variable_name_int -> realloc -> efi_get_next_variable_name_int is required. In current code, this sequence repeatedly appears in the several functions. It should be curved out a common function. This commit also fixes the missing free() of var_name16 in eficonfig_delete_invalid_boot_option(). Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
140a8959 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use efi_get_next_variable_name_int() eficonfig command reads all possible UEFI load options from 0x0000 to 0xFFFF to construct the menu. This takes too much time in some environment. This commit uses efi_get_next_variable_name_int() to read all existing UEFI load options to significantlly reduce the count of efi_get_var() call. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
78b1ccc4 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use u16_strsize() to get u16 string buffer size Use u16_strsize() to simplify the u16 string buffer size calculation. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c67d3c9e |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix going one directory up issue The directory name in eficonfig menu entry contains the '\' separator. strcmp() argument ".." is wrong and one directory up handling does not work correctly. strcmp() argument must include '\' separator. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c3b5af63 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add UEFI Secure Boot Key enrollment interface This commit adds the menu-driven UEFI Secure Boot Key enrollment interface. User can enroll PK, KEK, db and dbx by selecting file. Only the signed EFI Signature List(s) with an authenticated header, typically '.auth' file, is accepted. To clear the PK, KEK, db and dbx, user needs to enroll the null key signed by PK or KEK. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
21faf4ef |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use protocol interface for file selection EFI_SIMPLE_FILE_SYSTEM_PROTOCOL is not always provided by U-Boot. Use protocol interface functions instead of U-Boot internal functions. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d6566113 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose eficonfig_create_device_path() Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use eficonfig_create_device_path() to construct the full device path from device path of the volume and file path, so move it out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d571f9b2 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation All the eficonfig menus other than "Change Boot Order" use 'eficonfig_entry' structure for each menu entry. This commit refactors change boot order implementation to use 'eficonfig_entry' structure same as other menus to have consistent menu handling. This commit also simplifies the data->active handling when KEY_SPACE is pressed, and sizeof() parameter. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
8961e93e |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose append entry function Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use append_entry() and append_quit_entry() to construct the menu, so move them out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
a84040ab |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor file selection handling eficonfig_select_file_handler() is commonly used to select the file. eficonfig_display_select_file_option() adds an additional menu to clear the selected file. eficonfig_display_select_file_option() is not always necessary for the file selection process, so it must be outside of eficonfig_select_file_handler(). This commit also renames the following functions to avoid confusion. eficonfig_select_file_handler() -> eficonfig_process_select_file() eficonfig_select_file() -> eficonfig_show_file_selection() eficonfig_display_select_file_option() -> eficonfig_process_show_file_option() Finally, test_eficonfig.py need to be updated to get aligned with the above modification. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
1167e88a |
|
14-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix missing variable initialization The 'ret' variable must be initialized before use in eficonfig_delete_invalid_boot_option(). Fixes: c416f1c0bc ("bootmenu: add removable media entries") Addresses-Coverity: 376207 ("Uninitialized variables") Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
3d595ac5 |
|
09-Nov-2022 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: remove superfluous if in eficonfig_edit_boot_option Goto for an immediately succeeding label is superfluous. Fixes: 87d791423ac6 ("eficonfig: menu-driven addition of UEFI boot option") Addresses-Coverity: 376202 ("Identical code for different branches") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
9945bc4f |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Fix incorrect return code of boot option update Correct the return code for out-of-memory and no boot option found Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
339b527b |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Move bootorder and bootoption apis to lib Rename and move bootorder and bootoption apis from cmd to lib for re-use between eficonfig and bootmgr Fix 'unexpected indentation' when 'make htmldocs' after functions are moved Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
2c0b0c31 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_SECURE_BOOT This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_SECURE_BOOT defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
83f3d121 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_MM_COMM_TEE This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_MM_COMM_TEE defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
88df3634 |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: CTRL+S to save the boot order 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>
|
#
45f5319f |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
menu: remove CTRL+C to quit On the sandbox called without "--terminal raw" CTRL+C leaves U-Boot, "ESC/CTRL+C to quit" is misleading. Let's remove CTRL+C to quit key handling from bootmenu and eficonfig menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
|
#
8dbd0a0f |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add vertical scroll support The current eficonfig menu does not support vertical scroll, so it can not display the menu entries greater than the console row size. This commit add the vertial scroll support. The console size is retrieved by SIMPLE_TEXT_OUTPUT_PROTOCOL.QueryMode() service, then calculates the row size for menu entry by subtracting menu header and description row size from the console row size. "start" and "end" are added in the efimenu structure. "start" keeps the menu entry index at the top, "end" keeps the bottom menu entry index. item_data_print() menu function only draws the menu entry between "start" and "end". This commit also fixes the issue that "Save" and "Quit" entries can be moved by BKEY_PLUS in change boot order menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
0d590852 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation This commit removes the change boot order specific menu implementation. The change boot order implementation calls eficonfig_process_common() same as other menus. The change boot order menu requires own item_data_print and item_choice implementation, but display_statusline function can be a same function as other menus. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
cd160b27 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor eficonfig_process_common function Current change boot order implementation does not call eficonfig_process_common() and call own menu functions for display_statusline, item_data_print and item_choice. Change boot order functionality should call eficonfig_process_common() to improve maintenanceability. This commit is a preparation to remove the change boot order specific implementation. The menu functions (display_statusline, item_data_print and item_choice) are added as argument of eficonfig_process_common(). The menu description string displayed at the bottom of the menu is also added as argument. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
32bab0ea |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Make use of CLI character processing Avoid duplicating some of the escape-sequence processing here and use the CLI function instead. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
d0ca98db |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Update bootmenu_loop() to return the code Use the return value to save having to pass around a pointer. This also resolves any ambiguity about what *key contains when the function is called. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
2da4a15e |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Rename KEY_... to BKEY_... This enum values conflict with linux/input.h so rename them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
64550274 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: avoid SetVariable between GetNextVariableName calls The current code calls efi_set_variable_int() to delete the invalid boot option between calls to efi_get_next_variable_name_int(), it may produce unpredictable results. This commit moves removal of the invalid boot option outside of the efi_get_next_variable_name_int() calls. EFI_NOT_FOUND returned from efi_get_next_variable_name_int() indicates we retrieved all EFI variables, it should be treated as EFI_SUCEESS. To address the checkpatch warning of too many leading tabs, combine two if statement into one. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
ce327084 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: carve out efi_get_next_variable_name_int calls To retrieve the EFI variable name by efi_get_next_variable_name_int(), the sequence of alloc -> efi_get_next_variable_name_int -> realloc -> efi_get_next_variable_name_int is required. In current code, this sequence repeatedly appears in the several functions. It should be curved out a common function. This commit also fixes the missing free() of var_name16 in eficonfig_delete_invalid_boot_option(). Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
140a8959 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use efi_get_next_variable_name_int() eficonfig command reads all possible UEFI load options from 0x0000 to 0xFFFF to construct the menu. This takes too much time in some environment. This commit uses efi_get_next_variable_name_int() to read all existing UEFI load options to significantlly reduce the count of efi_get_var() call. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
78b1ccc4 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use u16_strsize() to get u16 string buffer size Use u16_strsize() to simplify the u16 string buffer size calculation. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c67d3c9e |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix going one directory up issue The directory name in eficonfig menu entry contains the '\' separator. strcmp() argument ".." is wrong and one directory up handling does not work correctly. strcmp() argument must include '\' separator. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c3b5af63 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add UEFI Secure Boot Key enrollment interface This commit adds the menu-driven UEFI Secure Boot Key enrollment interface. User can enroll PK, KEK, db and dbx by selecting file. Only the signed EFI Signature List(s) with an authenticated header, typically '.auth' file, is accepted. To clear the PK, KEK, db and dbx, user needs to enroll the null key signed by PK or KEK. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
21faf4ef |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use protocol interface for file selection EFI_SIMPLE_FILE_SYSTEM_PROTOCOL is not always provided by U-Boot. Use protocol interface functions instead of U-Boot internal functions. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d6566113 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose eficonfig_create_device_path() Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use eficonfig_create_device_path() to construct the full device path from device path of the volume and file path, so move it out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d571f9b2 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation All the eficonfig menus other than "Change Boot Order" use 'eficonfig_entry' structure for each menu entry. This commit refactors change boot order implementation to use 'eficonfig_entry' structure same as other menus to have consistent menu handling. This commit also simplifies the data->active handling when KEY_SPACE is pressed, and sizeof() parameter. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
8961e93e |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose append entry function Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use append_entry() and append_quit_entry() to construct the menu, so move them out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
a84040ab |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor file selection handling eficonfig_select_file_handler() is commonly used to select the file. eficonfig_display_select_file_option() adds an additional menu to clear the selected file. eficonfig_display_select_file_option() is not always necessary for the file selection process, so it must be outside of eficonfig_select_file_handler(). This commit also renames the following functions to avoid confusion. eficonfig_select_file_handler() -> eficonfig_process_select_file() eficonfig_select_file() -> eficonfig_show_file_selection() eficonfig_display_select_file_option() -> eficonfig_process_show_file_option() Finally, test_eficonfig.py need to be updated to get aligned with the above modification. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
1167e88a |
|
14-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix missing variable initialization The 'ret' variable must be initialized before use in eficonfig_delete_invalid_boot_option(). Fixes: c416f1c0bc ("bootmenu: add removable media entries") Addresses-Coverity: 376207 ("Uninitialized variables") Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
3d595ac5 |
|
09-Nov-2022 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: remove superfluous if in eficonfig_edit_boot_option Goto for an immediately succeeding label is superfluous. Fixes: 87d791423ac6 ("eficonfig: menu-driven addition of UEFI boot option") Addresses-Coverity: 376202 ("Identical code for different branches") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
9945bc4f |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Fix incorrect return code of boot option update Correct the return code for out-of-memory and no boot option found Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
339b527b |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Move bootorder and bootoption apis to lib Rename and move bootorder and bootoption apis from cmd to lib for re-use between eficonfig and bootmgr Fix 'unexpected indentation' when 'make htmldocs' after functions are moved Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
2c0b0c31 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_SECURE_BOOT This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_SECURE_BOOT defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
83f3d121 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_MM_COMM_TEE This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_MM_COMM_TEE defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
88df3634 |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: CTRL+S to save the boot order 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>
|
#
45f5319f |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
menu: remove CTRL+C to quit On the sandbox called without "--terminal raw" CTRL+C leaves U-Boot, "ESC/CTRL+C to quit" is misleading. Let's remove CTRL+C to quit key handling from bootmenu and eficonfig menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
|
#
8dbd0a0f |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add vertical scroll support The current eficonfig menu does not support vertical scroll, so it can not display the menu entries greater than the console row size. This commit add the vertial scroll support. The console size is retrieved by SIMPLE_TEXT_OUTPUT_PROTOCOL.QueryMode() service, then calculates the row size for menu entry by subtracting menu header and description row size from the console row size. "start" and "end" are added in the efimenu structure. "start" keeps the menu entry index at the top, "end" keeps the bottom menu entry index. item_data_print() menu function only draws the menu entry between "start" and "end". This commit also fixes the issue that "Save" and "Quit" entries can be moved by BKEY_PLUS in change boot order menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
0d590852 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation This commit removes the change boot order specific menu implementation. The change boot order implementation calls eficonfig_process_common() same as other menus. The change boot order menu requires own item_data_print and item_choice implementation, but display_statusline function can be a same function as other menus. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
cd160b27 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor eficonfig_process_common function Current change boot order implementation does not call eficonfig_process_common() and call own menu functions for display_statusline, item_data_print and item_choice. Change boot order functionality should call eficonfig_process_common() to improve maintenanceability. This commit is a preparation to remove the change boot order specific implementation. The menu functions (display_statusline, item_data_print and item_choice) are added as argument of eficonfig_process_common(). The menu description string displayed at the bottom of the menu is also added as argument. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
32bab0ea |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Make use of CLI character processing Avoid duplicating some of the escape-sequence processing here and use the CLI function instead. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
d0ca98db |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Update bootmenu_loop() to return the code Use the return value to save having to pass around a pointer. This also resolves any ambiguity about what *key contains when the function is called. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
2da4a15e |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Rename KEY_... to BKEY_... This enum values conflict with linux/input.h so rename them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
64550274 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: avoid SetVariable between GetNextVariableName calls The current code calls efi_set_variable_int() to delete the invalid boot option between calls to efi_get_next_variable_name_int(), it may produce unpredictable results. This commit moves removal of the invalid boot option outside of the efi_get_next_variable_name_int() calls. EFI_NOT_FOUND returned from efi_get_next_variable_name_int() indicates we retrieved all EFI variables, it should be treated as EFI_SUCEESS. To address the checkpatch warning of too many leading tabs, combine two if statement into one. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
ce327084 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: carve out efi_get_next_variable_name_int calls To retrieve the EFI variable name by efi_get_next_variable_name_int(), the sequence of alloc -> efi_get_next_variable_name_int -> realloc -> efi_get_next_variable_name_int is required. In current code, this sequence repeatedly appears in the several functions. It should be curved out a common function. This commit also fixes the missing free() of var_name16 in eficonfig_delete_invalid_boot_option(). Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
140a8959 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use efi_get_next_variable_name_int() eficonfig command reads all possible UEFI load options from 0x0000 to 0xFFFF to construct the menu. This takes too much time in some environment. This commit uses efi_get_next_variable_name_int() to read all existing UEFI load options to significantlly reduce the count of efi_get_var() call. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
78b1ccc4 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use u16_strsize() to get u16 string buffer size Use u16_strsize() to simplify the u16 string buffer size calculation. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c67d3c9e |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix going one directory up issue The directory name in eficonfig menu entry contains the '\' separator. strcmp() argument ".." is wrong and one directory up handling does not work correctly. strcmp() argument must include '\' separator. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c3b5af63 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add UEFI Secure Boot Key enrollment interface This commit adds the menu-driven UEFI Secure Boot Key enrollment interface. User can enroll PK, KEK, db and dbx by selecting file. Only the signed EFI Signature List(s) with an authenticated header, typically '.auth' file, is accepted. To clear the PK, KEK, db and dbx, user needs to enroll the null key signed by PK or KEK. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
21faf4ef |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use protocol interface for file selection EFI_SIMPLE_FILE_SYSTEM_PROTOCOL is not always provided by U-Boot. Use protocol interface functions instead of U-Boot internal functions. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d6566113 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose eficonfig_create_device_path() Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use eficonfig_create_device_path() to construct the full device path from device path of the volume and file path, so move it out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d571f9b2 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation All the eficonfig menus other than "Change Boot Order" use 'eficonfig_entry' structure for each menu entry. This commit refactors change boot order implementation to use 'eficonfig_entry' structure same as other menus to have consistent menu handling. This commit also simplifies the data->active handling when KEY_SPACE is pressed, and sizeof() parameter. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
8961e93e |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose append entry function Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use append_entry() and append_quit_entry() to construct the menu, so move them out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
a84040ab |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor file selection handling eficonfig_select_file_handler() is commonly used to select the file. eficonfig_display_select_file_option() adds an additional menu to clear the selected file. eficonfig_display_select_file_option() is not always necessary for the file selection process, so it must be outside of eficonfig_select_file_handler(). This commit also renames the following functions to avoid confusion. eficonfig_select_file_handler() -> eficonfig_process_select_file() eficonfig_select_file() -> eficonfig_show_file_selection() eficonfig_display_select_file_option() -> eficonfig_process_show_file_option() Finally, test_eficonfig.py need to be updated to get aligned with the above modification. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
1167e88a |
|
14-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix missing variable initialization The 'ret' variable must be initialized before use in eficonfig_delete_invalid_boot_option(). Fixes: c416f1c0bc ("bootmenu: add removable media entries") Addresses-Coverity: 376207 ("Uninitialized variables") Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
3d595ac5 |
|
09-Nov-2022 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: remove superfluous if in eficonfig_edit_boot_option Goto for an immediately succeeding label is superfluous. Fixes: 87d791423ac6 ("eficonfig: menu-driven addition of UEFI boot option") Addresses-Coverity: 376202 ("Identical code for different branches") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
9945bc4f |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Fix incorrect return code of boot option update Correct the return code for out-of-memory and no boot option found Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
339b527b |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Move bootorder and bootoption apis to lib Rename and move bootorder and bootoption apis from cmd to lib for re-use between eficonfig and bootmgr Fix 'unexpected indentation' when 'make htmldocs' after functions are moved Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
2c0b0c31 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_SECURE_BOOT This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_SECURE_BOOT defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
83f3d121 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_MM_COMM_TEE This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_MM_COMM_TEE defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
88df3634 |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: CTRL+S to save the boot order 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>
|
#
45f5319f |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
menu: remove CTRL+C to quit On the sandbox called without "--terminal raw" CTRL+C leaves U-Boot, "ESC/CTRL+C to quit" is misleading. Let's remove CTRL+C to quit key handling from bootmenu and eficonfig menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
|
#
8dbd0a0f |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add vertical scroll support The current eficonfig menu does not support vertical scroll, so it can not display the menu entries greater than the console row size. This commit add the vertial scroll support. The console size is retrieved by SIMPLE_TEXT_OUTPUT_PROTOCOL.QueryMode() service, then calculates the row size for menu entry by subtracting menu header and description row size from the console row size. "start" and "end" are added in the efimenu structure. "start" keeps the menu entry index at the top, "end" keeps the bottom menu entry index. item_data_print() menu function only draws the menu entry between "start" and "end". This commit also fixes the issue that "Save" and "Quit" entries can be moved by BKEY_PLUS in change boot order menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
0d590852 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation This commit removes the change boot order specific menu implementation. The change boot order implementation calls eficonfig_process_common() same as other menus. The change boot order menu requires own item_data_print and item_choice implementation, but display_statusline function can be a same function as other menus. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
cd160b27 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor eficonfig_process_common function Current change boot order implementation does not call eficonfig_process_common() and call own menu functions for display_statusline, item_data_print and item_choice. Change boot order functionality should call eficonfig_process_common() to improve maintenanceability. This commit is a preparation to remove the change boot order specific implementation. The menu functions (display_statusline, item_data_print and item_choice) are added as argument of eficonfig_process_common(). The menu description string displayed at the bottom of the menu is also added as argument. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
32bab0ea |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Make use of CLI character processing Avoid duplicating some of the escape-sequence processing here and use the CLI function instead. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
d0ca98db |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Update bootmenu_loop() to return the code Use the return value to save having to pass around a pointer. This also resolves any ambiguity about what *key contains when the function is called. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
2da4a15e |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Rename KEY_... to BKEY_... This enum values conflict with linux/input.h so rename them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
64550274 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: avoid SetVariable between GetNextVariableName calls The current code calls efi_set_variable_int() to delete the invalid boot option between calls to efi_get_next_variable_name_int(), it may produce unpredictable results. This commit moves removal of the invalid boot option outside of the efi_get_next_variable_name_int() calls. EFI_NOT_FOUND returned from efi_get_next_variable_name_int() indicates we retrieved all EFI variables, it should be treated as EFI_SUCEESS. To address the checkpatch warning of too many leading tabs, combine two if statement into one. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
ce327084 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: carve out efi_get_next_variable_name_int calls To retrieve the EFI variable name by efi_get_next_variable_name_int(), the sequence of alloc -> efi_get_next_variable_name_int -> realloc -> efi_get_next_variable_name_int is required. In current code, this sequence repeatedly appears in the several functions. It should be curved out a common function. This commit also fixes the missing free() of var_name16 in eficonfig_delete_invalid_boot_option(). Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
140a8959 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use efi_get_next_variable_name_int() eficonfig command reads all possible UEFI load options from 0x0000 to 0xFFFF to construct the menu. This takes too much time in some environment. This commit uses efi_get_next_variable_name_int() to read all existing UEFI load options to significantlly reduce the count of efi_get_var() call. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
78b1ccc4 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use u16_strsize() to get u16 string buffer size Use u16_strsize() to simplify the u16 string buffer size calculation. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c67d3c9e |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix going one directory up issue The directory name in eficonfig menu entry contains the '\' separator. strcmp() argument ".." is wrong and one directory up handling does not work correctly. strcmp() argument must include '\' separator. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c3b5af63 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add UEFI Secure Boot Key enrollment interface This commit adds the menu-driven UEFI Secure Boot Key enrollment interface. User can enroll PK, KEK, db and dbx by selecting file. Only the signed EFI Signature List(s) with an authenticated header, typically '.auth' file, is accepted. To clear the PK, KEK, db and dbx, user needs to enroll the null key signed by PK or KEK. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
21faf4ef |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use protocol interface for file selection EFI_SIMPLE_FILE_SYSTEM_PROTOCOL is not always provided by U-Boot. Use protocol interface functions instead of U-Boot internal functions. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d6566113 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose eficonfig_create_device_path() Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use eficonfig_create_device_path() to construct the full device path from device path of the volume and file path, so move it out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d571f9b2 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation All the eficonfig menus other than "Change Boot Order" use 'eficonfig_entry' structure for each menu entry. This commit refactors change boot order implementation to use 'eficonfig_entry' structure same as other menus to have consistent menu handling. This commit also simplifies the data->active handling when KEY_SPACE is pressed, and sizeof() parameter. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
8961e93e |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose append entry function Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use append_entry() and append_quit_entry() to construct the menu, so move them out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
a84040ab |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor file selection handling eficonfig_select_file_handler() is commonly used to select the file. eficonfig_display_select_file_option() adds an additional menu to clear the selected file. eficonfig_display_select_file_option() is not always necessary for the file selection process, so it must be outside of eficonfig_select_file_handler(). This commit also renames the following functions to avoid confusion. eficonfig_select_file_handler() -> eficonfig_process_select_file() eficonfig_select_file() -> eficonfig_show_file_selection() eficonfig_display_select_file_option() -> eficonfig_process_show_file_option() Finally, test_eficonfig.py need to be updated to get aligned with the above modification. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
1167e88a |
|
14-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix missing variable initialization The 'ret' variable must be initialized before use in eficonfig_delete_invalid_boot_option(). Fixes: c416f1c0bc ("bootmenu: add removable media entries") Addresses-Coverity: 376207 ("Uninitialized variables") Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
3d595ac5 |
|
09-Nov-2022 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: remove superfluous if in eficonfig_edit_boot_option Goto for an immediately succeeding label is superfluous. Fixes: 87d791423ac6 ("eficonfig: menu-driven addition of UEFI boot option") Addresses-Coverity: 376202 ("Identical code for different branches") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
9945bc4f |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Fix incorrect return code of boot option update Correct the return code for out-of-memory and no boot option found Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
339b527b |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Move bootorder and bootoption apis to lib Rename and move bootorder and bootoption apis from cmd to lib for re-use between eficonfig and bootmgr Fix 'unexpected indentation' when 'make htmldocs' after functions are moved Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
2c0b0c31 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_SECURE_BOOT This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_SECURE_BOOT defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
83f3d121 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_MM_COMM_TEE This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_MM_COMM_TEE defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
88df3634 |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: CTRL+S to save the boot order 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>
|
#
45f5319f |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
menu: remove CTRL+C to quit On the sandbox called without "--terminal raw" CTRL+C leaves U-Boot, "ESC/CTRL+C to quit" is misleading. Let's remove CTRL+C to quit key handling from bootmenu and eficonfig menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
|
#
8dbd0a0f |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add vertical scroll support The current eficonfig menu does not support vertical scroll, so it can not display the menu entries greater than the console row size. This commit add the vertial scroll support. The console size is retrieved by SIMPLE_TEXT_OUTPUT_PROTOCOL.QueryMode() service, then calculates the row size for menu entry by subtracting menu header and description row size from the console row size. "start" and "end" are added in the efimenu structure. "start" keeps the menu entry index at the top, "end" keeps the bottom menu entry index. item_data_print() menu function only draws the menu entry between "start" and "end". This commit also fixes the issue that "Save" and "Quit" entries can be moved by BKEY_PLUS in change boot order menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
0d590852 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation This commit removes the change boot order specific menu implementation. The change boot order implementation calls eficonfig_process_common() same as other menus. The change boot order menu requires own item_data_print and item_choice implementation, but display_statusline function can be a same function as other menus. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
cd160b27 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor eficonfig_process_common function Current change boot order implementation does not call eficonfig_process_common() and call own menu functions for display_statusline, item_data_print and item_choice. Change boot order functionality should call eficonfig_process_common() to improve maintenanceability. This commit is a preparation to remove the change boot order specific implementation. The menu functions (display_statusline, item_data_print and item_choice) are added as argument of eficonfig_process_common(). The menu description string displayed at the bottom of the menu is also added as argument. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
32bab0ea |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Make use of CLI character processing Avoid duplicating some of the escape-sequence processing here and use the CLI function instead. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
d0ca98db |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Update bootmenu_loop() to return the code Use the return value to save having to pass around a pointer. This also resolves any ambiguity about what *key contains when the function is called. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
2da4a15e |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Rename KEY_... to BKEY_... This enum values conflict with linux/input.h so rename them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
64550274 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: avoid SetVariable between GetNextVariableName calls The current code calls efi_set_variable_int() to delete the invalid boot option between calls to efi_get_next_variable_name_int(), it may produce unpredictable results. This commit moves removal of the invalid boot option outside of the efi_get_next_variable_name_int() calls. EFI_NOT_FOUND returned from efi_get_next_variable_name_int() indicates we retrieved all EFI variables, it should be treated as EFI_SUCEESS. To address the checkpatch warning of too many leading tabs, combine two if statement into one. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
ce327084 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: carve out efi_get_next_variable_name_int calls To retrieve the EFI variable name by efi_get_next_variable_name_int(), the sequence of alloc -> efi_get_next_variable_name_int -> realloc -> efi_get_next_variable_name_int is required. In current code, this sequence repeatedly appears in the several functions. It should be curved out a common function. This commit also fixes the missing free() of var_name16 in eficonfig_delete_invalid_boot_option(). Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
140a8959 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use efi_get_next_variable_name_int() eficonfig command reads all possible UEFI load options from 0x0000 to 0xFFFF to construct the menu. This takes too much time in some environment. This commit uses efi_get_next_variable_name_int() to read all existing UEFI load options to significantlly reduce the count of efi_get_var() call. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
78b1ccc4 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use u16_strsize() to get u16 string buffer size Use u16_strsize() to simplify the u16 string buffer size calculation. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c67d3c9e |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix going one directory up issue The directory name in eficonfig menu entry contains the '\' separator. strcmp() argument ".." is wrong and one directory up handling does not work correctly. strcmp() argument must include '\' separator. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c3b5af63 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add UEFI Secure Boot Key enrollment interface This commit adds the menu-driven UEFI Secure Boot Key enrollment interface. User can enroll PK, KEK, db and dbx by selecting file. Only the signed EFI Signature List(s) with an authenticated header, typically '.auth' file, is accepted. To clear the PK, KEK, db and dbx, user needs to enroll the null key signed by PK or KEK. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
21faf4ef |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use protocol interface for file selection EFI_SIMPLE_FILE_SYSTEM_PROTOCOL is not always provided by U-Boot. Use protocol interface functions instead of U-Boot internal functions. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d6566113 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose eficonfig_create_device_path() Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use eficonfig_create_device_path() to construct the full device path from device path of the volume and file path, so move it out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d571f9b2 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation All the eficonfig menus other than "Change Boot Order" use 'eficonfig_entry' structure for each menu entry. This commit refactors change boot order implementation to use 'eficonfig_entry' structure same as other menus to have consistent menu handling. This commit also simplifies the data->active handling when KEY_SPACE is pressed, and sizeof() parameter. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
8961e93e |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose append entry function Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use append_entry() and append_quit_entry() to construct the menu, so move them out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
a84040ab |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor file selection handling eficonfig_select_file_handler() is commonly used to select the file. eficonfig_display_select_file_option() adds an additional menu to clear the selected file. eficonfig_display_select_file_option() is not always necessary for the file selection process, so it must be outside of eficonfig_select_file_handler(). This commit also renames the following functions to avoid confusion. eficonfig_select_file_handler() -> eficonfig_process_select_file() eficonfig_select_file() -> eficonfig_show_file_selection() eficonfig_display_select_file_option() -> eficonfig_process_show_file_option() Finally, test_eficonfig.py need to be updated to get aligned with the above modification. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
1167e88a |
|
14-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix missing variable initialization The 'ret' variable must be initialized before use in eficonfig_delete_invalid_boot_option(). Fixes: c416f1c0bc ("bootmenu: add removable media entries") Addresses-Coverity: 376207 ("Uninitialized variables") Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
3d595ac5 |
|
09-Nov-2022 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: remove superfluous if in eficonfig_edit_boot_option Goto for an immediately succeeding label is superfluous. Fixes: 87d791423ac6 ("eficonfig: menu-driven addition of UEFI boot option") Addresses-Coverity: 376202 ("Identical code for different branches") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
9945bc4f |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Fix incorrect return code of boot option update Correct the return code for out-of-memory and no boot option found Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
339b527b |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Move bootorder and bootoption apis to lib Rename and move bootorder and bootoption apis from cmd to lib for re-use between eficonfig and bootmgr Fix 'unexpected indentation' when 'make htmldocs' after functions are moved Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
2c0b0c31 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_SECURE_BOOT This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_SECURE_BOOT defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
83f3d121 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_MM_COMM_TEE This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_MM_COMM_TEE defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
88df3634 |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: CTRL+S to save the boot order 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>
|
#
45f5319f |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
menu: remove CTRL+C to quit On the sandbox called without "--terminal raw" CTRL+C leaves U-Boot, "ESC/CTRL+C to quit" is misleading. Let's remove CTRL+C to quit key handling from bootmenu and eficonfig menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
|
#
8dbd0a0f |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add vertical scroll support The current eficonfig menu does not support vertical scroll, so it can not display the menu entries greater than the console row size. This commit add the vertial scroll support. The console size is retrieved by SIMPLE_TEXT_OUTPUT_PROTOCOL.QueryMode() service, then calculates the row size for menu entry by subtracting menu header and description row size from the console row size. "start" and "end" are added in the efimenu structure. "start" keeps the menu entry index at the top, "end" keeps the bottom menu entry index. item_data_print() menu function only draws the menu entry between "start" and "end". This commit also fixes the issue that "Save" and "Quit" entries can be moved by BKEY_PLUS in change boot order menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
0d590852 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation This commit removes the change boot order specific menu implementation. The change boot order implementation calls eficonfig_process_common() same as other menus. The change boot order menu requires own item_data_print and item_choice implementation, but display_statusline function can be a same function as other menus. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
cd160b27 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor eficonfig_process_common function Current change boot order implementation does not call eficonfig_process_common() and call own menu functions for display_statusline, item_data_print and item_choice. Change boot order functionality should call eficonfig_process_common() to improve maintenanceability. This commit is a preparation to remove the change boot order specific implementation. The menu functions (display_statusline, item_data_print and item_choice) are added as argument of eficonfig_process_common(). The menu description string displayed at the bottom of the menu is also added as argument. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
32bab0ea |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Make use of CLI character processing Avoid duplicating some of the escape-sequence processing here and use the CLI function instead. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
d0ca98db |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Update bootmenu_loop() to return the code Use the return value to save having to pass around a pointer. This also resolves any ambiguity about what *key contains when the function is called. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
2da4a15e |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Rename KEY_... to BKEY_... This enum values conflict with linux/input.h so rename them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
64550274 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: avoid SetVariable between GetNextVariableName calls The current code calls efi_set_variable_int() to delete the invalid boot option between calls to efi_get_next_variable_name_int(), it may produce unpredictable results. This commit moves removal of the invalid boot option outside of the efi_get_next_variable_name_int() calls. EFI_NOT_FOUND returned from efi_get_next_variable_name_int() indicates we retrieved all EFI variables, it should be treated as EFI_SUCEESS. To address the checkpatch warning of too many leading tabs, combine two if statement into one. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
ce327084 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: carve out efi_get_next_variable_name_int calls To retrieve the EFI variable name by efi_get_next_variable_name_int(), the sequence of alloc -> efi_get_next_variable_name_int -> realloc -> efi_get_next_variable_name_int is required. In current code, this sequence repeatedly appears in the several functions. It should be curved out a common function. This commit also fixes the missing free() of var_name16 in eficonfig_delete_invalid_boot_option(). Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
140a8959 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use efi_get_next_variable_name_int() eficonfig command reads all possible UEFI load options from 0x0000 to 0xFFFF to construct the menu. This takes too much time in some environment. This commit uses efi_get_next_variable_name_int() to read all existing UEFI load options to significantlly reduce the count of efi_get_var() call. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
78b1ccc4 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use u16_strsize() to get u16 string buffer size Use u16_strsize() to simplify the u16 string buffer size calculation. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c67d3c9e |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix going one directory up issue The directory name in eficonfig menu entry contains the '\' separator. strcmp() argument ".." is wrong and one directory up handling does not work correctly. strcmp() argument must include '\' separator. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c3b5af63 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add UEFI Secure Boot Key enrollment interface This commit adds the menu-driven UEFI Secure Boot Key enrollment interface. User can enroll PK, KEK, db and dbx by selecting file. Only the signed EFI Signature List(s) with an authenticated header, typically '.auth' file, is accepted. To clear the PK, KEK, db and dbx, user needs to enroll the null key signed by PK or KEK. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
21faf4ef |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use protocol interface for file selection EFI_SIMPLE_FILE_SYSTEM_PROTOCOL is not always provided by U-Boot. Use protocol interface functions instead of U-Boot internal functions. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d6566113 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose eficonfig_create_device_path() Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use eficonfig_create_device_path() to construct the full device path from device path of the volume and file path, so move it out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d571f9b2 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation All the eficonfig menus other than "Change Boot Order" use 'eficonfig_entry' structure for each menu entry. This commit refactors change boot order implementation to use 'eficonfig_entry' structure same as other menus to have consistent menu handling. This commit also simplifies the data->active handling when KEY_SPACE is pressed, and sizeof() parameter. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
8961e93e |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose append entry function Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use append_entry() and append_quit_entry() to construct the menu, so move them out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
a84040ab |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor file selection handling eficonfig_select_file_handler() is commonly used to select the file. eficonfig_display_select_file_option() adds an additional menu to clear the selected file. eficonfig_display_select_file_option() is not always necessary for the file selection process, so it must be outside of eficonfig_select_file_handler(). This commit also renames the following functions to avoid confusion. eficonfig_select_file_handler() -> eficonfig_process_select_file() eficonfig_select_file() -> eficonfig_show_file_selection() eficonfig_display_select_file_option() -> eficonfig_process_show_file_option() Finally, test_eficonfig.py need to be updated to get aligned with the above modification. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
1167e88a |
|
14-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix missing variable initialization The 'ret' variable must be initialized before use in eficonfig_delete_invalid_boot_option(). Fixes: c416f1c0bc ("bootmenu: add removable media entries") Addresses-Coverity: 376207 ("Uninitialized variables") Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
3d595ac5 |
|
09-Nov-2022 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: remove superfluous if in eficonfig_edit_boot_option Goto for an immediately succeeding label is superfluous. Fixes: 87d791423ac6 ("eficonfig: menu-driven addition of UEFI boot option") Addresses-Coverity: 376202 ("Identical code for different branches") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
9945bc4f |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Fix incorrect return code of boot option update Correct the return code for out-of-memory and no boot option found Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
339b527b |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Move bootorder and bootoption apis to lib Rename and move bootorder and bootoption apis from cmd to lib for re-use between eficonfig and bootmgr Fix 'unexpected indentation' when 'make htmldocs' after functions are moved Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
2c0b0c31 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_SECURE_BOOT This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_SECURE_BOOT defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
83f3d121 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_MM_COMM_TEE This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_MM_COMM_TEE defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
88df3634 |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: CTRL+S to save the boot order 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>
|
#
45f5319f |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
menu: remove CTRL+C to quit On the sandbox called without "--terminal raw" CTRL+C leaves U-Boot, "ESC/CTRL+C to quit" is misleading. Let's remove CTRL+C to quit key handling from bootmenu and eficonfig menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
|
#
8dbd0a0f |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add vertical scroll support The current eficonfig menu does not support vertical scroll, so it can not display the menu entries greater than the console row size. This commit add the vertial scroll support. The console size is retrieved by SIMPLE_TEXT_OUTPUT_PROTOCOL.QueryMode() service, then calculates the row size for menu entry by subtracting menu header and description row size from the console row size. "start" and "end" are added in the efimenu structure. "start" keeps the menu entry index at the top, "end" keeps the bottom menu entry index. item_data_print() menu function only draws the menu entry between "start" and "end". This commit also fixes the issue that "Save" and "Quit" entries can be moved by BKEY_PLUS in change boot order menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
0d590852 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation This commit removes the change boot order specific menu implementation. The change boot order implementation calls eficonfig_process_common() same as other menus. The change boot order menu requires own item_data_print and item_choice implementation, but display_statusline function can be a same function as other menus. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
cd160b27 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor eficonfig_process_common function Current change boot order implementation does not call eficonfig_process_common() and call own menu functions for display_statusline, item_data_print and item_choice. Change boot order functionality should call eficonfig_process_common() to improve maintenanceability. This commit is a preparation to remove the change boot order specific implementation. The menu functions (display_statusline, item_data_print and item_choice) are added as argument of eficonfig_process_common(). The menu description string displayed at the bottom of the menu is also added as argument. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
32bab0ea |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Make use of CLI character processing Avoid duplicating some of the escape-sequence processing here and use the CLI function instead. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
d0ca98db |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Update bootmenu_loop() to return the code Use the return value to save having to pass around a pointer. This also resolves any ambiguity about what *key contains when the function is called. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
2da4a15e |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Rename KEY_... to BKEY_... This enum values conflict with linux/input.h so rename them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
64550274 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: avoid SetVariable between GetNextVariableName calls The current code calls efi_set_variable_int() to delete the invalid boot option between calls to efi_get_next_variable_name_int(), it may produce unpredictable results. This commit moves removal of the invalid boot option outside of the efi_get_next_variable_name_int() calls. EFI_NOT_FOUND returned from efi_get_next_variable_name_int() indicates we retrieved all EFI variables, it should be treated as EFI_SUCEESS. To address the checkpatch warning of too many leading tabs, combine two if statement into one. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
ce327084 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: carve out efi_get_next_variable_name_int calls To retrieve the EFI variable name by efi_get_next_variable_name_int(), the sequence of alloc -> efi_get_next_variable_name_int -> realloc -> efi_get_next_variable_name_int is required. In current code, this sequence repeatedly appears in the several functions. It should be curved out a common function. This commit also fixes the missing free() of var_name16 in eficonfig_delete_invalid_boot_option(). Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
140a8959 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use efi_get_next_variable_name_int() eficonfig command reads all possible UEFI load options from 0x0000 to 0xFFFF to construct the menu. This takes too much time in some environment. This commit uses efi_get_next_variable_name_int() to read all existing UEFI load options to significantlly reduce the count of efi_get_var() call. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
78b1ccc4 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use u16_strsize() to get u16 string buffer size Use u16_strsize() to simplify the u16 string buffer size calculation. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c67d3c9e |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix going one directory up issue The directory name in eficonfig menu entry contains the '\' separator. strcmp() argument ".." is wrong and one directory up handling does not work correctly. strcmp() argument must include '\' separator. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c3b5af63 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add UEFI Secure Boot Key enrollment interface This commit adds the menu-driven UEFI Secure Boot Key enrollment interface. User can enroll PK, KEK, db and dbx by selecting file. Only the signed EFI Signature List(s) with an authenticated header, typically '.auth' file, is accepted. To clear the PK, KEK, db and dbx, user needs to enroll the null key signed by PK or KEK. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
21faf4ef |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use protocol interface for file selection EFI_SIMPLE_FILE_SYSTEM_PROTOCOL is not always provided by U-Boot. Use protocol interface functions instead of U-Boot internal functions. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d6566113 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose eficonfig_create_device_path() Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use eficonfig_create_device_path() to construct the full device path from device path of the volume and file path, so move it out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d571f9b2 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation All the eficonfig menus other than "Change Boot Order" use 'eficonfig_entry' structure for each menu entry. This commit refactors change boot order implementation to use 'eficonfig_entry' structure same as other menus to have consistent menu handling. This commit also simplifies the data->active handling when KEY_SPACE is pressed, and sizeof() parameter. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
8961e93e |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose append entry function Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use append_entry() and append_quit_entry() to construct the menu, so move them out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
a84040ab |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor file selection handling eficonfig_select_file_handler() is commonly used to select the file. eficonfig_display_select_file_option() adds an additional menu to clear the selected file. eficonfig_display_select_file_option() is not always necessary for the file selection process, so it must be outside of eficonfig_select_file_handler(). This commit also renames the following functions to avoid confusion. eficonfig_select_file_handler() -> eficonfig_process_select_file() eficonfig_select_file() -> eficonfig_show_file_selection() eficonfig_display_select_file_option() -> eficonfig_process_show_file_option() Finally, test_eficonfig.py need to be updated to get aligned with the above modification. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
1167e88a |
|
14-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix missing variable initialization The 'ret' variable must be initialized before use in eficonfig_delete_invalid_boot_option(). Fixes: c416f1c0bc ("bootmenu: add removable media entries") Addresses-Coverity: 376207 ("Uninitialized variables") Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
3d595ac5 |
|
09-Nov-2022 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: remove superfluous if in eficonfig_edit_boot_option Goto for an immediately succeeding label is superfluous. Fixes: 87d791423ac6 ("eficonfig: menu-driven addition of UEFI boot option") Addresses-Coverity: 376202 ("Identical code for different branches") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
9945bc4f |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Fix incorrect return code of boot option update Correct the return code for out-of-memory and no boot option found Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
339b527b |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Move bootorder and bootoption apis to lib Rename and move bootorder and bootoption apis from cmd to lib for re-use between eficonfig and bootmgr Fix 'unexpected indentation' when 'make htmldocs' after functions are moved Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
2c0b0c31 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_SECURE_BOOT This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_SECURE_BOOT defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
83f3d121 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_MM_COMM_TEE This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_MM_COMM_TEE defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
88df3634 |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: CTRL+S to save the boot order 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>
|
#
45f5319f |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
menu: remove CTRL+C to quit On the sandbox called without "--terminal raw" CTRL+C leaves U-Boot, "ESC/CTRL+C to quit" is misleading. Let's remove CTRL+C to quit key handling from bootmenu and eficonfig menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
|
#
8dbd0a0f |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add vertical scroll support The current eficonfig menu does not support vertical scroll, so it can not display the menu entries greater than the console row size. This commit add the vertial scroll support. The console size is retrieved by SIMPLE_TEXT_OUTPUT_PROTOCOL.QueryMode() service, then calculates the row size for menu entry by subtracting menu header and description row size from the console row size. "start" and "end" are added in the efimenu structure. "start" keeps the menu entry index at the top, "end" keeps the bottom menu entry index. item_data_print() menu function only draws the menu entry between "start" and "end". This commit also fixes the issue that "Save" and "Quit" entries can be moved by BKEY_PLUS in change boot order menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
0d590852 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation This commit removes the change boot order specific menu implementation. The change boot order implementation calls eficonfig_process_common() same as other menus. The change boot order menu requires own item_data_print and item_choice implementation, but display_statusline function can be a same function as other menus. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
cd160b27 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor eficonfig_process_common function Current change boot order implementation does not call eficonfig_process_common() and call own menu functions for display_statusline, item_data_print and item_choice. Change boot order functionality should call eficonfig_process_common() to improve maintenanceability. This commit is a preparation to remove the change boot order specific implementation. The menu functions (display_statusline, item_data_print and item_choice) are added as argument of eficonfig_process_common(). The menu description string displayed at the bottom of the menu is also added as argument. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
32bab0ea |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Make use of CLI character processing Avoid duplicating some of the escape-sequence processing here and use the CLI function instead. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
d0ca98db |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Update bootmenu_loop() to return the code Use the return value to save having to pass around a pointer. This also resolves any ambiguity about what *key contains when the function is called. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
2da4a15e |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Rename KEY_... to BKEY_... This enum values conflict with linux/input.h so rename them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
64550274 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: avoid SetVariable between GetNextVariableName calls The current code calls efi_set_variable_int() to delete the invalid boot option between calls to efi_get_next_variable_name_int(), it may produce unpredictable results. This commit moves removal of the invalid boot option outside of the efi_get_next_variable_name_int() calls. EFI_NOT_FOUND returned from efi_get_next_variable_name_int() indicates we retrieved all EFI variables, it should be treated as EFI_SUCEESS. To address the checkpatch warning of too many leading tabs, combine two if statement into one. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
ce327084 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: carve out efi_get_next_variable_name_int calls To retrieve the EFI variable name by efi_get_next_variable_name_int(), the sequence of alloc -> efi_get_next_variable_name_int -> realloc -> efi_get_next_variable_name_int is required. In current code, this sequence repeatedly appears in the several functions. It should be curved out a common function. This commit also fixes the missing free() of var_name16 in eficonfig_delete_invalid_boot_option(). Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
140a8959 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use efi_get_next_variable_name_int() eficonfig command reads all possible UEFI load options from 0x0000 to 0xFFFF to construct the menu. This takes too much time in some environment. This commit uses efi_get_next_variable_name_int() to read all existing UEFI load options to significantlly reduce the count of efi_get_var() call. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
78b1ccc4 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use u16_strsize() to get u16 string buffer size Use u16_strsize() to simplify the u16 string buffer size calculation. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c67d3c9e |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix going one directory up issue The directory name in eficonfig menu entry contains the '\' separator. strcmp() argument ".." is wrong and one directory up handling does not work correctly. strcmp() argument must include '\' separator. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c3b5af63 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add UEFI Secure Boot Key enrollment interface This commit adds the menu-driven UEFI Secure Boot Key enrollment interface. User can enroll PK, KEK, db and dbx by selecting file. Only the signed EFI Signature List(s) with an authenticated header, typically '.auth' file, is accepted. To clear the PK, KEK, db and dbx, user needs to enroll the null key signed by PK or KEK. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
21faf4ef |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use protocol interface for file selection EFI_SIMPLE_FILE_SYSTEM_PROTOCOL is not always provided by U-Boot. Use protocol interface functions instead of U-Boot internal functions. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d6566113 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose eficonfig_create_device_path() Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use eficonfig_create_device_path() to construct the full device path from device path of the volume and file path, so move it out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d571f9b2 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation All the eficonfig menus other than "Change Boot Order" use 'eficonfig_entry' structure for each menu entry. This commit refactors change boot order implementation to use 'eficonfig_entry' structure same as other menus to have consistent menu handling. This commit also simplifies the data->active handling when KEY_SPACE is pressed, and sizeof() parameter. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
8961e93e |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose append entry function Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use append_entry() and append_quit_entry() to construct the menu, so move them out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
a84040ab |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor file selection handling eficonfig_select_file_handler() is commonly used to select the file. eficonfig_display_select_file_option() adds an additional menu to clear the selected file. eficonfig_display_select_file_option() is not always necessary for the file selection process, so it must be outside of eficonfig_select_file_handler(). This commit also renames the following functions to avoid confusion. eficonfig_select_file_handler() -> eficonfig_process_select_file() eficonfig_select_file() -> eficonfig_show_file_selection() eficonfig_display_select_file_option() -> eficonfig_process_show_file_option() Finally, test_eficonfig.py need to be updated to get aligned with the above modification. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
1167e88a |
|
14-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix missing variable initialization The 'ret' variable must be initialized before use in eficonfig_delete_invalid_boot_option(). Fixes: c416f1c0bc ("bootmenu: add removable media entries") Addresses-Coverity: 376207 ("Uninitialized variables") Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
3d595ac5 |
|
09-Nov-2022 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: remove superfluous if in eficonfig_edit_boot_option Goto for an immediately succeeding label is superfluous. Fixes: 87d791423ac6 ("eficonfig: menu-driven addition of UEFI boot option") Addresses-Coverity: 376202 ("Identical code for different branches") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
9945bc4f |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Fix incorrect return code of boot option update Correct the return code for out-of-memory and no boot option found Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
339b527b |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Move bootorder and bootoption apis to lib Rename and move bootorder and bootoption apis from cmd to lib for re-use between eficonfig and bootmgr Fix 'unexpected indentation' when 'make htmldocs' after functions are moved Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
2c0b0c31 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_SECURE_BOOT This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_SECURE_BOOT defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
83f3d121 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_MM_COMM_TEE This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_MM_COMM_TEE defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
88df3634 |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: CTRL+S to save the boot order 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>
|
#
45f5319f |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
menu: remove CTRL+C to quit On the sandbox called without "--terminal raw" CTRL+C leaves U-Boot, "ESC/CTRL+C to quit" is misleading. Let's remove CTRL+C to quit key handling from bootmenu and eficonfig menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
|
#
8dbd0a0f |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add vertical scroll support The current eficonfig menu does not support vertical scroll, so it can not display the menu entries greater than the console row size. This commit add the vertial scroll support. The console size is retrieved by SIMPLE_TEXT_OUTPUT_PROTOCOL.QueryMode() service, then calculates the row size for menu entry by subtracting menu header and description row size from the console row size. "start" and "end" are added in the efimenu structure. "start" keeps the menu entry index at the top, "end" keeps the bottom menu entry index. item_data_print() menu function only draws the menu entry between "start" and "end". This commit also fixes the issue that "Save" and "Quit" entries can be moved by BKEY_PLUS in change boot order menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
0d590852 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation This commit removes the change boot order specific menu implementation. The change boot order implementation calls eficonfig_process_common() same as other menus. The change boot order menu requires own item_data_print and item_choice implementation, but display_statusline function can be a same function as other menus. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
cd160b27 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor eficonfig_process_common function Current change boot order implementation does not call eficonfig_process_common() and call own menu functions for display_statusline, item_data_print and item_choice. Change boot order functionality should call eficonfig_process_common() to improve maintenanceability. This commit is a preparation to remove the change boot order specific implementation. The menu functions (display_statusline, item_data_print and item_choice) are added as argument of eficonfig_process_common(). The menu description string displayed at the bottom of the menu is also added as argument. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
32bab0ea |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Make use of CLI character processing Avoid duplicating some of the escape-sequence processing here and use the CLI function instead. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
d0ca98db |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Update bootmenu_loop() to return the code Use the return value to save having to pass around a pointer. This also resolves any ambiguity about what *key contains when the function is called. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
2da4a15e |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Rename KEY_... to BKEY_... This enum values conflict with linux/input.h so rename them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
64550274 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: avoid SetVariable between GetNextVariableName calls The current code calls efi_set_variable_int() to delete the invalid boot option between calls to efi_get_next_variable_name_int(), it may produce unpredictable results. This commit moves removal of the invalid boot option outside of the efi_get_next_variable_name_int() calls. EFI_NOT_FOUND returned from efi_get_next_variable_name_int() indicates we retrieved all EFI variables, it should be treated as EFI_SUCEESS. To address the checkpatch warning of too many leading tabs, combine two if statement into one. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
ce327084 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: carve out efi_get_next_variable_name_int calls To retrieve the EFI variable name by efi_get_next_variable_name_int(), the sequence of alloc -> efi_get_next_variable_name_int -> realloc -> efi_get_next_variable_name_int is required. In current code, this sequence repeatedly appears in the several functions. It should be curved out a common function. This commit also fixes the missing free() of var_name16 in eficonfig_delete_invalid_boot_option(). Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
140a8959 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use efi_get_next_variable_name_int() eficonfig command reads all possible UEFI load options from 0x0000 to 0xFFFF to construct the menu. This takes too much time in some environment. This commit uses efi_get_next_variable_name_int() to read all existing UEFI load options to significantlly reduce the count of efi_get_var() call. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
78b1ccc4 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use u16_strsize() to get u16 string buffer size Use u16_strsize() to simplify the u16 string buffer size calculation. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c67d3c9e |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix going one directory up issue The directory name in eficonfig menu entry contains the '\' separator. strcmp() argument ".." is wrong and one directory up handling does not work correctly. strcmp() argument must include '\' separator. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c3b5af63 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add UEFI Secure Boot Key enrollment interface This commit adds the menu-driven UEFI Secure Boot Key enrollment interface. User can enroll PK, KEK, db and dbx by selecting file. Only the signed EFI Signature List(s) with an authenticated header, typically '.auth' file, is accepted. To clear the PK, KEK, db and dbx, user needs to enroll the null key signed by PK or KEK. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
21faf4ef |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use protocol interface for file selection EFI_SIMPLE_FILE_SYSTEM_PROTOCOL is not always provided by U-Boot. Use protocol interface functions instead of U-Boot internal functions. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d6566113 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose eficonfig_create_device_path() Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use eficonfig_create_device_path() to construct the full device path from device path of the volume and file path, so move it out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d571f9b2 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation All the eficonfig menus other than "Change Boot Order" use 'eficonfig_entry' structure for each menu entry. This commit refactors change boot order implementation to use 'eficonfig_entry' structure same as other menus to have consistent menu handling. This commit also simplifies the data->active handling when KEY_SPACE is pressed, and sizeof() parameter. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
8961e93e |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose append entry function Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use append_entry() and append_quit_entry() to construct the menu, so move them out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
a84040ab |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor file selection handling eficonfig_select_file_handler() is commonly used to select the file. eficonfig_display_select_file_option() adds an additional menu to clear the selected file. eficonfig_display_select_file_option() is not always necessary for the file selection process, so it must be outside of eficonfig_select_file_handler(). This commit also renames the following functions to avoid confusion. eficonfig_select_file_handler() -> eficonfig_process_select_file() eficonfig_select_file() -> eficonfig_show_file_selection() eficonfig_display_select_file_option() -> eficonfig_process_show_file_option() Finally, test_eficonfig.py need to be updated to get aligned with the above modification. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
1167e88a |
|
14-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix missing variable initialization The 'ret' variable must be initialized before use in eficonfig_delete_invalid_boot_option(). Fixes: c416f1c0bc ("bootmenu: add removable media entries") Addresses-Coverity: 376207 ("Uninitialized variables") Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
3d595ac5 |
|
09-Nov-2022 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: remove superfluous if in eficonfig_edit_boot_option Goto for an immediately succeeding label is superfluous. Fixes: 87d791423ac6 ("eficonfig: menu-driven addition of UEFI boot option") Addresses-Coverity: 376202 ("Identical code for different branches") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
9945bc4f |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Fix incorrect return code of boot option update Correct the return code for out-of-memory and no boot option found Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
339b527b |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Move bootorder and bootoption apis to lib Rename and move bootorder and bootoption apis from cmd to lib for re-use between eficonfig and bootmgr Fix 'unexpected indentation' when 'make htmldocs' after functions are moved Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
2c0b0c31 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_SECURE_BOOT This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_SECURE_BOOT defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
83f3d121 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_MM_COMM_TEE This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_MM_COMM_TEE defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
88df3634 |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: CTRL+S to save the boot order 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>
|
#
45f5319f |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
menu: remove CTRL+C to quit On the sandbox called without "--terminal raw" CTRL+C leaves U-Boot, "ESC/CTRL+C to quit" is misleading. Let's remove CTRL+C to quit key handling from bootmenu and eficonfig menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
|
#
8dbd0a0f |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add vertical scroll support The current eficonfig menu does not support vertical scroll, so it can not display the menu entries greater than the console row size. This commit add the vertial scroll support. The console size is retrieved by SIMPLE_TEXT_OUTPUT_PROTOCOL.QueryMode() service, then calculates the row size for menu entry by subtracting menu header and description row size from the console row size. "start" and "end" are added in the efimenu structure. "start" keeps the menu entry index at the top, "end" keeps the bottom menu entry index. item_data_print() menu function only draws the menu entry between "start" and "end". This commit also fixes the issue that "Save" and "Quit" entries can be moved by BKEY_PLUS in change boot order menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
0d590852 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation This commit removes the change boot order specific menu implementation. The change boot order implementation calls eficonfig_process_common() same as other menus. The change boot order menu requires own item_data_print and item_choice implementation, but display_statusline function can be a same function as other menus. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
cd160b27 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor eficonfig_process_common function Current change boot order implementation does not call eficonfig_process_common() and call own menu functions for display_statusline, item_data_print and item_choice. Change boot order functionality should call eficonfig_process_common() to improve maintenanceability. This commit is a preparation to remove the change boot order specific implementation. The menu functions (display_statusline, item_data_print and item_choice) are added as argument of eficonfig_process_common(). The menu description string displayed at the bottom of the menu is also added as argument. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
32bab0ea |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Make use of CLI character processing Avoid duplicating some of the escape-sequence processing here and use the CLI function instead. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
d0ca98db |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Update bootmenu_loop() to return the code Use the return value to save having to pass around a pointer. This also resolves any ambiguity about what *key contains when the function is called. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
2da4a15e |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Rename KEY_... to BKEY_... This enum values conflict with linux/input.h so rename them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
64550274 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: avoid SetVariable between GetNextVariableName calls The current code calls efi_set_variable_int() to delete the invalid boot option between calls to efi_get_next_variable_name_int(), it may produce unpredictable results. This commit moves removal of the invalid boot option outside of the efi_get_next_variable_name_int() calls. EFI_NOT_FOUND returned from efi_get_next_variable_name_int() indicates we retrieved all EFI variables, it should be treated as EFI_SUCEESS. To address the checkpatch warning of too many leading tabs, combine two if statement into one. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
ce327084 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: carve out efi_get_next_variable_name_int calls To retrieve the EFI variable name by efi_get_next_variable_name_int(), the sequence of alloc -> efi_get_next_variable_name_int -> realloc -> efi_get_next_variable_name_int is required. In current code, this sequence repeatedly appears in the several functions. It should be curved out a common function. This commit also fixes the missing free() of var_name16 in eficonfig_delete_invalid_boot_option(). Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
140a8959 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use efi_get_next_variable_name_int() eficonfig command reads all possible UEFI load options from 0x0000 to 0xFFFF to construct the menu. This takes too much time in some environment. This commit uses efi_get_next_variable_name_int() to read all existing UEFI load options to significantlly reduce the count of efi_get_var() call. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
78b1ccc4 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use u16_strsize() to get u16 string buffer size Use u16_strsize() to simplify the u16 string buffer size calculation. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c67d3c9e |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix going one directory up issue The directory name in eficonfig menu entry contains the '\' separator. strcmp() argument ".." is wrong and one directory up handling does not work correctly. strcmp() argument must include '\' separator. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c3b5af63 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add UEFI Secure Boot Key enrollment interface This commit adds the menu-driven UEFI Secure Boot Key enrollment interface. User can enroll PK, KEK, db and dbx by selecting file. Only the signed EFI Signature List(s) with an authenticated header, typically '.auth' file, is accepted. To clear the PK, KEK, db and dbx, user needs to enroll the null key signed by PK or KEK. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
21faf4ef |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use protocol interface for file selection EFI_SIMPLE_FILE_SYSTEM_PROTOCOL is not always provided by U-Boot. Use protocol interface functions instead of U-Boot internal functions. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d6566113 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose eficonfig_create_device_path() Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use eficonfig_create_device_path() to construct the full device path from device path of the volume and file path, so move it out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d571f9b2 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation All the eficonfig menus other than "Change Boot Order" use 'eficonfig_entry' structure for each menu entry. This commit refactors change boot order implementation to use 'eficonfig_entry' structure same as other menus to have consistent menu handling. This commit also simplifies the data->active handling when KEY_SPACE is pressed, and sizeof() parameter. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
8961e93e |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose append entry function Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use append_entry() and append_quit_entry() to construct the menu, so move them out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
a84040ab |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor file selection handling eficonfig_select_file_handler() is commonly used to select the file. eficonfig_display_select_file_option() adds an additional menu to clear the selected file. eficonfig_display_select_file_option() is not always necessary for the file selection process, so it must be outside of eficonfig_select_file_handler(). This commit also renames the following functions to avoid confusion. eficonfig_select_file_handler() -> eficonfig_process_select_file() eficonfig_select_file() -> eficonfig_show_file_selection() eficonfig_display_select_file_option() -> eficonfig_process_show_file_option() Finally, test_eficonfig.py need to be updated to get aligned with the above modification. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
1167e88a |
|
14-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix missing variable initialization The 'ret' variable must be initialized before use in eficonfig_delete_invalid_boot_option(). Fixes: c416f1c0bc ("bootmenu: add removable media entries") Addresses-Coverity: 376207 ("Uninitialized variables") Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
3d595ac5 |
|
09-Nov-2022 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: remove superfluous if in eficonfig_edit_boot_option Goto for an immediately succeeding label is superfluous. Fixes: 87d791423ac6 ("eficonfig: menu-driven addition of UEFI boot option") Addresses-Coverity: 376202 ("Identical code for different branches") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
9945bc4f |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Fix incorrect return code of boot option update Correct the return code for out-of-memory and no boot option found Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
339b527b |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Move bootorder and bootoption apis to lib Rename and move bootorder and bootoption apis from cmd to lib for re-use between eficonfig and bootmgr Fix 'unexpected indentation' when 'make htmldocs' after functions are moved Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
2c0b0c31 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_SECURE_BOOT This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_SECURE_BOOT defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
83f3d121 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_MM_COMM_TEE This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_MM_COMM_TEE defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
88df3634 |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: CTRL+S to save the boot order 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>
|
#
45f5319f |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
menu: remove CTRL+C to quit On the sandbox called without "--terminal raw" CTRL+C leaves U-Boot, "ESC/CTRL+C to quit" is misleading. Let's remove CTRL+C to quit key handling from bootmenu and eficonfig menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
|
#
8dbd0a0f |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add vertical scroll support The current eficonfig menu does not support vertical scroll, so it can not display the menu entries greater than the console row size. This commit add the vertial scroll support. The console size is retrieved by SIMPLE_TEXT_OUTPUT_PROTOCOL.QueryMode() service, then calculates the row size for menu entry by subtracting menu header and description row size from the console row size. "start" and "end" are added in the efimenu structure. "start" keeps the menu entry index at the top, "end" keeps the bottom menu entry index. item_data_print() menu function only draws the menu entry between "start" and "end". This commit also fixes the issue that "Save" and "Quit" entries can be moved by BKEY_PLUS in change boot order menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
0d590852 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation This commit removes the change boot order specific menu implementation. The change boot order implementation calls eficonfig_process_common() same as other menus. The change boot order menu requires own item_data_print and item_choice implementation, but display_statusline function can be a same function as other menus. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
cd160b27 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor eficonfig_process_common function Current change boot order implementation does not call eficonfig_process_common() and call own menu functions for display_statusline, item_data_print and item_choice. Change boot order functionality should call eficonfig_process_common() to improve maintenanceability. This commit is a preparation to remove the change boot order specific implementation. The menu functions (display_statusline, item_data_print and item_choice) are added as argument of eficonfig_process_common(). The menu description string displayed at the bottom of the menu is also added as argument. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
32bab0ea |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Make use of CLI character processing Avoid duplicating some of the escape-sequence processing here and use the CLI function instead. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
d0ca98db |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Update bootmenu_loop() to return the code Use the return value to save having to pass around a pointer. This also resolves any ambiguity about what *key contains when the function is called. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
2da4a15e |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Rename KEY_... to BKEY_... This enum values conflict with linux/input.h so rename them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
64550274 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: avoid SetVariable between GetNextVariableName calls The current code calls efi_set_variable_int() to delete the invalid boot option between calls to efi_get_next_variable_name_int(), it may produce unpredictable results. This commit moves removal of the invalid boot option outside of the efi_get_next_variable_name_int() calls. EFI_NOT_FOUND returned from efi_get_next_variable_name_int() indicates we retrieved all EFI variables, it should be treated as EFI_SUCEESS. To address the checkpatch warning of too many leading tabs, combine two if statement into one. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
ce327084 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: carve out efi_get_next_variable_name_int calls To retrieve the EFI variable name by efi_get_next_variable_name_int(), the sequence of alloc -> efi_get_next_variable_name_int -> realloc -> efi_get_next_variable_name_int is required. In current code, this sequence repeatedly appears in the several functions. It should be curved out a common function. This commit also fixes the missing free() of var_name16 in eficonfig_delete_invalid_boot_option(). Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
140a8959 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use efi_get_next_variable_name_int() eficonfig command reads all possible UEFI load options from 0x0000 to 0xFFFF to construct the menu. This takes too much time in some environment. This commit uses efi_get_next_variable_name_int() to read all existing UEFI load options to significantlly reduce the count of efi_get_var() call. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
78b1ccc4 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use u16_strsize() to get u16 string buffer size Use u16_strsize() to simplify the u16 string buffer size calculation. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c67d3c9e |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix going one directory up issue The directory name in eficonfig menu entry contains the '\' separator. strcmp() argument ".." is wrong and one directory up handling does not work correctly. strcmp() argument must include '\' separator. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c3b5af63 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add UEFI Secure Boot Key enrollment interface This commit adds the menu-driven UEFI Secure Boot Key enrollment interface. User can enroll PK, KEK, db and dbx by selecting file. Only the signed EFI Signature List(s) with an authenticated header, typically '.auth' file, is accepted. To clear the PK, KEK, db and dbx, user needs to enroll the null key signed by PK or KEK. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
21faf4ef |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use protocol interface for file selection EFI_SIMPLE_FILE_SYSTEM_PROTOCOL is not always provided by U-Boot. Use protocol interface functions instead of U-Boot internal functions. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d6566113 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose eficonfig_create_device_path() Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use eficonfig_create_device_path() to construct the full device path from device path of the volume and file path, so move it out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d571f9b2 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation All the eficonfig menus other than "Change Boot Order" use 'eficonfig_entry' structure for each menu entry. This commit refactors change boot order implementation to use 'eficonfig_entry' structure same as other menus to have consistent menu handling. This commit also simplifies the data->active handling when KEY_SPACE is pressed, and sizeof() parameter. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
8961e93e |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose append entry function Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use append_entry() and append_quit_entry() to construct the menu, so move them out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
a84040ab |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor file selection handling eficonfig_select_file_handler() is commonly used to select the file. eficonfig_display_select_file_option() adds an additional menu to clear the selected file. eficonfig_display_select_file_option() is not always necessary for the file selection process, so it must be outside of eficonfig_select_file_handler(). This commit also renames the following functions to avoid confusion. eficonfig_select_file_handler() -> eficonfig_process_select_file() eficonfig_select_file() -> eficonfig_show_file_selection() eficonfig_display_select_file_option() -> eficonfig_process_show_file_option() Finally, test_eficonfig.py need to be updated to get aligned with the above modification. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
1167e88a |
|
14-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix missing variable initialization The 'ret' variable must be initialized before use in eficonfig_delete_invalid_boot_option(). Fixes: c416f1c0bc ("bootmenu: add removable media entries") Addresses-Coverity: 376207 ("Uninitialized variables") Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
3d595ac5 |
|
09-Nov-2022 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: remove superfluous if in eficonfig_edit_boot_option Goto for an immediately succeeding label is superfluous. Fixes: 87d791423ac6 ("eficonfig: menu-driven addition of UEFI boot option") Addresses-Coverity: 376202 ("Identical code for different branches") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
9945bc4f |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Fix incorrect return code of boot option update Correct the return code for out-of-memory and no boot option found Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
339b527b |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Move bootorder and bootoption apis to lib Rename and move bootorder and bootoption apis from cmd to lib for re-use between eficonfig and bootmgr Fix 'unexpected indentation' when 'make htmldocs' after functions are moved Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
2c0b0c31 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_SECURE_BOOT This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_SECURE_BOOT defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
83f3d121 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_MM_COMM_TEE This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_MM_COMM_TEE defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
88df3634 |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: CTRL+S to save the boot order 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>
|
#
45f5319f |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
menu: remove CTRL+C to quit On the sandbox called without "--terminal raw" CTRL+C leaves U-Boot, "ESC/CTRL+C to quit" is misleading. Let's remove CTRL+C to quit key handling from bootmenu and eficonfig menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
|
#
8dbd0a0f |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add vertical scroll support The current eficonfig menu does not support vertical scroll, so it can not display the menu entries greater than the console row size. This commit add the vertial scroll support. The console size is retrieved by SIMPLE_TEXT_OUTPUT_PROTOCOL.QueryMode() service, then calculates the row size for menu entry by subtracting menu header and description row size from the console row size. "start" and "end" are added in the efimenu structure. "start" keeps the menu entry index at the top, "end" keeps the bottom menu entry index. item_data_print() menu function only draws the menu entry between "start" and "end". This commit also fixes the issue that "Save" and "Quit" entries can be moved by BKEY_PLUS in change boot order menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
0d590852 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation This commit removes the change boot order specific menu implementation. The change boot order implementation calls eficonfig_process_common() same as other menus. The change boot order menu requires own item_data_print and item_choice implementation, but display_statusline function can be a same function as other menus. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
cd160b27 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor eficonfig_process_common function Current change boot order implementation does not call eficonfig_process_common() and call own menu functions for display_statusline, item_data_print and item_choice. Change boot order functionality should call eficonfig_process_common() to improve maintenanceability. This commit is a preparation to remove the change boot order specific implementation. The menu functions (display_statusline, item_data_print and item_choice) are added as argument of eficonfig_process_common(). The menu description string displayed at the bottom of the menu is also added as argument. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
32bab0ea |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Make use of CLI character processing Avoid duplicating some of the escape-sequence processing here and use the CLI function instead. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
d0ca98db |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Update bootmenu_loop() to return the code Use the return value to save having to pass around a pointer. This also resolves any ambiguity about what *key contains when the function is called. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
2da4a15e |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Rename KEY_... to BKEY_... This enum values conflict with linux/input.h so rename them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
64550274 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: avoid SetVariable between GetNextVariableName calls The current code calls efi_set_variable_int() to delete the invalid boot option between calls to efi_get_next_variable_name_int(), it may produce unpredictable results. This commit moves removal of the invalid boot option outside of the efi_get_next_variable_name_int() calls. EFI_NOT_FOUND returned from efi_get_next_variable_name_int() indicates we retrieved all EFI variables, it should be treated as EFI_SUCEESS. To address the checkpatch warning of too many leading tabs, combine two if statement into one. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
ce327084 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: carve out efi_get_next_variable_name_int calls To retrieve the EFI variable name by efi_get_next_variable_name_int(), the sequence of alloc -> efi_get_next_variable_name_int -> realloc -> efi_get_next_variable_name_int is required. In current code, this sequence repeatedly appears in the several functions. It should be curved out a common function. This commit also fixes the missing free() of var_name16 in eficonfig_delete_invalid_boot_option(). Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
140a8959 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use efi_get_next_variable_name_int() eficonfig command reads all possible UEFI load options from 0x0000 to 0xFFFF to construct the menu. This takes too much time in some environment. This commit uses efi_get_next_variable_name_int() to read all existing UEFI load options to significantlly reduce the count of efi_get_var() call. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
78b1ccc4 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use u16_strsize() to get u16 string buffer size Use u16_strsize() to simplify the u16 string buffer size calculation. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c67d3c9e |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix going one directory up issue The directory name in eficonfig menu entry contains the '\' separator. strcmp() argument ".." is wrong and one directory up handling does not work correctly. strcmp() argument must include '\' separator. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c3b5af63 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add UEFI Secure Boot Key enrollment interface This commit adds the menu-driven UEFI Secure Boot Key enrollment interface. User can enroll PK, KEK, db and dbx by selecting file. Only the signed EFI Signature List(s) with an authenticated header, typically '.auth' file, is accepted. To clear the PK, KEK, db and dbx, user needs to enroll the null key signed by PK or KEK. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
21faf4ef |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use protocol interface for file selection EFI_SIMPLE_FILE_SYSTEM_PROTOCOL is not always provided by U-Boot. Use protocol interface functions instead of U-Boot internal functions. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d6566113 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose eficonfig_create_device_path() Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use eficonfig_create_device_path() to construct the full device path from device path of the volume and file path, so move it out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d571f9b2 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation All the eficonfig menus other than "Change Boot Order" use 'eficonfig_entry' structure for each menu entry. This commit refactors change boot order implementation to use 'eficonfig_entry' structure same as other menus to have consistent menu handling. This commit also simplifies the data->active handling when KEY_SPACE is pressed, and sizeof() parameter. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
8961e93e |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose append entry function Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use append_entry() and append_quit_entry() to construct the menu, so move them out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
a84040ab |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor file selection handling eficonfig_select_file_handler() is commonly used to select the file. eficonfig_display_select_file_option() adds an additional menu to clear the selected file. eficonfig_display_select_file_option() is not always necessary for the file selection process, so it must be outside of eficonfig_select_file_handler(). This commit also renames the following functions to avoid confusion. eficonfig_select_file_handler() -> eficonfig_process_select_file() eficonfig_select_file() -> eficonfig_show_file_selection() eficonfig_display_select_file_option() -> eficonfig_process_show_file_option() Finally, test_eficonfig.py need to be updated to get aligned with the above modification. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
1167e88a |
|
14-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix missing variable initialization The 'ret' variable must be initialized before use in eficonfig_delete_invalid_boot_option(). Fixes: c416f1c0bc ("bootmenu: add removable media entries") Addresses-Coverity: 376207 ("Uninitialized variables") Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
3d595ac5 |
|
09-Nov-2022 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: remove superfluous if in eficonfig_edit_boot_option Goto for an immediately succeeding label is superfluous. Fixes: 87d791423ac6 ("eficonfig: menu-driven addition of UEFI boot option") Addresses-Coverity: 376202 ("Identical code for different branches") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
9945bc4f |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Fix incorrect return code of boot option update Correct the return code for out-of-memory and no boot option found Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
339b527b |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Move bootorder and bootoption apis to lib Rename and move bootorder and bootoption apis from cmd to lib for re-use between eficonfig and bootmgr Fix 'unexpected indentation' when 'make htmldocs' after functions are moved Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
2c0b0c31 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_SECURE_BOOT This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_SECURE_BOOT defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
83f3d121 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_MM_COMM_TEE This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_MM_COMM_TEE defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
88df3634 |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: CTRL+S to save the boot order 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>
|
#
45f5319f |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
menu: remove CTRL+C to quit On the sandbox called without "--terminal raw" CTRL+C leaves U-Boot, "ESC/CTRL+C to quit" is misleading. Let's remove CTRL+C to quit key handling from bootmenu and eficonfig menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
|
#
8dbd0a0f |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add vertical scroll support The current eficonfig menu does not support vertical scroll, so it can not display the menu entries greater than the console row size. This commit add the vertial scroll support. The console size is retrieved by SIMPLE_TEXT_OUTPUT_PROTOCOL.QueryMode() service, then calculates the row size for menu entry by subtracting menu header and description row size from the console row size. "start" and "end" are added in the efimenu structure. "start" keeps the menu entry index at the top, "end" keeps the bottom menu entry index. item_data_print() menu function only draws the menu entry between "start" and "end". This commit also fixes the issue that "Save" and "Quit" entries can be moved by BKEY_PLUS in change boot order menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
0d590852 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation This commit removes the change boot order specific menu implementation. The change boot order implementation calls eficonfig_process_common() same as other menus. The change boot order menu requires own item_data_print and item_choice implementation, but display_statusline function can be a same function as other menus. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
cd160b27 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor eficonfig_process_common function Current change boot order implementation does not call eficonfig_process_common() and call own menu functions for display_statusline, item_data_print and item_choice. Change boot order functionality should call eficonfig_process_common() to improve maintenanceability. This commit is a preparation to remove the change boot order specific implementation. The menu functions (display_statusline, item_data_print and item_choice) are added as argument of eficonfig_process_common(). The menu description string displayed at the bottom of the menu is also added as argument. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
32bab0ea |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Make use of CLI character processing Avoid duplicating some of the escape-sequence processing here and use the CLI function instead. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
d0ca98db |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Update bootmenu_loop() to return the code Use the return value to save having to pass around a pointer. This also resolves any ambiguity about what *key contains when the function is called. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
2da4a15e |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Rename KEY_... to BKEY_... This enum values conflict with linux/input.h so rename them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
64550274 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: avoid SetVariable between GetNextVariableName calls The current code calls efi_set_variable_int() to delete the invalid boot option between calls to efi_get_next_variable_name_int(), it may produce unpredictable results. This commit moves removal of the invalid boot option outside of the efi_get_next_variable_name_int() calls. EFI_NOT_FOUND returned from efi_get_next_variable_name_int() indicates we retrieved all EFI variables, it should be treated as EFI_SUCEESS. To address the checkpatch warning of too many leading tabs, combine two if statement into one. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
ce327084 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: carve out efi_get_next_variable_name_int calls To retrieve the EFI variable name by efi_get_next_variable_name_int(), the sequence of alloc -> efi_get_next_variable_name_int -> realloc -> efi_get_next_variable_name_int is required. In current code, this sequence repeatedly appears in the several functions. It should be curved out a common function. This commit also fixes the missing free() of var_name16 in eficonfig_delete_invalid_boot_option(). Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
140a8959 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use efi_get_next_variable_name_int() eficonfig command reads all possible UEFI load options from 0x0000 to 0xFFFF to construct the menu. This takes too much time in some environment. This commit uses efi_get_next_variable_name_int() to read all existing UEFI load options to significantlly reduce the count of efi_get_var() call. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
78b1ccc4 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use u16_strsize() to get u16 string buffer size Use u16_strsize() to simplify the u16 string buffer size calculation. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c67d3c9e |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix going one directory up issue The directory name in eficonfig menu entry contains the '\' separator. strcmp() argument ".." is wrong and one directory up handling does not work correctly. strcmp() argument must include '\' separator. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c3b5af63 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add UEFI Secure Boot Key enrollment interface This commit adds the menu-driven UEFI Secure Boot Key enrollment interface. User can enroll PK, KEK, db and dbx by selecting file. Only the signed EFI Signature List(s) with an authenticated header, typically '.auth' file, is accepted. To clear the PK, KEK, db and dbx, user needs to enroll the null key signed by PK or KEK. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
21faf4ef |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use protocol interface for file selection EFI_SIMPLE_FILE_SYSTEM_PROTOCOL is not always provided by U-Boot. Use protocol interface functions instead of U-Boot internal functions. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d6566113 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose eficonfig_create_device_path() Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use eficonfig_create_device_path() to construct the full device path from device path of the volume and file path, so move it out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d571f9b2 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation All the eficonfig menus other than "Change Boot Order" use 'eficonfig_entry' structure for each menu entry. This commit refactors change boot order implementation to use 'eficonfig_entry' structure same as other menus to have consistent menu handling. This commit also simplifies the data->active handling when KEY_SPACE is pressed, and sizeof() parameter. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
8961e93e |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose append entry function Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use append_entry() and append_quit_entry() to construct the menu, so move them out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
a84040ab |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor file selection handling eficonfig_select_file_handler() is commonly used to select the file. eficonfig_display_select_file_option() adds an additional menu to clear the selected file. eficonfig_display_select_file_option() is not always necessary for the file selection process, so it must be outside of eficonfig_select_file_handler(). This commit also renames the following functions to avoid confusion. eficonfig_select_file_handler() -> eficonfig_process_select_file() eficonfig_select_file() -> eficonfig_show_file_selection() eficonfig_display_select_file_option() -> eficonfig_process_show_file_option() Finally, test_eficonfig.py need to be updated to get aligned with the above modification. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
1167e88a |
|
14-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix missing variable initialization The 'ret' variable must be initialized before use in eficonfig_delete_invalid_boot_option(). Fixes: c416f1c0bc ("bootmenu: add removable media entries") Addresses-Coverity: 376207 ("Uninitialized variables") Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
3d595ac5 |
|
09-Nov-2022 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: remove superfluous if in eficonfig_edit_boot_option Goto for an immediately succeeding label is superfluous. Fixes: 87d791423ac6 ("eficonfig: menu-driven addition of UEFI boot option") Addresses-Coverity: 376202 ("Identical code for different branches") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
9945bc4f |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Fix incorrect return code of boot option update Correct the return code for out-of-memory and no boot option found Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
339b527b |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Move bootorder and bootoption apis to lib Rename and move bootorder and bootoption apis from cmd to lib for re-use between eficonfig and bootmgr Fix 'unexpected indentation' when 'make htmldocs' after functions are moved Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
2c0b0c31 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_SECURE_BOOT This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_SECURE_BOOT defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
83f3d121 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_MM_COMM_TEE This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_MM_COMM_TEE defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
88df3634 |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: CTRL+S to save the boot order 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>
|
#
45f5319f |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
menu: remove CTRL+C to quit On the sandbox called without "--terminal raw" CTRL+C leaves U-Boot, "ESC/CTRL+C to quit" is misleading. Let's remove CTRL+C to quit key handling from bootmenu and eficonfig menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
|
#
8dbd0a0f |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add vertical scroll support The current eficonfig menu does not support vertical scroll, so it can not display the menu entries greater than the console row size. This commit add the vertial scroll support. The console size is retrieved by SIMPLE_TEXT_OUTPUT_PROTOCOL.QueryMode() service, then calculates the row size for menu entry by subtracting menu header and description row size from the console row size. "start" and "end" are added in the efimenu structure. "start" keeps the menu entry index at the top, "end" keeps the bottom menu entry index. item_data_print() menu function only draws the menu entry between "start" and "end". This commit also fixes the issue that "Save" and "Quit" entries can be moved by BKEY_PLUS in change boot order menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
0d590852 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation This commit removes the change boot order specific menu implementation. The change boot order implementation calls eficonfig_process_common() same as other menus. The change boot order menu requires own item_data_print and item_choice implementation, but display_statusline function can be a same function as other menus. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
cd160b27 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor eficonfig_process_common function Current change boot order implementation does not call eficonfig_process_common() and call own menu functions for display_statusline, item_data_print and item_choice. Change boot order functionality should call eficonfig_process_common() to improve maintenanceability. This commit is a preparation to remove the change boot order specific implementation. The menu functions (display_statusline, item_data_print and item_choice) are added as argument of eficonfig_process_common(). The menu description string displayed at the bottom of the menu is also added as argument. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
32bab0ea |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Make use of CLI character processing Avoid duplicating some of the escape-sequence processing here and use the CLI function instead. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
d0ca98db |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Update bootmenu_loop() to return the code Use the return value to save having to pass around a pointer. This also resolves any ambiguity about what *key contains when the function is called. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
2da4a15e |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Rename KEY_... to BKEY_... This enum values conflict with linux/input.h so rename them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
64550274 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: avoid SetVariable between GetNextVariableName calls The current code calls efi_set_variable_int() to delete the invalid boot option between calls to efi_get_next_variable_name_int(), it may produce unpredictable results. This commit moves removal of the invalid boot option outside of the efi_get_next_variable_name_int() calls. EFI_NOT_FOUND returned from efi_get_next_variable_name_int() indicates we retrieved all EFI variables, it should be treated as EFI_SUCEESS. To address the checkpatch warning of too many leading tabs, combine two if statement into one. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
ce327084 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: carve out efi_get_next_variable_name_int calls To retrieve the EFI variable name by efi_get_next_variable_name_int(), the sequence of alloc -> efi_get_next_variable_name_int -> realloc -> efi_get_next_variable_name_int is required. In current code, this sequence repeatedly appears in the several functions. It should be curved out a common function. This commit also fixes the missing free() of var_name16 in eficonfig_delete_invalid_boot_option(). Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
140a8959 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use efi_get_next_variable_name_int() eficonfig command reads all possible UEFI load options from 0x0000 to 0xFFFF to construct the menu. This takes too much time in some environment. This commit uses efi_get_next_variable_name_int() to read all existing UEFI load options to significantlly reduce the count of efi_get_var() call. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
78b1ccc4 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use u16_strsize() to get u16 string buffer size Use u16_strsize() to simplify the u16 string buffer size calculation. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c67d3c9e |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix going one directory up issue The directory name in eficonfig menu entry contains the '\' separator. strcmp() argument ".." is wrong and one directory up handling does not work correctly. strcmp() argument must include '\' separator. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c3b5af63 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add UEFI Secure Boot Key enrollment interface This commit adds the menu-driven UEFI Secure Boot Key enrollment interface. User can enroll PK, KEK, db and dbx by selecting file. Only the signed EFI Signature List(s) with an authenticated header, typically '.auth' file, is accepted. To clear the PK, KEK, db and dbx, user needs to enroll the null key signed by PK or KEK. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
21faf4ef |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use protocol interface for file selection EFI_SIMPLE_FILE_SYSTEM_PROTOCOL is not always provided by U-Boot. Use protocol interface functions instead of U-Boot internal functions. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d6566113 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose eficonfig_create_device_path() Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use eficonfig_create_device_path() to construct the full device path from device path of the volume and file path, so move it out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d571f9b2 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation All the eficonfig menus other than "Change Boot Order" use 'eficonfig_entry' structure for each menu entry. This commit refactors change boot order implementation to use 'eficonfig_entry' structure same as other menus to have consistent menu handling. This commit also simplifies the data->active handling when KEY_SPACE is pressed, and sizeof() parameter. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
8961e93e |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose append entry function Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use append_entry() and append_quit_entry() to construct the menu, so move them out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
a84040ab |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor file selection handling eficonfig_select_file_handler() is commonly used to select the file. eficonfig_display_select_file_option() adds an additional menu to clear the selected file. eficonfig_display_select_file_option() is not always necessary for the file selection process, so it must be outside of eficonfig_select_file_handler(). This commit also renames the following functions to avoid confusion. eficonfig_select_file_handler() -> eficonfig_process_select_file() eficonfig_select_file() -> eficonfig_show_file_selection() eficonfig_display_select_file_option() -> eficonfig_process_show_file_option() Finally, test_eficonfig.py need to be updated to get aligned with the above modification. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
1167e88a |
|
14-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix missing variable initialization The 'ret' variable must be initialized before use in eficonfig_delete_invalid_boot_option(). Fixes: c416f1c0bc ("bootmenu: add removable media entries") Addresses-Coverity: 376207 ("Uninitialized variables") Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
3d595ac5 |
|
09-Nov-2022 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: remove superfluous if in eficonfig_edit_boot_option Goto for an immediately succeeding label is superfluous. Fixes: 87d791423ac6 ("eficonfig: menu-driven addition of UEFI boot option") Addresses-Coverity: 376202 ("Identical code for different branches") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
9945bc4f |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Fix incorrect return code of boot option update Correct the return code for out-of-memory and no boot option found Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
339b527b |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Move bootorder and bootoption apis to lib Rename and move bootorder and bootoption apis from cmd to lib for re-use between eficonfig and bootmgr Fix 'unexpected indentation' when 'make htmldocs' after functions are moved Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
2c0b0c31 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_SECURE_BOOT This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_SECURE_BOOT defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
83f3d121 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_MM_COMM_TEE This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_MM_COMM_TEE defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
88df3634 |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: CTRL+S to save the boot order 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>
|
#
45f5319f |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
menu: remove CTRL+C to quit On the sandbox called without "--terminal raw" CTRL+C leaves U-Boot, "ESC/CTRL+C to quit" is misleading. Let's remove CTRL+C to quit key handling from bootmenu and eficonfig menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
|
#
8dbd0a0f |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add vertical scroll support The current eficonfig menu does not support vertical scroll, so it can not display the menu entries greater than the console row size. This commit add the vertial scroll support. The console size is retrieved by SIMPLE_TEXT_OUTPUT_PROTOCOL.QueryMode() service, then calculates the row size for menu entry by subtracting menu header and description row size from the console row size. "start" and "end" are added in the efimenu structure. "start" keeps the menu entry index at the top, "end" keeps the bottom menu entry index. item_data_print() menu function only draws the menu entry between "start" and "end". This commit also fixes the issue that "Save" and "Quit" entries can be moved by BKEY_PLUS in change boot order menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
0d590852 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation This commit removes the change boot order specific menu implementation. The change boot order implementation calls eficonfig_process_common() same as other menus. The change boot order menu requires own item_data_print and item_choice implementation, but display_statusline function can be a same function as other menus. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
cd160b27 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor eficonfig_process_common function Current change boot order implementation does not call eficonfig_process_common() and call own menu functions for display_statusline, item_data_print and item_choice. Change boot order functionality should call eficonfig_process_common() to improve maintenanceability. This commit is a preparation to remove the change boot order specific implementation. The menu functions (display_statusline, item_data_print and item_choice) are added as argument of eficonfig_process_common(). The menu description string displayed at the bottom of the menu is also added as argument. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
32bab0ea |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Make use of CLI character processing Avoid duplicating some of the escape-sequence processing here and use the CLI function instead. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
d0ca98db |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Update bootmenu_loop() to return the code Use the return value to save having to pass around a pointer. This also resolves any ambiguity about what *key contains when the function is called. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
2da4a15e |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Rename KEY_... to BKEY_... This enum values conflict with linux/input.h so rename them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
64550274 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: avoid SetVariable between GetNextVariableName calls The current code calls efi_set_variable_int() to delete the invalid boot option between calls to efi_get_next_variable_name_int(), it may produce unpredictable results. This commit moves removal of the invalid boot option outside of the efi_get_next_variable_name_int() calls. EFI_NOT_FOUND returned from efi_get_next_variable_name_int() indicates we retrieved all EFI variables, it should be treated as EFI_SUCEESS. To address the checkpatch warning of too many leading tabs, combine two if statement into one. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
ce327084 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: carve out efi_get_next_variable_name_int calls To retrieve the EFI variable name by efi_get_next_variable_name_int(), the sequence of alloc -> efi_get_next_variable_name_int -> realloc -> efi_get_next_variable_name_int is required. In current code, this sequence repeatedly appears in the several functions. It should be curved out a common function. This commit also fixes the missing free() of var_name16 in eficonfig_delete_invalid_boot_option(). Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
140a8959 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use efi_get_next_variable_name_int() eficonfig command reads all possible UEFI load options from 0x0000 to 0xFFFF to construct the menu. This takes too much time in some environment. This commit uses efi_get_next_variable_name_int() to read all existing UEFI load options to significantlly reduce the count of efi_get_var() call. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
78b1ccc4 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use u16_strsize() to get u16 string buffer size Use u16_strsize() to simplify the u16 string buffer size calculation. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c67d3c9e |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix going one directory up issue The directory name in eficonfig menu entry contains the '\' separator. strcmp() argument ".." is wrong and one directory up handling does not work correctly. strcmp() argument must include '\' separator. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c3b5af63 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add UEFI Secure Boot Key enrollment interface This commit adds the menu-driven UEFI Secure Boot Key enrollment interface. User can enroll PK, KEK, db and dbx by selecting file. Only the signed EFI Signature List(s) with an authenticated header, typically '.auth' file, is accepted. To clear the PK, KEK, db and dbx, user needs to enroll the null key signed by PK or KEK. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
21faf4ef |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use protocol interface for file selection EFI_SIMPLE_FILE_SYSTEM_PROTOCOL is not always provided by U-Boot. Use protocol interface functions instead of U-Boot internal functions. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d6566113 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose eficonfig_create_device_path() Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use eficonfig_create_device_path() to construct the full device path from device path of the volume and file path, so move it out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d571f9b2 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation All the eficonfig menus other than "Change Boot Order" use 'eficonfig_entry' structure for each menu entry. This commit refactors change boot order implementation to use 'eficonfig_entry' structure same as other menus to have consistent menu handling. This commit also simplifies the data->active handling when KEY_SPACE is pressed, and sizeof() parameter. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
8961e93e |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose append entry function Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use append_entry() and append_quit_entry() to construct the menu, so move them out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
a84040ab |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor file selection handling eficonfig_select_file_handler() is commonly used to select the file. eficonfig_display_select_file_option() adds an additional menu to clear the selected file. eficonfig_display_select_file_option() is not always necessary for the file selection process, so it must be outside of eficonfig_select_file_handler(). This commit also renames the following functions to avoid confusion. eficonfig_select_file_handler() -> eficonfig_process_select_file() eficonfig_select_file() -> eficonfig_show_file_selection() eficonfig_display_select_file_option() -> eficonfig_process_show_file_option() Finally, test_eficonfig.py need to be updated to get aligned with the above modification. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
1167e88a |
|
14-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix missing variable initialization The 'ret' variable must be initialized before use in eficonfig_delete_invalid_boot_option(). Fixes: c416f1c0bc ("bootmenu: add removable media entries") Addresses-Coverity: 376207 ("Uninitialized variables") Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
3d595ac5 |
|
09-Nov-2022 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: remove superfluous if in eficonfig_edit_boot_option Goto for an immediately succeeding label is superfluous. Fixes: 87d791423ac6 ("eficonfig: menu-driven addition of UEFI boot option") Addresses-Coverity: 376202 ("Identical code for different branches") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
9945bc4f |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Fix incorrect return code of boot option update Correct the return code for out-of-memory and no boot option found Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
339b527b |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Move bootorder and bootoption apis to lib Rename and move bootorder and bootoption apis from cmd to lib for re-use between eficonfig and bootmgr Fix 'unexpected indentation' when 'make htmldocs' after functions are moved Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
2c0b0c31 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_SECURE_BOOT This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_SECURE_BOOT defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
83f3d121 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_MM_COMM_TEE This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_MM_COMM_TEE defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
88df3634 |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: CTRL+S to save the boot order 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>
|
#
45f5319f |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
menu: remove CTRL+C to quit On the sandbox called without "--terminal raw" CTRL+C leaves U-Boot, "ESC/CTRL+C to quit" is misleading. Let's remove CTRL+C to quit key handling from bootmenu and eficonfig menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
|
#
8dbd0a0f |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add vertical scroll support The current eficonfig menu does not support vertical scroll, so it can not display the menu entries greater than the console row size. This commit add the vertial scroll support. The console size is retrieved by SIMPLE_TEXT_OUTPUT_PROTOCOL.QueryMode() service, then calculates the row size for menu entry by subtracting menu header and description row size from the console row size. "start" and "end" are added in the efimenu structure. "start" keeps the menu entry index at the top, "end" keeps the bottom menu entry index. item_data_print() menu function only draws the menu entry between "start" and "end". This commit also fixes the issue that "Save" and "Quit" entries can be moved by BKEY_PLUS in change boot order menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
0d590852 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation This commit removes the change boot order specific menu implementation. The change boot order implementation calls eficonfig_process_common() same as other menus. The change boot order menu requires own item_data_print and item_choice implementation, but display_statusline function can be a same function as other menus. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
cd160b27 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor eficonfig_process_common function Current change boot order implementation does not call eficonfig_process_common() and call own menu functions for display_statusline, item_data_print and item_choice. Change boot order functionality should call eficonfig_process_common() to improve maintenanceability. This commit is a preparation to remove the change boot order specific implementation. The menu functions (display_statusline, item_data_print and item_choice) are added as argument of eficonfig_process_common(). The menu description string displayed at the bottom of the menu is also added as argument. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
32bab0ea |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Make use of CLI character processing Avoid duplicating some of the escape-sequence processing here and use the CLI function instead. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
d0ca98db |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Update bootmenu_loop() to return the code Use the return value to save having to pass around a pointer. This also resolves any ambiguity about what *key contains when the function is called. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
2da4a15e |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Rename KEY_... to BKEY_... This enum values conflict with linux/input.h so rename them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
64550274 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: avoid SetVariable between GetNextVariableName calls The current code calls efi_set_variable_int() to delete the invalid boot option between calls to efi_get_next_variable_name_int(), it may produce unpredictable results. This commit moves removal of the invalid boot option outside of the efi_get_next_variable_name_int() calls. EFI_NOT_FOUND returned from efi_get_next_variable_name_int() indicates we retrieved all EFI variables, it should be treated as EFI_SUCEESS. To address the checkpatch warning of too many leading tabs, combine two if statement into one. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
ce327084 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: carve out efi_get_next_variable_name_int calls To retrieve the EFI variable name by efi_get_next_variable_name_int(), the sequence of alloc -> efi_get_next_variable_name_int -> realloc -> efi_get_next_variable_name_int is required. In current code, this sequence repeatedly appears in the several functions. It should be curved out a common function. This commit also fixes the missing free() of var_name16 in eficonfig_delete_invalid_boot_option(). Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
140a8959 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use efi_get_next_variable_name_int() eficonfig command reads all possible UEFI load options from 0x0000 to 0xFFFF to construct the menu. This takes too much time in some environment. This commit uses efi_get_next_variable_name_int() to read all existing UEFI load options to significantlly reduce the count of efi_get_var() call. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
78b1ccc4 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use u16_strsize() to get u16 string buffer size Use u16_strsize() to simplify the u16 string buffer size calculation. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c67d3c9e |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix going one directory up issue The directory name in eficonfig menu entry contains the '\' separator. strcmp() argument ".." is wrong and one directory up handling does not work correctly. strcmp() argument must include '\' separator. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c3b5af63 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add UEFI Secure Boot Key enrollment interface This commit adds the menu-driven UEFI Secure Boot Key enrollment interface. User can enroll PK, KEK, db and dbx by selecting file. Only the signed EFI Signature List(s) with an authenticated header, typically '.auth' file, is accepted. To clear the PK, KEK, db and dbx, user needs to enroll the null key signed by PK or KEK. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
21faf4ef |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use protocol interface for file selection EFI_SIMPLE_FILE_SYSTEM_PROTOCOL is not always provided by U-Boot. Use protocol interface functions instead of U-Boot internal functions. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d6566113 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose eficonfig_create_device_path() Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use eficonfig_create_device_path() to construct the full device path from device path of the volume and file path, so move it out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d571f9b2 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation All the eficonfig menus other than "Change Boot Order" use 'eficonfig_entry' structure for each menu entry. This commit refactors change boot order implementation to use 'eficonfig_entry' structure same as other menus to have consistent menu handling. This commit also simplifies the data->active handling when KEY_SPACE is pressed, and sizeof() parameter. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
8961e93e |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose append entry function Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use append_entry() and append_quit_entry() to construct the menu, so move them out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
a84040ab |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor file selection handling eficonfig_select_file_handler() is commonly used to select the file. eficonfig_display_select_file_option() adds an additional menu to clear the selected file. eficonfig_display_select_file_option() is not always necessary for the file selection process, so it must be outside of eficonfig_select_file_handler(). This commit also renames the following functions to avoid confusion. eficonfig_select_file_handler() -> eficonfig_process_select_file() eficonfig_select_file() -> eficonfig_show_file_selection() eficonfig_display_select_file_option() -> eficonfig_process_show_file_option() Finally, test_eficonfig.py need to be updated to get aligned with the above modification. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
1167e88a |
|
14-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix missing variable initialization The 'ret' variable must be initialized before use in eficonfig_delete_invalid_boot_option(). Fixes: c416f1c0bc ("bootmenu: add removable media entries") Addresses-Coverity: 376207 ("Uninitialized variables") Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
3d595ac5 |
|
09-Nov-2022 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: remove superfluous if in eficonfig_edit_boot_option Goto for an immediately succeeding label is superfluous. Fixes: 87d791423ac6 ("eficonfig: menu-driven addition of UEFI boot option") Addresses-Coverity: 376202 ("Identical code for different branches") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
9945bc4f |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Fix incorrect return code of boot option update Correct the return code for out-of-memory and no boot option found Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
339b527b |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Move bootorder and bootoption apis to lib Rename and move bootorder and bootoption apis from cmd to lib for re-use between eficonfig and bootmgr Fix 'unexpected indentation' when 'make htmldocs' after functions are moved Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
2c0b0c31 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_SECURE_BOOT This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_SECURE_BOOT defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
83f3d121 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_MM_COMM_TEE This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_MM_COMM_TEE defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
88df3634 |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: CTRL+S to save the boot order 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>
|
#
45f5319f |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
menu: remove CTRL+C to quit On the sandbox called without "--terminal raw" CTRL+C leaves U-Boot, "ESC/CTRL+C to quit" is misleading. Let's remove CTRL+C to quit key handling from bootmenu and eficonfig menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
|
#
8dbd0a0f |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add vertical scroll support The current eficonfig menu does not support vertical scroll, so it can not display the menu entries greater than the console row size. This commit add the vertial scroll support. The console size is retrieved by SIMPLE_TEXT_OUTPUT_PROTOCOL.QueryMode() service, then calculates the row size for menu entry by subtracting menu header and description row size from the console row size. "start" and "end" are added in the efimenu structure. "start" keeps the menu entry index at the top, "end" keeps the bottom menu entry index. item_data_print() menu function only draws the menu entry between "start" and "end". This commit also fixes the issue that "Save" and "Quit" entries can be moved by BKEY_PLUS in change boot order menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
0d590852 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation This commit removes the change boot order specific menu implementation. The change boot order implementation calls eficonfig_process_common() same as other menus. The change boot order menu requires own item_data_print and item_choice implementation, but display_statusline function can be a same function as other menus. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
cd160b27 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor eficonfig_process_common function Current change boot order implementation does not call eficonfig_process_common() and call own menu functions for display_statusline, item_data_print and item_choice. Change boot order functionality should call eficonfig_process_common() to improve maintenanceability. This commit is a preparation to remove the change boot order specific implementation. The menu functions (display_statusline, item_data_print and item_choice) are added as argument of eficonfig_process_common(). The menu description string displayed at the bottom of the menu is also added as argument. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
32bab0ea |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Make use of CLI character processing Avoid duplicating some of the escape-sequence processing here and use the CLI function instead. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
d0ca98db |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Update bootmenu_loop() to return the code Use the return value to save having to pass around a pointer. This also resolves any ambiguity about what *key contains when the function is called. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
2da4a15e |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Rename KEY_... to BKEY_... This enum values conflict with linux/input.h so rename them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
64550274 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: avoid SetVariable between GetNextVariableName calls The current code calls efi_set_variable_int() to delete the invalid boot option between calls to efi_get_next_variable_name_int(), it may produce unpredictable results. This commit moves removal of the invalid boot option outside of the efi_get_next_variable_name_int() calls. EFI_NOT_FOUND returned from efi_get_next_variable_name_int() indicates we retrieved all EFI variables, it should be treated as EFI_SUCEESS. To address the checkpatch warning of too many leading tabs, combine two if statement into one. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
ce327084 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: carve out efi_get_next_variable_name_int calls To retrieve the EFI variable name by efi_get_next_variable_name_int(), the sequence of alloc -> efi_get_next_variable_name_int -> realloc -> efi_get_next_variable_name_int is required. In current code, this sequence repeatedly appears in the several functions. It should be curved out a common function. This commit also fixes the missing free() of var_name16 in eficonfig_delete_invalid_boot_option(). Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
140a8959 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use efi_get_next_variable_name_int() eficonfig command reads all possible UEFI load options from 0x0000 to 0xFFFF to construct the menu. This takes too much time in some environment. This commit uses efi_get_next_variable_name_int() to read all existing UEFI load options to significantlly reduce the count of efi_get_var() call. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
78b1ccc4 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use u16_strsize() to get u16 string buffer size Use u16_strsize() to simplify the u16 string buffer size calculation. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c67d3c9e |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix going one directory up issue The directory name in eficonfig menu entry contains the '\' separator. strcmp() argument ".." is wrong and one directory up handling does not work correctly. strcmp() argument must include '\' separator. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c3b5af63 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add UEFI Secure Boot Key enrollment interface This commit adds the menu-driven UEFI Secure Boot Key enrollment interface. User can enroll PK, KEK, db and dbx by selecting file. Only the signed EFI Signature List(s) with an authenticated header, typically '.auth' file, is accepted. To clear the PK, KEK, db and dbx, user needs to enroll the null key signed by PK or KEK. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
21faf4ef |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use protocol interface for file selection EFI_SIMPLE_FILE_SYSTEM_PROTOCOL is not always provided by U-Boot. Use protocol interface functions instead of U-Boot internal functions. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d6566113 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose eficonfig_create_device_path() Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use eficonfig_create_device_path() to construct the full device path from device path of the volume and file path, so move it out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d571f9b2 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation All the eficonfig menus other than "Change Boot Order" use 'eficonfig_entry' structure for each menu entry. This commit refactors change boot order implementation to use 'eficonfig_entry' structure same as other menus to have consistent menu handling. This commit also simplifies the data->active handling when KEY_SPACE is pressed, and sizeof() parameter. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
8961e93e |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose append entry function Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use append_entry() and append_quit_entry() to construct the menu, so move them out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
a84040ab |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor file selection handling eficonfig_select_file_handler() is commonly used to select the file. eficonfig_display_select_file_option() adds an additional menu to clear the selected file. eficonfig_display_select_file_option() is not always necessary for the file selection process, so it must be outside of eficonfig_select_file_handler(). This commit also renames the following functions to avoid confusion. eficonfig_select_file_handler() -> eficonfig_process_select_file() eficonfig_select_file() -> eficonfig_show_file_selection() eficonfig_display_select_file_option() -> eficonfig_process_show_file_option() Finally, test_eficonfig.py need to be updated to get aligned with the above modification. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
1167e88a |
|
14-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix missing variable initialization The 'ret' variable must be initialized before use in eficonfig_delete_invalid_boot_option(). Fixes: c416f1c0bc ("bootmenu: add removable media entries") Addresses-Coverity: 376207 ("Uninitialized variables") Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
3d595ac5 |
|
09-Nov-2022 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: remove superfluous if in eficonfig_edit_boot_option Goto for an immediately succeeding label is superfluous. Fixes: 87d791423ac6 ("eficonfig: menu-driven addition of UEFI boot option") Addresses-Coverity: 376202 ("Identical code for different branches") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
9945bc4f |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Fix incorrect return code of boot option update Correct the return code for out-of-memory and no boot option found Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
339b527b |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Move bootorder and bootoption apis to lib Rename and move bootorder and bootoption apis from cmd to lib for re-use between eficonfig and bootmgr Fix 'unexpected indentation' when 'make htmldocs' after functions are moved Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
2c0b0c31 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_SECURE_BOOT This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_SECURE_BOOT defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
83f3d121 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_MM_COMM_TEE This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_MM_COMM_TEE defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
88df3634 |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: CTRL+S to save the boot order 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>
|
#
45f5319f |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
menu: remove CTRL+C to quit On the sandbox called without "--terminal raw" CTRL+C leaves U-Boot, "ESC/CTRL+C to quit" is misleading. Let's remove CTRL+C to quit key handling from bootmenu and eficonfig menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
|
#
8dbd0a0f |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add vertical scroll support The current eficonfig menu does not support vertical scroll, so it can not display the menu entries greater than the console row size. This commit add the vertial scroll support. The console size is retrieved by SIMPLE_TEXT_OUTPUT_PROTOCOL.QueryMode() service, then calculates the row size for menu entry by subtracting menu header and description row size from the console row size. "start" and "end" are added in the efimenu structure. "start" keeps the menu entry index at the top, "end" keeps the bottom menu entry index. item_data_print() menu function only draws the menu entry between "start" and "end". This commit also fixes the issue that "Save" and "Quit" entries can be moved by BKEY_PLUS in change boot order menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
0d590852 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation This commit removes the change boot order specific menu implementation. The change boot order implementation calls eficonfig_process_common() same as other menus. The change boot order menu requires own item_data_print and item_choice implementation, but display_statusline function can be a same function as other menus. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
cd160b27 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor eficonfig_process_common function Current change boot order implementation does not call eficonfig_process_common() and call own menu functions for display_statusline, item_data_print and item_choice. Change boot order functionality should call eficonfig_process_common() to improve maintenanceability. This commit is a preparation to remove the change boot order specific implementation. The menu functions (display_statusline, item_data_print and item_choice) are added as argument of eficonfig_process_common(). The menu description string displayed at the bottom of the menu is also added as argument. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
32bab0ea |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Make use of CLI character processing Avoid duplicating some of the escape-sequence processing here and use the CLI function instead. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
d0ca98db |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Update bootmenu_loop() to return the code Use the return value to save having to pass around a pointer. This also resolves any ambiguity about what *key contains when the function is called. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
2da4a15e |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Rename KEY_... to BKEY_... This enum values conflict with linux/input.h so rename them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
64550274 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: avoid SetVariable between GetNextVariableName calls The current code calls efi_set_variable_int() to delete the invalid boot option between calls to efi_get_next_variable_name_int(), it may produce unpredictable results. This commit moves removal of the invalid boot option outside of the efi_get_next_variable_name_int() calls. EFI_NOT_FOUND returned from efi_get_next_variable_name_int() indicates we retrieved all EFI variables, it should be treated as EFI_SUCEESS. To address the checkpatch warning of too many leading tabs, combine two if statement into one. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
ce327084 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: carve out efi_get_next_variable_name_int calls To retrieve the EFI variable name by efi_get_next_variable_name_int(), the sequence of alloc -> efi_get_next_variable_name_int -> realloc -> efi_get_next_variable_name_int is required. In current code, this sequence repeatedly appears in the several functions. It should be curved out a common function. This commit also fixes the missing free() of var_name16 in eficonfig_delete_invalid_boot_option(). Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
140a8959 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use efi_get_next_variable_name_int() eficonfig command reads all possible UEFI load options from 0x0000 to 0xFFFF to construct the menu. This takes too much time in some environment. This commit uses efi_get_next_variable_name_int() to read all existing UEFI load options to significantlly reduce the count of efi_get_var() call. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
78b1ccc4 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use u16_strsize() to get u16 string buffer size Use u16_strsize() to simplify the u16 string buffer size calculation. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c67d3c9e |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix going one directory up issue The directory name in eficonfig menu entry contains the '\' separator. strcmp() argument ".." is wrong and one directory up handling does not work correctly. strcmp() argument must include '\' separator. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c3b5af63 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add UEFI Secure Boot Key enrollment interface This commit adds the menu-driven UEFI Secure Boot Key enrollment interface. User can enroll PK, KEK, db and dbx by selecting file. Only the signed EFI Signature List(s) with an authenticated header, typically '.auth' file, is accepted. To clear the PK, KEK, db and dbx, user needs to enroll the null key signed by PK or KEK. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
21faf4ef |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use protocol interface for file selection EFI_SIMPLE_FILE_SYSTEM_PROTOCOL is not always provided by U-Boot. Use protocol interface functions instead of U-Boot internal functions. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d6566113 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose eficonfig_create_device_path() Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use eficonfig_create_device_path() to construct the full device path from device path of the volume and file path, so move it out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d571f9b2 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation All the eficonfig menus other than "Change Boot Order" use 'eficonfig_entry' structure for each menu entry. This commit refactors change boot order implementation to use 'eficonfig_entry' structure same as other menus to have consistent menu handling. This commit also simplifies the data->active handling when KEY_SPACE is pressed, and sizeof() parameter. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
8961e93e |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose append entry function Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use append_entry() and append_quit_entry() to construct the menu, so move them out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
a84040ab |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor file selection handling eficonfig_select_file_handler() is commonly used to select the file. eficonfig_display_select_file_option() adds an additional menu to clear the selected file. eficonfig_display_select_file_option() is not always necessary for the file selection process, so it must be outside of eficonfig_select_file_handler(). This commit also renames the following functions to avoid confusion. eficonfig_select_file_handler() -> eficonfig_process_select_file() eficonfig_select_file() -> eficonfig_show_file_selection() eficonfig_display_select_file_option() -> eficonfig_process_show_file_option() Finally, test_eficonfig.py need to be updated to get aligned with the above modification. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
1167e88a |
|
14-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix missing variable initialization The 'ret' variable must be initialized before use in eficonfig_delete_invalid_boot_option(). Fixes: c416f1c0bc ("bootmenu: add removable media entries") Addresses-Coverity: 376207 ("Uninitialized variables") Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
3d595ac5 |
|
09-Nov-2022 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: remove superfluous if in eficonfig_edit_boot_option Goto for an immediately succeeding label is superfluous. Fixes: 87d791423ac6 ("eficonfig: menu-driven addition of UEFI boot option") Addresses-Coverity: 376202 ("Identical code for different branches") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
9945bc4f |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Fix incorrect return code of boot option update Correct the return code for out-of-memory and no boot option found Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
339b527b |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Move bootorder and bootoption apis to lib Rename and move bootorder and bootoption apis from cmd to lib for re-use between eficonfig and bootmgr Fix 'unexpected indentation' when 'make htmldocs' after functions are moved Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
2c0b0c31 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_SECURE_BOOT This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_SECURE_BOOT defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
83f3d121 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_MM_COMM_TEE This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_MM_COMM_TEE defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
88df3634 |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: CTRL+S to save the boot order 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>
|
#
45f5319f |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
menu: remove CTRL+C to quit On the sandbox called without "--terminal raw" CTRL+C leaves U-Boot, "ESC/CTRL+C to quit" is misleading. Let's remove CTRL+C to quit key handling from bootmenu and eficonfig menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
|
#
8dbd0a0f |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add vertical scroll support The current eficonfig menu does not support vertical scroll, so it can not display the menu entries greater than the console row size. This commit add the vertial scroll support. The console size is retrieved by SIMPLE_TEXT_OUTPUT_PROTOCOL.QueryMode() service, then calculates the row size for menu entry by subtracting menu header and description row size from the console row size. "start" and "end" are added in the efimenu structure. "start" keeps the menu entry index at the top, "end" keeps the bottom menu entry index. item_data_print() menu function only draws the menu entry between "start" and "end". This commit also fixes the issue that "Save" and "Quit" entries can be moved by BKEY_PLUS in change boot order menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
0d590852 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation This commit removes the change boot order specific menu implementation. The change boot order implementation calls eficonfig_process_common() same as other menus. The change boot order menu requires own item_data_print and item_choice implementation, but display_statusline function can be a same function as other menus. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
cd160b27 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor eficonfig_process_common function Current change boot order implementation does not call eficonfig_process_common() and call own menu functions for display_statusline, item_data_print and item_choice. Change boot order functionality should call eficonfig_process_common() to improve maintenanceability. This commit is a preparation to remove the change boot order specific implementation. The menu functions (display_statusline, item_data_print and item_choice) are added as argument of eficonfig_process_common(). The menu description string displayed at the bottom of the menu is also added as argument. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
32bab0ea |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Make use of CLI character processing Avoid duplicating some of the escape-sequence processing here and use the CLI function instead. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
d0ca98db |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Update bootmenu_loop() to return the code Use the return value to save having to pass around a pointer. This also resolves any ambiguity about what *key contains when the function is called. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
2da4a15e |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Rename KEY_... to BKEY_... This enum values conflict with linux/input.h so rename them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
64550274 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: avoid SetVariable between GetNextVariableName calls The current code calls efi_set_variable_int() to delete the invalid boot option between calls to efi_get_next_variable_name_int(), it may produce unpredictable results. This commit moves removal of the invalid boot option outside of the efi_get_next_variable_name_int() calls. EFI_NOT_FOUND returned from efi_get_next_variable_name_int() indicates we retrieved all EFI variables, it should be treated as EFI_SUCEESS. To address the checkpatch warning of too many leading tabs, combine two if statement into one. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
ce327084 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: carve out efi_get_next_variable_name_int calls To retrieve the EFI variable name by efi_get_next_variable_name_int(), the sequence of alloc -> efi_get_next_variable_name_int -> realloc -> efi_get_next_variable_name_int is required. In current code, this sequence repeatedly appears in the several functions. It should be curved out a common function. This commit also fixes the missing free() of var_name16 in eficonfig_delete_invalid_boot_option(). Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
140a8959 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use efi_get_next_variable_name_int() eficonfig command reads all possible UEFI load options from 0x0000 to 0xFFFF to construct the menu. This takes too much time in some environment. This commit uses efi_get_next_variable_name_int() to read all existing UEFI load options to significantlly reduce the count of efi_get_var() call. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
78b1ccc4 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use u16_strsize() to get u16 string buffer size Use u16_strsize() to simplify the u16 string buffer size calculation. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c67d3c9e |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix going one directory up issue The directory name in eficonfig menu entry contains the '\' separator. strcmp() argument ".." is wrong and one directory up handling does not work correctly. strcmp() argument must include '\' separator. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c3b5af63 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add UEFI Secure Boot Key enrollment interface This commit adds the menu-driven UEFI Secure Boot Key enrollment interface. User can enroll PK, KEK, db and dbx by selecting file. Only the signed EFI Signature List(s) with an authenticated header, typically '.auth' file, is accepted. To clear the PK, KEK, db and dbx, user needs to enroll the null key signed by PK or KEK. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
21faf4ef |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use protocol interface for file selection EFI_SIMPLE_FILE_SYSTEM_PROTOCOL is not always provided by U-Boot. Use protocol interface functions instead of U-Boot internal functions. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d6566113 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose eficonfig_create_device_path() Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use eficonfig_create_device_path() to construct the full device path from device path of the volume and file path, so move it out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d571f9b2 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation All the eficonfig menus other than "Change Boot Order" use 'eficonfig_entry' structure for each menu entry. This commit refactors change boot order implementation to use 'eficonfig_entry' structure same as other menus to have consistent menu handling. This commit also simplifies the data->active handling when KEY_SPACE is pressed, and sizeof() parameter. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
8961e93e |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose append entry function Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use append_entry() and append_quit_entry() to construct the menu, so move them out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
a84040ab |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor file selection handling eficonfig_select_file_handler() is commonly used to select the file. eficonfig_display_select_file_option() adds an additional menu to clear the selected file. eficonfig_display_select_file_option() is not always necessary for the file selection process, so it must be outside of eficonfig_select_file_handler(). This commit also renames the following functions to avoid confusion. eficonfig_select_file_handler() -> eficonfig_process_select_file() eficonfig_select_file() -> eficonfig_show_file_selection() eficonfig_display_select_file_option() -> eficonfig_process_show_file_option() Finally, test_eficonfig.py need to be updated to get aligned with the above modification. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
1167e88a |
|
14-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix missing variable initialization The 'ret' variable must be initialized before use in eficonfig_delete_invalid_boot_option(). Fixes: c416f1c0bc ("bootmenu: add removable media entries") Addresses-Coverity: 376207 ("Uninitialized variables") Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
3d595ac5 |
|
09-Nov-2022 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: remove superfluous if in eficonfig_edit_boot_option Goto for an immediately succeeding label is superfluous. Fixes: 87d791423ac6 ("eficonfig: menu-driven addition of UEFI boot option") Addresses-Coverity: 376202 ("Identical code for different branches") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
9945bc4f |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Fix incorrect return code of boot option update Correct the return code for out-of-memory and no boot option found Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
339b527b |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Move bootorder and bootoption apis to lib Rename and move bootorder and bootoption apis from cmd to lib for re-use between eficonfig and bootmgr Fix 'unexpected indentation' when 'make htmldocs' after functions are moved Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
2c0b0c31 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_SECURE_BOOT This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_SECURE_BOOT defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
83f3d121 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_MM_COMM_TEE This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_MM_COMM_TEE defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
88df3634 |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: CTRL+S to save the boot order 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>
|
#
45f5319f |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
menu: remove CTRL+C to quit On the sandbox called without "--terminal raw" CTRL+C leaves U-Boot, "ESC/CTRL+C to quit" is misleading. Let's remove CTRL+C to quit key handling from bootmenu and eficonfig menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
|
#
8dbd0a0f |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add vertical scroll support The current eficonfig menu does not support vertical scroll, so it can not display the menu entries greater than the console row size. This commit add the vertial scroll support. The console size is retrieved by SIMPLE_TEXT_OUTPUT_PROTOCOL.QueryMode() service, then calculates the row size for menu entry by subtracting menu header and description row size from the console row size. "start" and "end" are added in the efimenu structure. "start" keeps the menu entry index at the top, "end" keeps the bottom menu entry index. item_data_print() menu function only draws the menu entry between "start" and "end". This commit also fixes the issue that "Save" and "Quit" entries can be moved by BKEY_PLUS in change boot order menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
0d590852 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation This commit removes the change boot order specific menu implementation. The change boot order implementation calls eficonfig_process_common() same as other menus. The change boot order menu requires own item_data_print and item_choice implementation, but display_statusline function can be a same function as other menus. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
cd160b27 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor eficonfig_process_common function Current change boot order implementation does not call eficonfig_process_common() and call own menu functions for display_statusline, item_data_print and item_choice. Change boot order functionality should call eficonfig_process_common() to improve maintenanceability. This commit is a preparation to remove the change boot order specific implementation. The menu functions (display_statusline, item_data_print and item_choice) are added as argument of eficonfig_process_common(). The menu description string displayed at the bottom of the menu is also added as argument. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
32bab0ea |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Make use of CLI character processing Avoid duplicating some of the escape-sequence processing here and use the CLI function instead. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
d0ca98db |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Update bootmenu_loop() to return the code Use the return value to save having to pass around a pointer. This also resolves any ambiguity about what *key contains when the function is called. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
2da4a15e |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Rename KEY_... to BKEY_... This enum values conflict with linux/input.h so rename them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
64550274 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: avoid SetVariable between GetNextVariableName calls The current code calls efi_set_variable_int() to delete the invalid boot option between calls to efi_get_next_variable_name_int(), it may produce unpredictable results. This commit moves removal of the invalid boot option outside of the efi_get_next_variable_name_int() calls. EFI_NOT_FOUND returned from efi_get_next_variable_name_int() indicates we retrieved all EFI variables, it should be treated as EFI_SUCEESS. To address the checkpatch warning of too many leading tabs, combine two if statement into one. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
ce327084 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: carve out efi_get_next_variable_name_int calls To retrieve the EFI variable name by efi_get_next_variable_name_int(), the sequence of alloc -> efi_get_next_variable_name_int -> realloc -> efi_get_next_variable_name_int is required. In current code, this sequence repeatedly appears in the several functions. It should be curved out a common function. This commit also fixes the missing free() of var_name16 in eficonfig_delete_invalid_boot_option(). Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
140a8959 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use efi_get_next_variable_name_int() eficonfig command reads all possible UEFI load options from 0x0000 to 0xFFFF to construct the menu. This takes too much time in some environment. This commit uses efi_get_next_variable_name_int() to read all existing UEFI load options to significantlly reduce the count of efi_get_var() call. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
78b1ccc4 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use u16_strsize() to get u16 string buffer size Use u16_strsize() to simplify the u16 string buffer size calculation. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c67d3c9e |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix going one directory up issue The directory name in eficonfig menu entry contains the '\' separator. strcmp() argument ".." is wrong and one directory up handling does not work correctly. strcmp() argument must include '\' separator. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c3b5af63 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add UEFI Secure Boot Key enrollment interface This commit adds the menu-driven UEFI Secure Boot Key enrollment interface. User can enroll PK, KEK, db and dbx by selecting file. Only the signed EFI Signature List(s) with an authenticated header, typically '.auth' file, is accepted. To clear the PK, KEK, db and dbx, user needs to enroll the null key signed by PK or KEK. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
21faf4ef |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use protocol interface for file selection EFI_SIMPLE_FILE_SYSTEM_PROTOCOL is not always provided by U-Boot. Use protocol interface functions instead of U-Boot internal functions. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d6566113 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose eficonfig_create_device_path() Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use eficonfig_create_device_path() to construct the full device path from device path of the volume and file path, so move it out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d571f9b2 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation All the eficonfig menus other than "Change Boot Order" use 'eficonfig_entry' structure for each menu entry. This commit refactors change boot order implementation to use 'eficonfig_entry' structure same as other menus to have consistent menu handling. This commit also simplifies the data->active handling when KEY_SPACE is pressed, and sizeof() parameter. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
8961e93e |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose append entry function Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use append_entry() and append_quit_entry() to construct the menu, so move them out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
a84040ab |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor file selection handling eficonfig_select_file_handler() is commonly used to select the file. eficonfig_display_select_file_option() adds an additional menu to clear the selected file. eficonfig_display_select_file_option() is not always necessary for the file selection process, so it must be outside of eficonfig_select_file_handler(). This commit also renames the following functions to avoid confusion. eficonfig_select_file_handler() -> eficonfig_process_select_file() eficonfig_select_file() -> eficonfig_show_file_selection() eficonfig_display_select_file_option() -> eficonfig_process_show_file_option() Finally, test_eficonfig.py need to be updated to get aligned with the above modification. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
1167e88a |
|
14-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix missing variable initialization The 'ret' variable must be initialized before use in eficonfig_delete_invalid_boot_option(). Fixes: c416f1c0bc ("bootmenu: add removable media entries") Addresses-Coverity: 376207 ("Uninitialized variables") Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
3d595ac5 |
|
09-Nov-2022 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: remove superfluous if in eficonfig_edit_boot_option Goto for an immediately succeeding label is superfluous. Fixes: 87d791423ac6 ("eficonfig: menu-driven addition of UEFI boot option") Addresses-Coverity: 376202 ("Identical code for different branches") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
9945bc4f |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Fix incorrect return code of boot option update Correct the return code for out-of-memory and no boot option found Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
339b527b |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Move bootorder and bootoption apis to lib Rename and move bootorder and bootoption apis from cmd to lib for re-use between eficonfig and bootmgr Fix 'unexpected indentation' when 'make htmldocs' after functions are moved Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
2c0b0c31 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_SECURE_BOOT This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_SECURE_BOOT defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
83f3d121 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_MM_COMM_TEE This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_MM_COMM_TEE defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
88df3634 |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: CTRL+S to save the boot order 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>
|
#
45f5319f |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
menu: remove CTRL+C to quit On the sandbox called without "--terminal raw" CTRL+C leaves U-Boot, "ESC/CTRL+C to quit" is misleading. Let's remove CTRL+C to quit key handling from bootmenu and eficonfig menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
|
#
8dbd0a0f |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add vertical scroll support The current eficonfig menu does not support vertical scroll, so it can not display the menu entries greater than the console row size. This commit add the vertial scroll support. The console size is retrieved by SIMPLE_TEXT_OUTPUT_PROTOCOL.QueryMode() service, then calculates the row size for menu entry by subtracting menu header and description row size from the console row size. "start" and "end" are added in the efimenu structure. "start" keeps the menu entry index at the top, "end" keeps the bottom menu entry index. item_data_print() menu function only draws the menu entry between "start" and "end". This commit also fixes the issue that "Save" and "Quit" entries can be moved by BKEY_PLUS in change boot order menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
0d590852 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation This commit removes the change boot order specific menu implementation. The change boot order implementation calls eficonfig_process_common() same as other menus. The change boot order menu requires own item_data_print and item_choice implementation, but display_statusline function can be a same function as other menus. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
cd160b27 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor eficonfig_process_common function Current change boot order implementation does not call eficonfig_process_common() and call own menu functions for display_statusline, item_data_print and item_choice. Change boot order functionality should call eficonfig_process_common() to improve maintenanceability. This commit is a preparation to remove the change boot order specific implementation. The menu functions (display_statusline, item_data_print and item_choice) are added as argument of eficonfig_process_common(). The menu description string displayed at the bottom of the menu is also added as argument. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
32bab0ea |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Make use of CLI character processing Avoid duplicating some of the escape-sequence processing here and use the CLI function instead. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
d0ca98db |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Update bootmenu_loop() to return the code Use the return value to save having to pass around a pointer. This also resolves any ambiguity about what *key contains when the function is called. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
2da4a15e |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Rename KEY_... to BKEY_... This enum values conflict with linux/input.h so rename them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
64550274 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: avoid SetVariable between GetNextVariableName calls The current code calls efi_set_variable_int() to delete the invalid boot option between calls to efi_get_next_variable_name_int(), it may produce unpredictable results. This commit moves removal of the invalid boot option outside of the efi_get_next_variable_name_int() calls. EFI_NOT_FOUND returned from efi_get_next_variable_name_int() indicates we retrieved all EFI variables, it should be treated as EFI_SUCEESS. To address the checkpatch warning of too many leading tabs, combine two if statement into one. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
ce327084 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: carve out efi_get_next_variable_name_int calls To retrieve the EFI variable name by efi_get_next_variable_name_int(), the sequence of alloc -> efi_get_next_variable_name_int -> realloc -> efi_get_next_variable_name_int is required. In current code, this sequence repeatedly appears in the several functions. It should be curved out a common function. This commit also fixes the missing free() of var_name16 in eficonfig_delete_invalid_boot_option(). Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
140a8959 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use efi_get_next_variable_name_int() eficonfig command reads all possible UEFI load options from 0x0000 to 0xFFFF to construct the menu. This takes too much time in some environment. This commit uses efi_get_next_variable_name_int() to read all existing UEFI load options to significantlly reduce the count of efi_get_var() call. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
78b1ccc4 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use u16_strsize() to get u16 string buffer size Use u16_strsize() to simplify the u16 string buffer size calculation. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c67d3c9e |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix going one directory up issue The directory name in eficonfig menu entry contains the '\' separator. strcmp() argument ".." is wrong and one directory up handling does not work correctly. strcmp() argument must include '\' separator. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c3b5af63 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add UEFI Secure Boot Key enrollment interface This commit adds the menu-driven UEFI Secure Boot Key enrollment interface. User can enroll PK, KEK, db and dbx by selecting file. Only the signed EFI Signature List(s) with an authenticated header, typically '.auth' file, is accepted. To clear the PK, KEK, db and dbx, user needs to enroll the null key signed by PK or KEK. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
21faf4ef |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use protocol interface for file selection EFI_SIMPLE_FILE_SYSTEM_PROTOCOL is not always provided by U-Boot. Use protocol interface functions instead of U-Boot internal functions. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d6566113 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose eficonfig_create_device_path() Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use eficonfig_create_device_path() to construct the full device path from device path of the volume and file path, so move it out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d571f9b2 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation All the eficonfig menus other than "Change Boot Order" use 'eficonfig_entry' structure for each menu entry. This commit refactors change boot order implementation to use 'eficonfig_entry' structure same as other menus to have consistent menu handling. This commit also simplifies the data->active handling when KEY_SPACE is pressed, and sizeof() parameter. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
8961e93e |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose append entry function Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use append_entry() and append_quit_entry() to construct the menu, so move them out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
a84040ab |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor file selection handling eficonfig_select_file_handler() is commonly used to select the file. eficonfig_display_select_file_option() adds an additional menu to clear the selected file. eficonfig_display_select_file_option() is not always necessary for the file selection process, so it must be outside of eficonfig_select_file_handler(). This commit also renames the following functions to avoid confusion. eficonfig_select_file_handler() -> eficonfig_process_select_file() eficonfig_select_file() -> eficonfig_show_file_selection() eficonfig_display_select_file_option() -> eficonfig_process_show_file_option() Finally, test_eficonfig.py need to be updated to get aligned with the above modification. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
1167e88a |
|
14-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix missing variable initialization The 'ret' variable must be initialized before use in eficonfig_delete_invalid_boot_option(). Fixes: c416f1c0bc ("bootmenu: add removable media entries") Addresses-Coverity: 376207 ("Uninitialized variables") Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
3d595ac5 |
|
09-Nov-2022 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: remove superfluous if in eficonfig_edit_boot_option Goto for an immediately succeeding label is superfluous. Fixes: 87d791423ac6 ("eficonfig: menu-driven addition of UEFI boot option") Addresses-Coverity: 376202 ("Identical code for different branches") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
9945bc4f |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Fix incorrect return code of boot option update Correct the return code for out-of-memory and no boot option found Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
339b527b |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Move bootorder and bootoption apis to lib Rename and move bootorder and bootoption apis from cmd to lib for re-use between eficonfig and bootmgr Fix 'unexpected indentation' when 'make htmldocs' after functions are moved Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
2c0b0c31 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_SECURE_BOOT This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_SECURE_BOOT defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
83f3d121 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_MM_COMM_TEE This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_MM_COMM_TEE defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
88df3634 |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: CTRL+S to save the boot order 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>
|
#
45f5319f |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
menu: remove CTRL+C to quit On the sandbox called without "--terminal raw" CTRL+C leaves U-Boot, "ESC/CTRL+C to quit" is misleading. Let's remove CTRL+C to quit key handling from bootmenu and eficonfig menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
|
#
8dbd0a0f |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add vertical scroll support The current eficonfig menu does not support vertical scroll, so it can not display the menu entries greater than the console row size. This commit add the vertial scroll support. The console size is retrieved by SIMPLE_TEXT_OUTPUT_PROTOCOL.QueryMode() service, then calculates the row size for menu entry by subtracting menu header and description row size from the console row size. "start" and "end" are added in the efimenu structure. "start" keeps the menu entry index at the top, "end" keeps the bottom menu entry index. item_data_print() menu function only draws the menu entry between "start" and "end". This commit also fixes the issue that "Save" and "Quit" entries can be moved by BKEY_PLUS in change boot order menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
0d590852 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation This commit removes the change boot order specific menu implementation. The change boot order implementation calls eficonfig_process_common() same as other menus. The change boot order menu requires own item_data_print and item_choice implementation, but display_statusline function can be a same function as other menus. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
cd160b27 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor eficonfig_process_common function Current change boot order implementation does not call eficonfig_process_common() and call own menu functions for display_statusline, item_data_print and item_choice. Change boot order functionality should call eficonfig_process_common() to improve maintenanceability. This commit is a preparation to remove the change boot order specific implementation. The menu functions (display_statusline, item_data_print and item_choice) are added as argument of eficonfig_process_common(). The menu description string displayed at the bottom of the menu is also added as argument. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
32bab0ea |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Make use of CLI character processing Avoid duplicating some of the escape-sequence processing here and use the CLI function instead. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
d0ca98db |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Update bootmenu_loop() to return the code Use the return value to save having to pass around a pointer. This also resolves any ambiguity about what *key contains when the function is called. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
2da4a15e |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Rename KEY_... to BKEY_... This enum values conflict with linux/input.h so rename them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
64550274 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: avoid SetVariable between GetNextVariableName calls The current code calls efi_set_variable_int() to delete the invalid boot option between calls to efi_get_next_variable_name_int(), it may produce unpredictable results. This commit moves removal of the invalid boot option outside of the efi_get_next_variable_name_int() calls. EFI_NOT_FOUND returned from efi_get_next_variable_name_int() indicates we retrieved all EFI variables, it should be treated as EFI_SUCEESS. To address the checkpatch warning of too many leading tabs, combine two if statement into one. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
ce327084 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: carve out efi_get_next_variable_name_int calls To retrieve the EFI variable name by efi_get_next_variable_name_int(), the sequence of alloc -> efi_get_next_variable_name_int -> realloc -> efi_get_next_variable_name_int is required. In current code, this sequence repeatedly appears in the several functions. It should be curved out a common function. This commit also fixes the missing free() of var_name16 in eficonfig_delete_invalid_boot_option(). Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
140a8959 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use efi_get_next_variable_name_int() eficonfig command reads all possible UEFI load options from 0x0000 to 0xFFFF to construct the menu. This takes too much time in some environment. This commit uses efi_get_next_variable_name_int() to read all existing UEFI load options to significantlly reduce the count of efi_get_var() call. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
78b1ccc4 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use u16_strsize() to get u16 string buffer size Use u16_strsize() to simplify the u16 string buffer size calculation. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c67d3c9e |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix going one directory up issue The directory name in eficonfig menu entry contains the '\' separator. strcmp() argument ".." is wrong and one directory up handling does not work correctly. strcmp() argument must include '\' separator. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c3b5af63 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add UEFI Secure Boot Key enrollment interface This commit adds the menu-driven UEFI Secure Boot Key enrollment interface. User can enroll PK, KEK, db and dbx by selecting file. Only the signed EFI Signature List(s) with an authenticated header, typically '.auth' file, is accepted. To clear the PK, KEK, db and dbx, user needs to enroll the null key signed by PK or KEK. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
21faf4ef |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use protocol interface for file selection EFI_SIMPLE_FILE_SYSTEM_PROTOCOL is not always provided by U-Boot. Use protocol interface functions instead of U-Boot internal functions. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d6566113 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose eficonfig_create_device_path() Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use eficonfig_create_device_path() to construct the full device path from device path of the volume and file path, so move it out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d571f9b2 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation All the eficonfig menus other than "Change Boot Order" use 'eficonfig_entry' structure for each menu entry. This commit refactors change boot order implementation to use 'eficonfig_entry' structure same as other menus to have consistent menu handling. This commit also simplifies the data->active handling when KEY_SPACE is pressed, and sizeof() parameter. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
8961e93e |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose append entry function Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use append_entry() and append_quit_entry() to construct the menu, so move them out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
a84040ab |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor file selection handling eficonfig_select_file_handler() is commonly used to select the file. eficonfig_display_select_file_option() adds an additional menu to clear the selected file. eficonfig_display_select_file_option() is not always necessary for the file selection process, so it must be outside of eficonfig_select_file_handler(). This commit also renames the following functions to avoid confusion. eficonfig_select_file_handler() -> eficonfig_process_select_file() eficonfig_select_file() -> eficonfig_show_file_selection() eficonfig_display_select_file_option() -> eficonfig_process_show_file_option() Finally, test_eficonfig.py need to be updated to get aligned with the above modification. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
1167e88a |
|
14-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix missing variable initialization The 'ret' variable must be initialized before use in eficonfig_delete_invalid_boot_option(). Fixes: c416f1c0bc ("bootmenu: add removable media entries") Addresses-Coverity: 376207 ("Uninitialized variables") Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
3d595ac5 |
|
09-Nov-2022 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: remove superfluous if in eficonfig_edit_boot_option Goto for an immediately succeeding label is superfluous. Fixes: 87d791423ac6 ("eficonfig: menu-driven addition of UEFI boot option") Addresses-Coverity: 376202 ("Identical code for different branches") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
9945bc4f |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Fix incorrect return code of boot option update Correct the return code for out-of-memory and no boot option found Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
339b527b |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Move bootorder and bootoption apis to lib Rename and move bootorder and bootoption apis from cmd to lib for re-use between eficonfig and bootmgr Fix 'unexpected indentation' when 'make htmldocs' after functions are moved Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
2c0b0c31 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_SECURE_BOOT This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_SECURE_BOOT defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
83f3d121 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_MM_COMM_TEE This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_MM_COMM_TEE defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
88df3634 |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: CTRL+S to save the boot order 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>
|
#
45f5319f |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
menu: remove CTRL+C to quit On the sandbox called without "--terminal raw" CTRL+C leaves U-Boot, "ESC/CTRL+C to quit" is misleading. Let's remove CTRL+C to quit key handling from bootmenu and eficonfig menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
|
#
8dbd0a0f |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add vertical scroll support The current eficonfig menu does not support vertical scroll, so it can not display the menu entries greater than the console row size. This commit add the vertial scroll support. The console size is retrieved by SIMPLE_TEXT_OUTPUT_PROTOCOL.QueryMode() service, then calculates the row size for menu entry by subtracting menu header and description row size from the console row size. "start" and "end" are added in the efimenu structure. "start" keeps the menu entry index at the top, "end" keeps the bottom menu entry index. item_data_print() menu function only draws the menu entry between "start" and "end". This commit also fixes the issue that "Save" and "Quit" entries can be moved by BKEY_PLUS in change boot order menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
0d590852 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation This commit removes the change boot order specific menu implementation. The change boot order implementation calls eficonfig_process_common() same as other menus. The change boot order menu requires own item_data_print and item_choice implementation, but display_statusline function can be a same function as other menus. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
cd160b27 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor eficonfig_process_common function Current change boot order implementation does not call eficonfig_process_common() and call own menu functions for display_statusline, item_data_print and item_choice. Change boot order functionality should call eficonfig_process_common() to improve maintenanceability. This commit is a preparation to remove the change boot order specific implementation. The menu functions (display_statusline, item_data_print and item_choice) are added as argument of eficonfig_process_common(). The menu description string displayed at the bottom of the menu is also added as argument. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
32bab0ea |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Make use of CLI character processing Avoid duplicating some of the escape-sequence processing here and use the CLI function instead. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
d0ca98db |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Update bootmenu_loop() to return the code Use the return value to save having to pass around a pointer. This also resolves any ambiguity about what *key contains when the function is called. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
2da4a15e |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Rename KEY_... to BKEY_... This enum values conflict with linux/input.h so rename them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
64550274 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: avoid SetVariable between GetNextVariableName calls The current code calls efi_set_variable_int() to delete the invalid boot option between calls to efi_get_next_variable_name_int(), it may produce unpredictable results. This commit moves removal of the invalid boot option outside of the efi_get_next_variable_name_int() calls. EFI_NOT_FOUND returned from efi_get_next_variable_name_int() indicates we retrieved all EFI variables, it should be treated as EFI_SUCEESS. To address the checkpatch warning of too many leading tabs, combine two if statement into one. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
ce327084 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: carve out efi_get_next_variable_name_int calls To retrieve the EFI variable name by efi_get_next_variable_name_int(), the sequence of alloc -> efi_get_next_variable_name_int -> realloc -> efi_get_next_variable_name_int is required. In current code, this sequence repeatedly appears in the several functions. It should be curved out a common function. This commit also fixes the missing free() of var_name16 in eficonfig_delete_invalid_boot_option(). Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
140a8959 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use efi_get_next_variable_name_int() eficonfig command reads all possible UEFI load options from 0x0000 to 0xFFFF to construct the menu. This takes too much time in some environment. This commit uses efi_get_next_variable_name_int() to read all existing UEFI load options to significantlly reduce the count of efi_get_var() call. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
78b1ccc4 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use u16_strsize() to get u16 string buffer size Use u16_strsize() to simplify the u16 string buffer size calculation. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c67d3c9e |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix going one directory up issue The directory name in eficonfig menu entry contains the '\' separator. strcmp() argument ".." is wrong and one directory up handling does not work correctly. strcmp() argument must include '\' separator. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c3b5af63 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add UEFI Secure Boot Key enrollment interface This commit adds the menu-driven UEFI Secure Boot Key enrollment interface. User can enroll PK, KEK, db and dbx by selecting file. Only the signed EFI Signature List(s) with an authenticated header, typically '.auth' file, is accepted. To clear the PK, KEK, db and dbx, user needs to enroll the null key signed by PK or KEK. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
21faf4ef |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use protocol interface for file selection EFI_SIMPLE_FILE_SYSTEM_PROTOCOL is not always provided by U-Boot. Use protocol interface functions instead of U-Boot internal functions. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d6566113 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose eficonfig_create_device_path() Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use eficonfig_create_device_path() to construct the full device path from device path of the volume and file path, so move it out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d571f9b2 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation All the eficonfig menus other than "Change Boot Order" use 'eficonfig_entry' structure for each menu entry. This commit refactors change boot order implementation to use 'eficonfig_entry' structure same as other menus to have consistent menu handling. This commit also simplifies the data->active handling when KEY_SPACE is pressed, and sizeof() parameter. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
8961e93e |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose append entry function Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use append_entry() and append_quit_entry() to construct the menu, so move them out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
a84040ab |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor file selection handling eficonfig_select_file_handler() is commonly used to select the file. eficonfig_display_select_file_option() adds an additional menu to clear the selected file. eficonfig_display_select_file_option() is not always necessary for the file selection process, so it must be outside of eficonfig_select_file_handler(). This commit also renames the following functions to avoid confusion. eficonfig_select_file_handler() -> eficonfig_process_select_file() eficonfig_select_file() -> eficonfig_show_file_selection() eficonfig_display_select_file_option() -> eficonfig_process_show_file_option() Finally, test_eficonfig.py need to be updated to get aligned with the above modification. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
1167e88a |
|
14-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix missing variable initialization The 'ret' variable must be initialized before use in eficonfig_delete_invalid_boot_option(). Fixes: c416f1c0bc ("bootmenu: add removable media entries") Addresses-Coverity: 376207 ("Uninitialized variables") Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
3d595ac5 |
|
09-Nov-2022 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: remove superfluous if in eficonfig_edit_boot_option Goto for an immediately succeeding label is superfluous. Fixes: 87d791423ac6 ("eficonfig: menu-driven addition of UEFI boot option") Addresses-Coverity: 376202 ("Identical code for different branches") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
9945bc4f |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Fix incorrect return code of boot option update Correct the return code for out-of-memory and no boot option found Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
339b527b |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Move bootorder and bootoption apis to lib Rename and move bootorder and bootoption apis from cmd to lib for re-use between eficonfig and bootmgr Fix 'unexpected indentation' when 'make htmldocs' after functions are moved Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
2c0b0c31 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_SECURE_BOOT This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_SECURE_BOOT defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
83f3d121 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_MM_COMM_TEE This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_MM_COMM_TEE defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
88df3634 |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: CTRL+S to save the boot order 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>
|
#
45f5319f |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
menu: remove CTRL+C to quit On the sandbox called without "--terminal raw" CTRL+C leaves U-Boot, "ESC/CTRL+C to quit" is misleading. Let's remove CTRL+C to quit key handling from bootmenu and eficonfig menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
|
#
8dbd0a0f |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add vertical scroll support The current eficonfig menu does not support vertical scroll, so it can not display the menu entries greater than the console row size. This commit add the vertial scroll support. The console size is retrieved by SIMPLE_TEXT_OUTPUT_PROTOCOL.QueryMode() service, then calculates the row size for menu entry by subtracting menu header and description row size from the console row size. "start" and "end" are added in the efimenu structure. "start" keeps the menu entry index at the top, "end" keeps the bottom menu entry index. item_data_print() menu function only draws the menu entry between "start" and "end". This commit also fixes the issue that "Save" and "Quit" entries can be moved by BKEY_PLUS in change boot order menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
0d590852 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation This commit removes the change boot order specific menu implementation. The change boot order implementation calls eficonfig_process_common() same as other menus. The change boot order menu requires own item_data_print and item_choice implementation, but display_statusline function can be a same function as other menus. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
cd160b27 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor eficonfig_process_common function Current change boot order implementation does not call eficonfig_process_common() and call own menu functions for display_statusline, item_data_print and item_choice. Change boot order functionality should call eficonfig_process_common() to improve maintenanceability. This commit is a preparation to remove the change boot order specific implementation. The menu functions (display_statusline, item_data_print and item_choice) are added as argument of eficonfig_process_common(). The menu description string displayed at the bottom of the menu is also added as argument. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
32bab0ea |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Make use of CLI character processing Avoid duplicating some of the escape-sequence processing here and use the CLI function instead. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
d0ca98db |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Update bootmenu_loop() to return the code Use the return value to save having to pass around a pointer. This also resolves any ambiguity about what *key contains when the function is called. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
2da4a15e |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Rename KEY_... to BKEY_... This enum values conflict with linux/input.h so rename them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
64550274 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: avoid SetVariable between GetNextVariableName calls The current code calls efi_set_variable_int() to delete the invalid boot option between calls to efi_get_next_variable_name_int(), it may produce unpredictable results. This commit moves removal of the invalid boot option outside of the efi_get_next_variable_name_int() calls. EFI_NOT_FOUND returned from efi_get_next_variable_name_int() indicates we retrieved all EFI variables, it should be treated as EFI_SUCEESS. To address the checkpatch warning of too many leading tabs, combine two if statement into one. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
ce327084 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: carve out efi_get_next_variable_name_int calls To retrieve the EFI variable name by efi_get_next_variable_name_int(), the sequence of alloc -> efi_get_next_variable_name_int -> realloc -> efi_get_next_variable_name_int is required. In current code, this sequence repeatedly appears in the several functions. It should be curved out a common function. This commit also fixes the missing free() of var_name16 in eficonfig_delete_invalid_boot_option(). Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
140a8959 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use efi_get_next_variable_name_int() eficonfig command reads all possible UEFI load options from 0x0000 to 0xFFFF to construct the menu. This takes too much time in some environment. This commit uses efi_get_next_variable_name_int() to read all existing UEFI load options to significantlly reduce the count of efi_get_var() call. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
78b1ccc4 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use u16_strsize() to get u16 string buffer size Use u16_strsize() to simplify the u16 string buffer size calculation. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c67d3c9e |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix going one directory up issue The directory name in eficonfig menu entry contains the '\' separator. strcmp() argument ".." is wrong and one directory up handling does not work correctly. strcmp() argument must include '\' separator. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c3b5af63 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add UEFI Secure Boot Key enrollment interface This commit adds the menu-driven UEFI Secure Boot Key enrollment interface. User can enroll PK, KEK, db and dbx by selecting file. Only the signed EFI Signature List(s) with an authenticated header, typically '.auth' file, is accepted. To clear the PK, KEK, db and dbx, user needs to enroll the null key signed by PK or KEK. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
21faf4ef |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use protocol interface for file selection EFI_SIMPLE_FILE_SYSTEM_PROTOCOL is not always provided by U-Boot. Use protocol interface functions instead of U-Boot internal functions. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d6566113 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose eficonfig_create_device_path() Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use eficonfig_create_device_path() to construct the full device path from device path of the volume and file path, so move it out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d571f9b2 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation All the eficonfig menus other than "Change Boot Order" use 'eficonfig_entry' structure for each menu entry. This commit refactors change boot order implementation to use 'eficonfig_entry' structure same as other menus to have consistent menu handling. This commit also simplifies the data->active handling when KEY_SPACE is pressed, and sizeof() parameter. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
8961e93e |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose append entry function Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use append_entry() and append_quit_entry() to construct the menu, so move them out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
a84040ab |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor file selection handling eficonfig_select_file_handler() is commonly used to select the file. eficonfig_display_select_file_option() adds an additional menu to clear the selected file. eficonfig_display_select_file_option() is not always necessary for the file selection process, so it must be outside of eficonfig_select_file_handler(). This commit also renames the following functions to avoid confusion. eficonfig_select_file_handler() -> eficonfig_process_select_file() eficonfig_select_file() -> eficonfig_show_file_selection() eficonfig_display_select_file_option() -> eficonfig_process_show_file_option() Finally, test_eficonfig.py need to be updated to get aligned with the above modification. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
1167e88a |
|
14-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix missing variable initialization The 'ret' variable must be initialized before use in eficonfig_delete_invalid_boot_option(). Fixes: c416f1c0bc ("bootmenu: add removable media entries") Addresses-Coverity: 376207 ("Uninitialized variables") Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
3d595ac5 |
|
09-Nov-2022 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: remove superfluous if in eficonfig_edit_boot_option Goto for an immediately succeeding label is superfluous. Fixes: 87d791423ac6 ("eficonfig: menu-driven addition of UEFI boot option") Addresses-Coverity: 376202 ("Identical code for different branches") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
9945bc4f |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Fix incorrect return code of boot option update Correct the return code for out-of-memory and no boot option found Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
339b527b |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Move bootorder and bootoption apis to lib Rename and move bootorder and bootoption apis from cmd to lib for re-use between eficonfig and bootmgr Fix 'unexpected indentation' when 'make htmldocs' after functions are moved Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
2c0b0c31 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_SECURE_BOOT This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_SECURE_BOOT defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
83f3d121 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_MM_COMM_TEE This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_MM_COMM_TEE defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
88df3634 |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: CTRL+S to save the boot order 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>
|
#
45f5319f |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
menu: remove CTRL+C to quit On the sandbox called without "--terminal raw" CTRL+C leaves U-Boot, "ESC/CTRL+C to quit" is misleading. Let's remove CTRL+C to quit key handling from bootmenu and eficonfig menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
|
#
8dbd0a0f |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add vertical scroll support The current eficonfig menu does not support vertical scroll, so it can not display the menu entries greater than the console row size. This commit add the vertial scroll support. The console size is retrieved by SIMPLE_TEXT_OUTPUT_PROTOCOL.QueryMode() service, then calculates the row size for menu entry by subtracting menu header and description row size from the console row size. "start" and "end" are added in the efimenu structure. "start" keeps the menu entry index at the top, "end" keeps the bottom menu entry index. item_data_print() menu function only draws the menu entry between "start" and "end". This commit also fixes the issue that "Save" and "Quit" entries can be moved by BKEY_PLUS in change boot order menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
0d590852 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation This commit removes the change boot order specific menu implementation. The change boot order implementation calls eficonfig_process_common() same as other menus. The change boot order menu requires own item_data_print and item_choice implementation, but display_statusline function can be a same function as other menus. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
cd160b27 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor eficonfig_process_common function Current change boot order implementation does not call eficonfig_process_common() and call own menu functions for display_statusline, item_data_print and item_choice. Change boot order functionality should call eficonfig_process_common() to improve maintenanceability. This commit is a preparation to remove the change boot order specific implementation. The menu functions (display_statusline, item_data_print and item_choice) are added as argument of eficonfig_process_common(). The menu description string displayed at the bottom of the menu is also added as argument. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
32bab0ea |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Make use of CLI character processing Avoid duplicating some of the escape-sequence processing here and use the CLI function instead. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
d0ca98db |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Update bootmenu_loop() to return the code Use the return value to save having to pass around a pointer. This also resolves any ambiguity about what *key contains when the function is called. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
2da4a15e |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Rename KEY_... to BKEY_... This enum values conflict with linux/input.h so rename them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
64550274 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: avoid SetVariable between GetNextVariableName calls The current code calls efi_set_variable_int() to delete the invalid boot option between calls to efi_get_next_variable_name_int(), it may produce unpredictable results. This commit moves removal of the invalid boot option outside of the efi_get_next_variable_name_int() calls. EFI_NOT_FOUND returned from efi_get_next_variable_name_int() indicates we retrieved all EFI variables, it should be treated as EFI_SUCEESS. To address the checkpatch warning of too many leading tabs, combine two if statement into one. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
ce327084 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: carve out efi_get_next_variable_name_int calls To retrieve the EFI variable name by efi_get_next_variable_name_int(), the sequence of alloc -> efi_get_next_variable_name_int -> realloc -> efi_get_next_variable_name_int is required. In current code, this sequence repeatedly appears in the several functions. It should be curved out a common function. This commit also fixes the missing free() of var_name16 in eficonfig_delete_invalid_boot_option(). Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
140a8959 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use efi_get_next_variable_name_int() eficonfig command reads all possible UEFI load options from 0x0000 to 0xFFFF to construct the menu. This takes too much time in some environment. This commit uses efi_get_next_variable_name_int() to read all existing UEFI load options to significantlly reduce the count of efi_get_var() call. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
78b1ccc4 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use u16_strsize() to get u16 string buffer size Use u16_strsize() to simplify the u16 string buffer size calculation. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c67d3c9e |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix going one directory up issue The directory name in eficonfig menu entry contains the '\' separator. strcmp() argument ".." is wrong and one directory up handling does not work correctly. strcmp() argument must include '\' separator. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c3b5af63 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add UEFI Secure Boot Key enrollment interface This commit adds the menu-driven UEFI Secure Boot Key enrollment interface. User can enroll PK, KEK, db and dbx by selecting file. Only the signed EFI Signature List(s) with an authenticated header, typically '.auth' file, is accepted. To clear the PK, KEK, db and dbx, user needs to enroll the null key signed by PK or KEK. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
21faf4ef |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use protocol interface for file selection EFI_SIMPLE_FILE_SYSTEM_PROTOCOL is not always provided by U-Boot. Use protocol interface functions instead of U-Boot internal functions. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d6566113 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose eficonfig_create_device_path() Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use eficonfig_create_device_path() to construct the full device path from device path of the volume and file path, so move it out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d571f9b2 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation All the eficonfig menus other than "Change Boot Order" use 'eficonfig_entry' structure for each menu entry. This commit refactors change boot order implementation to use 'eficonfig_entry' structure same as other menus to have consistent menu handling. This commit also simplifies the data->active handling when KEY_SPACE is pressed, and sizeof() parameter. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
8961e93e |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose append entry function Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use append_entry() and append_quit_entry() to construct the menu, so move them out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
a84040ab |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor file selection handling eficonfig_select_file_handler() is commonly used to select the file. eficonfig_display_select_file_option() adds an additional menu to clear the selected file. eficonfig_display_select_file_option() is not always necessary for the file selection process, so it must be outside of eficonfig_select_file_handler(). This commit also renames the following functions to avoid confusion. eficonfig_select_file_handler() -> eficonfig_process_select_file() eficonfig_select_file() -> eficonfig_show_file_selection() eficonfig_display_select_file_option() -> eficonfig_process_show_file_option() Finally, test_eficonfig.py need to be updated to get aligned with the above modification. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
1167e88a |
|
14-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix missing variable initialization The 'ret' variable must be initialized before use in eficonfig_delete_invalid_boot_option(). Fixes: c416f1c0bc ("bootmenu: add removable media entries") Addresses-Coverity: 376207 ("Uninitialized variables") Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
3d595ac5 |
|
09-Nov-2022 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: remove superfluous if in eficonfig_edit_boot_option Goto for an immediately succeeding label is superfluous. Fixes: 87d791423ac6 ("eficonfig: menu-driven addition of UEFI boot option") Addresses-Coverity: 376202 ("Identical code for different branches") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
9945bc4f |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Fix incorrect return code of boot option update Correct the return code for out-of-memory and no boot option found Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
339b527b |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Move bootorder and bootoption apis to lib Rename and move bootorder and bootoption apis from cmd to lib for re-use between eficonfig and bootmgr Fix 'unexpected indentation' when 'make htmldocs' after functions are moved Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
2c0b0c31 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_SECURE_BOOT This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_SECURE_BOOT defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
83f3d121 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_MM_COMM_TEE This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_MM_COMM_TEE defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
88df3634 |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: CTRL+S to save the boot order 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>
|
#
45f5319f |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
menu: remove CTRL+C to quit On the sandbox called without "--terminal raw" CTRL+C leaves U-Boot, "ESC/CTRL+C to quit" is misleading. Let's remove CTRL+C to quit key handling from bootmenu and eficonfig menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
|
#
8dbd0a0f |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add vertical scroll support The current eficonfig menu does not support vertical scroll, so it can not display the menu entries greater than the console row size. This commit add the vertial scroll support. The console size is retrieved by SIMPLE_TEXT_OUTPUT_PROTOCOL.QueryMode() service, then calculates the row size for menu entry by subtracting menu header and description row size from the console row size. "start" and "end" are added in the efimenu structure. "start" keeps the menu entry index at the top, "end" keeps the bottom menu entry index. item_data_print() menu function only draws the menu entry between "start" and "end". This commit also fixes the issue that "Save" and "Quit" entries can be moved by BKEY_PLUS in change boot order menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
0d590852 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation This commit removes the change boot order specific menu implementation. The change boot order implementation calls eficonfig_process_common() same as other menus. The change boot order menu requires own item_data_print and item_choice implementation, but display_statusline function can be a same function as other menus. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
cd160b27 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor eficonfig_process_common function Current change boot order implementation does not call eficonfig_process_common() and call own menu functions for display_statusline, item_data_print and item_choice. Change boot order functionality should call eficonfig_process_common() to improve maintenanceability. This commit is a preparation to remove the change boot order specific implementation. The menu functions (display_statusline, item_data_print and item_choice) are added as argument of eficonfig_process_common(). The menu description string displayed at the bottom of the menu is also added as argument. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
32bab0ea |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Make use of CLI character processing Avoid duplicating some of the escape-sequence processing here and use the CLI function instead. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
d0ca98db |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Update bootmenu_loop() to return the code Use the return value to save having to pass around a pointer. This also resolves any ambiguity about what *key contains when the function is called. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
2da4a15e |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Rename KEY_... to BKEY_... This enum values conflict with linux/input.h so rename them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
64550274 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: avoid SetVariable between GetNextVariableName calls The current code calls efi_set_variable_int() to delete the invalid boot option between calls to efi_get_next_variable_name_int(), it may produce unpredictable results. This commit moves removal of the invalid boot option outside of the efi_get_next_variable_name_int() calls. EFI_NOT_FOUND returned from efi_get_next_variable_name_int() indicates we retrieved all EFI variables, it should be treated as EFI_SUCEESS. To address the checkpatch warning of too many leading tabs, combine two if statement into one. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
ce327084 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: carve out efi_get_next_variable_name_int calls To retrieve the EFI variable name by efi_get_next_variable_name_int(), the sequence of alloc -> efi_get_next_variable_name_int -> realloc -> efi_get_next_variable_name_int is required. In current code, this sequence repeatedly appears in the several functions. It should be curved out a common function. This commit also fixes the missing free() of var_name16 in eficonfig_delete_invalid_boot_option(). Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
140a8959 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use efi_get_next_variable_name_int() eficonfig command reads all possible UEFI load options from 0x0000 to 0xFFFF to construct the menu. This takes too much time in some environment. This commit uses efi_get_next_variable_name_int() to read all existing UEFI load options to significantlly reduce the count of efi_get_var() call. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
78b1ccc4 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use u16_strsize() to get u16 string buffer size Use u16_strsize() to simplify the u16 string buffer size calculation. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c67d3c9e |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix going one directory up issue The directory name in eficonfig menu entry contains the '\' separator. strcmp() argument ".." is wrong and one directory up handling does not work correctly. strcmp() argument must include '\' separator. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c3b5af63 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add UEFI Secure Boot Key enrollment interface This commit adds the menu-driven UEFI Secure Boot Key enrollment interface. User can enroll PK, KEK, db and dbx by selecting file. Only the signed EFI Signature List(s) with an authenticated header, typically '.auth' file, is accepted. To clear the PK, KEK, db and dbx, user needs to enroll the null key signed by PK or KEK. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
21faf4ef |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use protocol interface for file selection EFI_SIMPLE_FILE_SYSTEM_PROTOCOL is not always provided by U-Boot. Use protocol interface functions instead of U-Boot internal functions. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d6566113 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose eficonfig_create_device_path() Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use eficonfig_create_device_path() to construct the full device path from device path of the volume and file path, so move it out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d571f9b2 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation All the eficonfig menus other than "Change Boot Order" use 'eficonfig_entry' structure for each menu entry. This commit refactors change boot order implementation to use 'eficonfig_entry' structure same as other menus to have consistent menu handling. This commit also simplifies the data->active handling when KEY_SPACE is pressed, and sizeof() parameter. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
8961e93e |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose append entry function Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use append_entry() and append_quit_entry() to construct the menu, so move them out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
a84040ab |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor file selection handling eficonfig_select_file_handler() is commonly used to select the file. eficonfig_display_select_file_option() adds an additional menu to clear the selected file. eficonfig_display_select_file_option() is not always necessary for the file selection process, so it must be outside of eficonfig_select_file_handler(). This commit also renames the following functions to avoid confusion. eficonfig_select_file_handler() -> eficonfig_process_select_file() eficonfig_select_file() -> eficonfig_show_file_selection() eficonfig_display_select_file_option() -> eficonfig_process_show_file_option() Finally, test_eficonfig.py need to be updated to get aligned with the above modification. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
1167e88a |
|
14-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix missing variable initialization The 'ret' variable must be initialized before use in eficonfig_delete_invalid_boot_option(). Fixes: c416f1c0bc ("bootmenu: add removable media entries") Addresses-Coverity: 376207 ("Uninitialized variables") Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
3d595ac5 |
|
09-Nov-2022 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: remove superfluous if in eficonfig_edit_boot_option Goto for an immediately succeeding label is superfluous. Fixes: 87d791423ac6 ("eficonfig: menu-driven addition of UEFI boot option") Addresses-Coverity: 376202 ("Identical code for different branches") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
9945bc4f |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Fix incorrect return code of boot option update Correct the return code for out-of-memory and no boot option found Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
339b527b |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Move bootorder and bootoption apis to lib Rename and move bootorder and bootoption apis from cmd to lib for re-use between eficonfig and bootmgr Fix 'unexpected indentation' when 'make htmldocs' after functions are moved Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
2c0b0c31 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_SECURE_BOOT This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_SECURE_BOOT defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
83f3d121 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_MM_COMM_TEE This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_MM_COMM_TEE defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
88df3634 |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: CTRL+S to save the boot order 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>
|
#
45f5319f |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
menu: remove CTRL+C to quit On the sandbox called without "--terminal raw" CTRL+C leaves U-Boot, "ESC/CTRL+C to quit" is misleading. Let's remove CTRL+C to quit key handling from bootmenu and eficonfig menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
|
#
8dbd0a0f |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add vertical scroll support The current eficonfig menu does not support vertical scroll, so it can not display the menu entries greater than the console row size. This commit add the vertial scroll support. The console size is retrieved by SIMPLE_TEXT_OUTPUT_PROTOCOL.QueryMode() service, then calculates the row size for menu entry by subtracting menu header and description row size from the console row size. "start" and "end" are added in the efimenu structure. "start" keeps the menu entry index at the top, "end" keeps the bottom menu entry index. item_data_print() menu function only draws the menu entry between "start" and "end". This commit also fixes the issue that "Save" and "Quit" entries can be moved by BKEY_PLUS in change boot order menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
0d590852 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation This commit removes the change boot order specific menu implementation. The change boot order implementation calls eficonfig_process_common() same as other menus. The change boot order menu requires own item_data_print and item_choice implementation, but display_statusline function can be a same function as other menus. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
cd160b27 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor eficonfig_process_common function Current change boot order implementation does not call eficonfig_process_common() and call own menu functions for display_statusline, item_data_print and item_choice. Change boot order functionality should call eficonfig_process_common() to improve maintenanceability. This commit is a preparation to remove the change boot order specific implementation. The menu functions (display_statusline, item_data_print and item_choice) are added as argument of eficonfig_process_common(). The menu description string displayed at the bottom of the menu is also added as argument. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
32bab0ea |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Make use of CLI character processing Avoid duplicating some of the escape-sequence processing here and use the CLI function instead. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
d0ca98db |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Update bootmenu_loop() to return the code Use the return value to save having to pass around a pointer. This also resolves any ambiguity about what *key contains when the function is called. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
2da4a15e |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Rename KEY_... to BKEY_... This enum values conflict with linux/input.h so rename them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
64550274 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: avoid SetVariable between GetNextVariableName calls The current code calls efi_set_variable_int() to delete the invalid boot option between calls to efi_get_next_variable_name_int(), it may produce unpredictable results. This commit moves removal of the invalid boot option outside of the efi_get_next_variable_name_int() calls. EFI_NOT_FOUND returned from efi_get_next_variable_name_int() indicates we retrieved all EFI variables, it should be treated as EFI_SUCEESS. To address the checkpatch warning of too many leading tabs, combine two if statement into one. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
ce327084 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: carve out efi_get_next_variable_name_int calls To retrieve the EFI variable name by efi_get_next_variable_name_int(), the sequence of alloc -> efi_get_next_variable_name_int -> realloc -> efi_get_next_variable_name_int is required. In current code, this sequence repeatedly appears in the several functions. It should be curved out a common function. This commit also fixes the missing free() of var_name16 in eficonfig_delete_invalid_boot_option(). Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
140a8959 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use efi_get_next_variable_name_int() eficonfig command reads all possible UEFI load options from 0x0000 to 0xFFFF to construct the menu. This takes too much time in some environment. This commit uses efi_get_next_variable_name_int() to read all existing UEFI load options to significantlly reduce the count of efi_get_var() call. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
78b1ccc4 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use u16_strsize() to get u16 string buffer size Use u16_strsize() to simplify the u16 string buffer size calculation. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c67d3c9e |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix going one directory up issue The directory name in eficonfig menu entry contains the '\' separator. strcmp() argument ".." is wrong and one directory up handling does not work correctly. strcmp() argument must include '\' separator. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c3b5af63 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add UEFI Secure Boot Key enrollment interface This commit adds the menu-driven UEFI Secure Boot Key enrollment interface. User can enroll PK, KEK, db and dbx by selecting file. Only the signed EFI Signature List(s) with an authenticated header, typically '.auth' file, is accepted. To clear the PK, KEK, db and dbx, user needs to enroll the null key signed by PK or KEK. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
21faf4ef |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use protocol interface for file selection EFI_SIMPLE_FILE_SYSTEM_PROTOCOL is not always provided by U-Boot. Use protocol interface functions instead of U-Boot internal functions. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d6566113 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose eficonfig_create_device_path() Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use eficonfig_create_device_path() to construct the full device path from device path of the volume and file path, so move it out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d571f9b2 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation All the eficonfig menus other than "Change Boot Order" use 'eficonfig_entry' structure for each menu entry. This commit refactors change boot order implementation to use 'eficonfig_entry' structure same as other menus to have consistent menu handling. This commit also simplifies the data->active handling when KEY_SPACE is pressed, and sizeof() parameter. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
8961e93e |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose append entry function Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use append_entry() and append_quit_entry() to construct the menu, so move them out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
a84040ab |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor file selection handling eficonfig_select_file_handler() is commonly used to select the file. eficonfig_display_select_file_option() adds an additional menu to clear the selected file. eficonfig_display_select_file_option() is not always necessary for the file selection process, so it must be outside of eficonfig_select_file_handler(). This commit also renames the following functions to avoid confusion. eficonfig_select_file_handler() -> eficonfig_process_select_file() eficonfig_select_file() -> eficonfig_show_file_selection() eficonfig_display_select_file_option() -> eficonfig_process_show_file_option() Finally, test_eficonfig.py need to be updated to get aligned with the above modification. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
1167e88a |
|
14-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix missing variable initialization The 'ret' variable must be initialized before use in eficonfig_delete_invalid_boot_option(). Fixes: c416f1c0bc ("bootmenu: add removable media entries") Addresses-Coverity: 376207 ("Uninitialized variables") Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
3d595ac5 |
|
09-Nov-2022 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: remove superfluous if in eficonfig_edit_boot_option Goto for an immediately succeeding label is superfluous. Fixes: 87d791423ac6 ("eficonfig: menu-driven addition of UEFI boot option") Addresses-Coverity: 376202 ("Identical code for different branches") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
9945bc4f |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Fix incorrect return code of boot option update Correct the return code for out-of-memory and no boot option found Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
339b527b |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Move bootorder and bootoption apis to lib Rename and move bootorder and bootoption apis from cmd to lib for re-use between eficonfig and bootmgr Fix 'unexpected indentation' when 'make htmldocs' after functions are moved Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
2c0b0c31 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_SECURE_BOOT This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_SECURE_BOOT defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
83f3d121 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_MM_COMM_TEE This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_MM_COMM_TEE defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
88df3634 |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: CTRL+S to save the boot order 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>
|
#
45f5319f |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
menu: remove CTRL+C to quit On the sandbox called without "--terminal raw" CTRL+C leaves U-Boot, "ESC/CTRL+C to quit" is misleading. Let's remove CTRL+C to quit key handling from bootmenu and eficonfig menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
|
#
8dbd0a0f |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add vertical scroll support The current eficonfig menu does not support vertical scroll, so it can not display the menu entries greater than the console row size. This commit add the vertial scroll support. The console size is retrieved by SIMPLE_TEXT_OUTPUT_PROTOCOL.QueryMode() service, then calculates the row size for menu entry by subtracting menu header and description row size from the console row size. "start" and "end" are added in the efimenu structure. "start" keeps the menu entry index at the top, "end" keeps the bottom menu entry index. item_data_print() menu function only draws the menu entry between "start" and "end". This commit also fixes the issue that "Save" and "Quit" entries can be moved by BKEY_PLUS in change boot order menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
0d590852 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation This commit removes the change boot order specific menu implementation. The change boot order implementation calls eficonfig_process_common() same as other menus. The change boot order menu requires own item_data_print and item_choice implementation, but display_statusline function can be a same function as other menus. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
cd160b27 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor eficonfig_process_common function Current change boot order implementation does not call eficonfig_process_common() and call own menu functions for display_statusline, item_data_print and item_choice. Change boot order functionality should call eficonfig_process_common() to improve maintenanceability. This commit is a preparation to remove the change boot order specific implementation. The menu functions (display_statusline, item_data_print and item_choice) are added as argument of eficonfig_process_common(). The menu description string displayed at the bottom of the menu is also added as argument. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
32bab0ea |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Make use of CLI character processing Avoid duplicating some of the escape-sequence processing here and use the CLI function instead. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
d0ca98db |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Update bootmenu_loop() to return the code Use the return value to save having to pass around a pointer. This also resolves any ambiguity about what *key contains when the function is called. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
2da4a15e |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Rename KEY_... to BKEY_... This enum values conflict with linux/input.h so rename them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
64550274 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: avoid SetVariable between GetNextVariableName calls The current code calls efi_set_variable_int() to delete the invalid boot option between calls to efi_get_next_variable_name_int(), it may produce unpredictable results. This commit moves removal of the invalid boot option outside of the efi_get_next_variable_name_int() calls. EFI_NOT_FOUND returned from efi_get_next_variable_name_int() indicates we retrieved all EFI variables, it should be treated as EFI_SUCEESS. To address the checkpatch warning of too many leading tabs, combine two if statement into one. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
ce327084 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: carve out efi_get_next_variable_name_int calls To retrieve the EFI variable name by efi_get_next_variable_name_int(), the sequence of alloc -> efi_get_next_variable_name_int -> realloc -> efi_get_next_variable_name_int is required. In current code, this sequence repeatedly appears in the several functions. It should be curved out a common function. This commit also fixes the missing free() of var_name16 in eficonfig_delete_invalid_boot_option(). Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
140a8959 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use efi_get_next_variable_name_int() eficonfig command reads all possible UEFI load options from 0x0000 to 0xFFFF to construct the menu. This takes too much time in some environment. This commit uses efi_get_next_variable_name_int() to read all existing UEFI load options to significantlly reduce the count of efi_get_var() call. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
78b1ccc4 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use u16_strsize() to get u16 string buffer size Use u16_strsize() to simplify the u16 string buffer size calculation. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c67d3c9e |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix going one directory up issue The directory name in eficonfig menu entry contains the '\' separator. strcmp() argument ".." is wrong and one directory up handling does not work correctly. strcmp() argument must include '\' separator. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c3b5af63 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add UEFI Secure Boot Key enrollment interface This commit adds the menu-driven UEFI Secure Boot Key enrollment interface. User can enroll PK, KEK, db and dbx by selecting file. Only the signed EFI Signature List(s) with an authenticated header, typically '.auth' file, is accepted. To clear the PK, KEK, db and dbx, user needs to enroll the null key signed by PK or KEK. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
21faf4ef |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use protocol interface for file selection EFI_SIMPLE_FILE_SYSTEM_PROTOCOL is not always provided by U-Boot. Use protocol interface functions instead of U-Boot internal functions. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d6566113 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose eficonfig_create_device_path() Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use eficonfig_create_device_path() to construct the full device path from device path of the volume and file path, so move it out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d571f9b2 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation All the eficonfig menus other than "Change Boot Order" use 'eficonfig_entry' structure for each menu entry. This commit refactors change boot order implementation to use 'eficonfig_entry' structure same as other menus to have consistent menu handling. This commit also simplifies the data->active handling when KEY_SPACE is pressed, and sizeof() parameter. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
8961e93e |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose append entry function Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use append_entry() and append_quit_entry() to construct the menu, so move them out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
a84040ab |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor file selection handling eficonfig_select_file_handler() is commonly used to select the file. eficonfig_display_select_file_option() adds an additional menu to clear the selected file. eficonfig_display_select_file_option() is not always necessary for the file selection process, so it must be outside of eficonfig_select_file_handler(). This commit also renames the following functions to avoid confusion. eficonfig_select_file_handler() -> eficonfig_process_select_file() eficonfig_select_file() -> eficonfig_show_file_selection() eficonfig_display_select_file_option() -> eficonfig_process_show_file_option() Finally, test_eficonfig.py need to be updated to get aligned with the above modification. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
1167e88a |
|
14-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix missing variable initialization The 'ret' variable must be initialized before use in eficonfig_delete_invalid_boot_option(). Fixes: c416f1c0bc ("bootmenu: add removable media entries") Addresses-Coverity: 376207 ("Uninitialized variables") Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
3d595ac5 |
|
09-Nov-2022 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: remove superfluous if in eficonfig_edit_boot_option Goto for an immediately succeeding label is superfluous. Fixes: 87d791423ac6 ("eficonfig: menu-driven addition of UEFI boot option") Addresses-Coverity: 376202 ("Identical code for different branches") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
9945bc4f |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Fix incorrect return code of boot option update Correct the return code for out-of-memory and no boot option found Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
339b527b |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Move bootorder and bootoption apis to lib Rename and move bootorder and bootoption apis from cmd to lib for re-use between eficonfig and bootmgr Fix 'unexpected indentation' when 'make htmldocs' after functions are moved Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
2c0b0c31 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_SECURE_BOOT This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_SECURE_BOOT defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
83f3d121 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_MM_COMM_TEE This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_MM_COMM_TEE defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
88df3634 |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: CTRL+S to save the boot order 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>
|
#
45f5319f |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
menu: remove CTRL+C to quit On the sandbox called without "--terminal raw" CTRL+C leaves U-Boot, "ESC/CTRL+C to quit" is misleading. Let's remove CTRL+C to quit key handling from bootmenu and eficonfig menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
|
#
8dbd0a0f |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add vertical scroll support The current eficonfig menu does not support vertical scroll, so it can not display the menu entries greater than the console row size. This commit add the vertial scroll support. The console size is retrieved by SIMPLE_TEXT_OUTPUT_PROTOCOL.QueryMode() service, then calculates the row size for menu entry by subtracting menu header and description row size from the console row size. "start" and "end" are added in the efimenu structure. "start" keeps the menu entry index at the top, "end" keeps the bottom menu entry index. item_data_print() menu function only draws the menu entry between "start" and "end". This commit also fixes the issue that "Save" and "Quit" entries can be moved by BKEY_PLUS in change boot order menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
0d590852 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation This commit removes the change boot order specific menu implementation. The change boot order implementation calls eficonfig_process_common() same as other menus. The change boot order menu requires own item_data_print and item_choice implementation, but display_statusline function can be a same function as other menus. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
cd160b27 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor eficonfig_process_common function Current change boot order implementation does not call eficonfig_process_common() and call own menu functions for display_statusline, item_data_print and item_choice. Change boot order functionality should call eficonfig_process_common() to improve maintenanceability. This commit is a preparation to remove the change boot order specific implementation. The menu functions (display_statusline, item_data_print and item_choice) are added as argument of eficonfig_process_common(). The menu description string displayed at the bottom of the menu is also added as argument. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
32bab0ea |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Make use of CLI character processing Avoid duplicating some of the escape-sequence processing here and use the CLI function instead. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
d0ca98db |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Update bootmenu_loop() to return the code Use the return value to save having to pass around a pointer. This also resolves any ambiguity about what *key contains when the function is called. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
2da4a15e |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Rename KEY_... to BKEY_... This enum values conflict with linux/input.h so rename them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
64550274 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: avoid SetVariable between GetNextVariableName calls The current code calls efi_set_variable_int() to delete the invalid boot option between calls to efi_get_next_variable_name_int(), it may produce unpredictable results. This commit moves removal of the invalid boot option outside of the efi_get_next_variable_name_int() calls. EFI_NOT_FOUND returned from efi_get_next_variable_name_int() indicates we retrieved all EFI variables, it should be treated as EFI_SUCEESS. To address the checkpatch warning of too many leading tabs, combine two if statement into one. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
ce327084 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: carve out efi_get_next_variable_name_int calls To retrieve the EFI variable name by efi_get_next_variable_name_int(), the sequence of alloc -> efi_get_next_variable_name_int -> realloc -> efi_get_next_variable_name_int is required. In current code, this sequence repeatedly appears in the several functions. It should be curved out a common function. This commit also fixes the missing free() of var_name16 in eficonfig_delete_invalid_boot_option(). Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
140a8959 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use efi_get_next_variable_name_int() eficonfig command reads all possible UEFI load options from 0x0000 to 0xFFFF to construct the menu. This takes too much time in some environment. This commit uses efi_get_next_variable_name_int() to read all existing UEFI load options to significantlly reduce the count of efi_get_var() call. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
78b1ccc4 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use u16_strsize() to get u16 string buffer size Use u16_strsize() to simplify the u16 string buffer size calculation. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c67d3c9e |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix going one directory up issue The directory name in eficonfig menu entry contains the '\' separator. strcmp() argument ".." is wrong and one directory up handling does not work correctly. strcmp() argument must include '\' separator. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c3b5af63 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add UEFI Secure Boot Key enrollment interface This commit adds the menu-driven UEFI Secure Boot Key enrollment interface. User can enroll PK, KEK, db and dbx by selecting file. Only the signed EFI Signature List(s) with an authenticated header, typically '.auth' file, is accepted. To clear the PK, KEK, db and dbx, user needs to enroll the null key signed by PK or KEK. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
21faf4ef |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use protocol interface for file selection EFI_SIMPLE_FILE_SYSTEM_PROTOCOL is not always provided by U-Boot. Use protocol interface functions instead of U-Boot internal functions. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d6566113 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose eficonfig_create_device_path() Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use eficonfig_create_device_path() to construct the full device path from device path of the volume and file path, so move it out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d571f9b2 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation All the eficonfig menus other than "Change Boot Order" use 'eficonfig_entry' structure for each menu entry. This commit refactors change boot order implementation to use 'eficonfig_entry' structure same as other menus to have consistent menu handling. This commit also simplifies the data->active handling when KEY_SPACE is pressed, and sizeof() parameter. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
8961e93e |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose append entry function Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use append_entry() and append_quit_entry() to construct the menu, so move them out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
a84040ab |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor file selection handling eficonfig_select_file_handler() is commonly used to select the file. eficonfig_display_select_file_option() adds an additional menu to clear the selected file. eficonfig_display_select_file_option() is not always necessary for the file selection process, so it must be outside of eficonfig_select_file_handler(). This commit also renames the following functions to avoid confusion. eficonfig_select_file_handler() -> eficonfig_process_select_file() eficonfig_select_file() -> eficonfig_show_file_selection() eficonfig_display_select_file_option() -> eficonfig_process_show_file_option() Finally, test_eficonfig.py need to be updated to get aligned with the above modification. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
1167e88a |
|
14-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix missing variable initialization The 'ret' variable must be initialized before use in eficonfig_delete_invalid_boot_option(). Fixes: c416f1c0bc ("bootmenu: add removable media entries") Addresses-Coverity: 376207 ("Uninitialized variables") Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
3d595ac5 |
|
09-Nov-2022 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: remove superfluous if in eficonfig_edit_boot_option Goto for an immediately succeeding label is superfluous. Fixes: 87d791423ac6 ("eficonfig: menu-driven addition of UEFI boot option") Addresses-Coverity: 376202 ("Identical code for different branches") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
9945bc4f |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Fix incorrect return code of boot option update Correct the return code for out-of-memory and no boot option found Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
339b527b |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Move bootorder and bootoption apis to lib Rename and move bootorder and bootoption apis from cmd to lib for re-use between eficonfig and bootmgr Fix 'unexpected indentation' when 'make htmldocs' after functions are moved Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
2c0b0c31 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_SECURE_BOOT This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_SECURE_BOOT defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
83f3d121 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_MM_COMM_TEE This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_MM_COMM_TEE defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
88df3634 |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: CTRL+S to save the boot order 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>
|
#
45f5319f |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
menu: remove CTRL+C to quit On the sandbox called without "--terminal raw" CTRL+C leaves U-Boot, "ESC/CTRL+C to quit" is misleading. Let's remove CTRL+C to quit key handling from bootmenu and eficonfig menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
|
#
8dbd0a0f |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add vertical scroll support The current eficonfig menu does not support vertical scroll, so it can not display the menu entries greater than the console row size. This commit add the vertial scroll support. The console size is retrieved by SIMPLE_TEXT_OUTPUT_PROTOCOL.QueryMode() service, then calculates the row size for menu entry by subtracting menu header and description row size from the console row size. "start" and "end" are added in the efimenu structure. "start" keeps the menu entry index at the top, "end" keeps the bottom menu entry index. item_data_print() menu function only draws the menu entry between "start" and "end". This commit also fixes the issue that "Save" and "Quit" entries can be moved by BKEY_PLUS in change boot order menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
0d590852 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation This commit removes the change boot order specific menu implementation. The change boot order implementation calls eficonfig_process_common() same as other menus. The change boot order menu requires own item_data_print and item_choice implementation, but display_statusline function can be a same function as other menus. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
cd160b27 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor eficonfig_process_common function Current change boot order implementation does not call eficonfig_process_common() and call own menu functions for display_statusline, item_data_print and item_choice. Change boot order functionality should call eficonfig_process_common() to improve maintenanceability. This commit is a preparation to remove the change boot order specific implementation. The menu functions (display_statusline, item_data_print and item_choice) are added as argument of eficonfig_process_common(). The menu description string displayed at the bottom of the menu is also added as argument. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
32bab0ea |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Make use of CLI character processing Avoid duplicating some of the escape-sequence processing here and use the CLI function instead. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
d0ca98db |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Update bootmenu_loop() to return the code Use the return value to save having to pass around a pointer. This also resolves any ambiguity about what *key contains when the function is called. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
2da4a15e |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Rename KEY_... to BKEY_... This enum values conflict with linux/input.h so rename them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
64550274 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: avoid SetVariable between GetNextVariableName calls The current code calls efi_set_variable_int() to delete the invalid boot option between calls to efi_get_next_variable_name_int(), it may produce unpredictable results. This commit moves removal of the invalid boot option outside of the efi_get_next_variable_name_int() calls. EFI_NOT_FOUND returned from efi_get_next_variable_name_int() indicates we retrieved all EFI variables, it should be treated as EFI_SUCEESS. To address the checkpatch warning of too many leading tabs, combine two if statement into one. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
ce327084 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: carve out efi_get_next_variable_name_int calls To retrieve the EFI variable name by efi_get_next_variable_name_int(), the sequence of alloc -> efi_get_next_variable_name_int -> realloc -> efi_get_next_variable_name_int is required. In current code, this sequence repeatedly appears in the several functions. It should be curved out a common function. This commit also fixes the missing free() of var_name16 in eficonfig_delete_invalid_boot_option(). Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
140a8959 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use efi_get_next_variable_name_int() eficonfig command reads all possible UEFI load options from 0x0000 to 0xFFFF to construct the menu. This takes too much time in some environment. This commit uses efi_get_next_variable_name_int() to read all existing UEFI load options to significantlly reduce the count of efi_get_var() call. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
78b1ccc4 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use u16_strsize() to get u16 string buffer size Use u16_strsize() to simplify the u16 string buffer size calculation. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c67d3c9e |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix going one directory up issue The directory name in eficonfig menu entry contains the '\' separator. strcmp() argument ".." is wrong and one directory up handling does not work correctly. strcmp() argument must include '\' separator. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c3b5af63 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add UEFI Secure Boot Key enrollment interface This commit adds the menu-driven UEFI Secure Boot Key enrollment interface. User can enroll PK, KEK, db and dbx by selecting file. Only the signed EFI Signature List(s) with an authenticated header, typically '.auth' file, is accepted. To clear the PK, KEK, db and dbx, user needs to enroll the null key signed by PK or KEK. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
21faf4ef |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use protocol interface for file selection EFI_SIMPLE_FILE_SYSTEM_PROTOCOL is not always provided by U-Boot. Use protocol interface functions instead of U-Boot internal functions. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d6566113 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose eficonfig_create_device_path() Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use eficonfig_create_device_path() to construct the full device path from device path of the volume and file path, so move it out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d571f9b2 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation All the eficonfig menus other than "Change Boot Order" use 'eficonfig_entry' structure for each menu entry. This commit refactors change boot order implementation to use 'eficonfig_entry' structure same as other menus to have consistent menu handling. This commit also simplifies the data->active handling when KEY_SPACE is pressed, and sizeof() parameter. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
8961e93e |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose append entry function Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use append_entry() and append_quit_entry() to construct the menu, so move them out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
a84040ab |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor file selection handling eficonfig_select_file_handler() is commonly used to select the file. eficonfig_display_select_file_option() adds an additional menu to clear the selected file. eficonfig_display_select_file_option() is not always necessary for the file selection process, so it must be outside of eficonfig_select_file_handler(). This commit also renames the following functions to avoid confusion. eficonfig_select_file_handler() -> eficonfig_process_select_file() eficonfig_select_file() -> eficonfig_show_file_selection() eficonfig_display_select_file_option() -> eficonfig_process_show_file_option() Finally, test_eficonfig.py need to be updated to get aligned with the above modification. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
1167e88a |
|
14-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix missing variable initialization The 'ret' variable must be initialized before use in eficonfig_delete_invalid_boot_option(). Fixes: c416f1c0bc ("bootmenu: add removable media entries") Addresses-Coverity: 376207 ("Uninitialized variables") Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
3d595ac5 |
|
09-Nov-2022 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: remove superfluous if in eficonfig_edit_boot_option Goto for an immediately succeeding label is superfluous. Fixes: 87d791423ac6 ("eficonfig: menu-driven addition of UEFI boot option") Addresses-Coverity: 376202 ("Identical code for different branches") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
9945bc4f |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Fix incorrect return code of boot option update Correct the return code for out-of-memory and no boot option found Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
339b527b |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Move bootorder and bootoption apis to lib Rename and move bootorder and bootoption apis from cmd to lib for re-use between eficonfig and bootmgr Fix 'unexpected indentation' when 'make htmldocs' after functions are moved Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
2c0b0c31 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_SECURE_BOOT This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_SECURE_BOOT defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
83f3d121 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_MM_COMM_TEE This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_MM_COMM_TEE defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
88df3634 |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: CTRL+S to save the boot order 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>
|
#
45f5319f |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
menu: remove CTRL+C to quit On the sandbox called without "--terminal raw" CTRL+C leaves U-Boot, "ESC/CTRL+C to quit" is misleading. Let's remove CTRL+C to quit key handling from bootmenu and eficonfig menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
|
#
8dbd0a0f |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add vertical scroll support The current eficonfig menu does not support vertical scroll, so it can not display the menu entries greater than the console row size. This commit add the vertial scroll support. The console size is retrieved by SIMPLE_TEXT_OUTPUT_PROTOCOL.QueryMode() service, then calculates the row size for menu entry by subtracting menu header and description row size from the console row size. "start" and "end" are added in the efimenu structure. "start" keeps the menu entry index at the top, "end" keeps the bottom menu entry index. item_data_print() menu function only draws the menu entry between "start" and "end". This commit also fixes the issue that "Save" and "Quit" entries can be moved by BKEY_PLUS in change boot order menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
0d590852 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation This commit removes the change boot order specific menu implementation. The change boot order implementation calls eficonfig_process_common() same as other menus. The change boot order menu requires own item_data_print and item_choice implementation, but display_statusline function can be a same function as other menus. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
cd160b27 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor eficonfig_process_common function Current change boot order implementation does not call eficonfig_process_common() and call own menu functions for display_statusline, item_data_print and item_choice. Change boot order functionality should call eficonfig_process_common() to improve maintenanceability. This commit is a preparation to remove the change boot order specific implementation. The menu functions (display_statusline, item_data_print and item_choice) are added as argument of eficonfig_process_common(). The menu description string displayed at the bottom of the menu is also added as argument. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
32bab0ea |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Make use of CLI character processing Avoid duplicating some of the escape-sequence processing here and use the CLI function instead. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
d0ca98db |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Update bootmenu_loop() to return the code Use the return value to save having to pass around a pointer. This also resolves any ambiguity about what *key contains when the function is called. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
2da4a15e |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Rename KEY_... to BKEY_... This enum values conflict with linux/input.h so rename them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
64550274 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: avoid SetVariable between GetNextVariableName calls The current code calls efi_set_variable_int() to delete the invalid boot option between calls to efi_get_next_variable_name_int(), it may produce unpredictable results. This commit moves removal of the invalid boot option outside of the efi_get_next_variable_name_int() calls. EFI_NOT_FOUND returned from efi_get_next_variable_name_int() indicates we retrieved all EFI variables, it should be treated as EFI_SUCEESS. To address the checkpatch warning of too many leading tabs, combine two if statement into one. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
ce327084 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: carve out efi_get_next_variable_name_int calls To retrieve the EFI variable name by efi_get_next_variable_name_int(), the sequence of alloc -> efi_get_next_variable_name_int -> realloc -> efi_get_next_variable_name_int is required. In current code, this sequence repeatedly appears in the several functions. It should be curved out a common function. This commit also fixes the missing free() of var_name16 in eficonfig_delete_invalid_boot_option(). Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
140a8959 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use efi_get_next_variable_name_int() eficonfig command reads all possible UEFI load options from 0x0000 to 0xFFFF to construct the menu. This takes too much time in some environment. This commit uses efi_get_next_variable_name_int() to read all existing UEFI load options to significantlly reduce the count of efi_get_var() call. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
78b1ccc4 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use u16_strsize() to get u16 string buffer size Use u16_strsize() to simplify the u16 string buffer size calculation. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c67d3c9e |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix going one directory up issue The directory name in eficonfig menu entry contains the '\' separator. strcmp() argument ".." is wrong and one directory up handling does not work correctly. strcmp() argument must include '\' separator. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c3b5af63 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add UEFI Secure Boot Key enrollment interface This commit adds the menu-driven UEFI Secure Boot Key enrollment interface. User can enroll PK, KEK, db and dbx by selecting file. Only the signed EFI Signature List(s) with an authenticated header, typically '.auth' file, is accepted. To clear the PK, KEK, db and dbx, user needs to enroll the null key signed by PK or KEK. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
21faf4ef |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use protocol interface for file selection EFI_SIMPLE_FILE_SYSTEM_PROTOCOL is not always provided by U-Boot. Use protocol interface functions instead of U-Boot internal functions. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d6566113 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose eficonfig_create_device_path() Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use eficonfig_create_device_path() to construct the full device path from device path of the volume and file path, so move it out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d571f9b2 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation All the eficonfig menus other than "Change Boot Order" use 'eficonfig_entry' structure for each menu entry. This commit refactors change boot order implementation to use 'eficonfig_entry' structure same as other menus to have consistent menu handling. This commit also simplifies the data->active handling when KEY_SPACE is pressed, and sizeof() parameter. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
8961e93e |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose append entry function Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use append_entry() and append_quit_entry() to construct the menu, so move them out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
a84040ab |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor file selection handling eficonfig_select_file_handler() is commonly used to select the file. eficonfig_display_select_file_option() adds an additional menu to clear the selected file. eficonfig_display_select_file_option() is not always necessary for the file selection process, so it must be outside of eficonfig_select_file_handler(). This commit also renames the following functions to avoid confusion. eficonfig_select_file_handler() -> eficonfig_process_select_file() eficonfig_select_file() -> eficonfig_show_file_selection() eficonfig_display_select_file_option() -> eficonfig_process_show_file_option() Finally, test_eficonfig.py need to be updated to get aligned with the above modification. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
1167e88a |
|
14-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix missing variable initialization The 'ret' variable must be initialized before use in eficonfig_delete_invalid_boot_option(). Fixes: c416f1c0bc ("bootmenu: add removable media entries") Addresses-Coverity: 376207 ("Uninitialized variables") Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
3d595ac5 |
|
09-Nov-2022 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: remove superfluous if in eficonfig_edit_boot_option Goto for an immediately succeeding label is superfluous. Fixes: 87d791423ac6 ("eficonfig: menu-driven addition of UEFI boot option") Addresses-Coverity: 376202 ("Identical code for different branches") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
9945bc4f |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Fix incorrect return code of boot option update Correct the return code for out-of-memory and no boot option found Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
339b527b |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Move bootorder and bootoption apis to lib Rename and move bootorder and bootoption apis from cmd to lib for re-use between eficonfig and bootmgr Fix 'unexpected indentation' when 'make htmldocs' after functions are moved Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
2c0b0c31 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_SECURE_BOOT This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_SECURE_BOOT defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
83f3d121 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_MM_COMM_TEE This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_MM_COMM_TEE defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
88df3634 |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: CTRL+S to save the boot order 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>
|
#
45f5319f |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
menu: remove CTRL+C to quit On the sandbox called without "--terminal raw" CTRL+C leaves U-Boot, "ESC/CTRL+C to quit" is misleading. Let's remove CTRL+C to quit key handling from bootmenu and eficonfig menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
|
#
8dbd0a0f |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add vertical scroll support The current eficonfig menu does not support vertical scroll, so it can not display the menu entries greater than the console row size. This commit add the vertial scroll support. The console size is retrieved by SIMPLE_TEXT_OUTPUT_PROTOCOL.QueryMode() service, then calculates the row size for menu entry by subtracting menu header and description row size from the console row size. "start" and "end" are added in the efimenu structure. "start" keeps the menu entry index at the top, "end" keeps the bottom menu entry index. item_data_print() menu function only draws the menu entry between "start" and "end". This commit also fixes the issue that "Save" and "Quit" entries can be moved by BKEY_PLUS in change boot order menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
0d590852 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation This commit removes the change boot order specific menu implementation. The change boot order implementation calls eficonfig_process_common() same as other menus. The change boot order menu requires own item_data_print and item_choice implementation, but display_statusline function can be a same function as other menus. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
cd160b27 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor eficonfig_process_common function Current change boot order implementation does not call eficonfig_process_common() and call own menu functions for display_statusline, item_data_print and item_choice. Change boot order functionality should call eficonfig_process_common() to improve maintenanceability. This commit is a preparation to remove the change boot order specific implementation. The menu functions (display_statusline, item_data_print and item_choice) are added as argument of eficonfig_process_common(). The menu description string displayed at the bottom of the menu is also added as argument. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
32bab0ea |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Make use of CLI character processing Avoid duplicating some of the escape-sequence processing here and use the CLI function instead. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
d0ca98db |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Update bootmenu_loop() to return the code Use the return value to save having to pass around a pointer. This also resolves any ambiguity about what *key contains when the function is called. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
2da4a15e |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Rename KEY_... to BKEY_... This enum values conflict with linux/input.h so rename them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
64550274 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: avoid SetVariable between GetNextVariableName calls The current code calls efi_set_variable_int() to delete the invalid boot option between calls to efi_get_next_variable_name_int(), it may produce unpredictable results. This commit moves removal of the invalid boot option outside of the efi_get_next_variable_name_int() calls. EFI_NOT_FOUND returned from efi_get_next_variable_name_int() indicates we retrieved all EFI variables, it should be treated as EFI_SUCEESS. To address the checkpatch warning of too many leading tabs, combine two if statement into one. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
ce327084 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: carve out efi_get_next_variable_name_int calls To retrieve the EFI variable name by efi_get_next_variable_name_int(), the sequence of alloc -> efi_get_next_variable_name_int -> realloc -> efi_get_next_variable_name_int is required. In current code, this sequence repeatedly appears in the several functions. It should be curved out a common function. This commit also fixes the missing free() of var_name16 in eficonfig_delete_invalid_boot_option(). Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
140a8959 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use efi_get_next_variable_name_int() eficonfig command reads all possible UEFI load options from 0x0000 to 0xFFFF to construct the menu. This takes too much time in some environment. This commit uses efi_get_next_variable_name_int() to read all existing UEFI load options to significantlly reduce the count of efi_get_var() call. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
78b1ccc4 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use u16_strsize() to get u16 string buffer size Use u16_strsize() to simplify the u16 string buffer size calculation. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c67d3c9e |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix going one directory up issue The directory name in eficonfig menu entry contains the '\' separator. strcmp() argument ".." is wrong and one directory up handling does not work correctly. strcmp() argument must include '\' separator. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c3b5af63 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add UEFI Secure Boot Key enrollment interface This commit adds the menu-driven UEFI Secure Boot Key enrollment interface. User can enroll PK, KEK, db and dbx by selecting file. Only the signed EFI Signature List(s) with an authenticated header, typically '.auth' file, is accepted. To clear the PK, KEK, db and dbx, user needs to enroll the null key signed by PK or KEK. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
21faf4ef |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use protocol interface for file selection EFI_SIMPLE_FILE_SYSTEM_PROTOCOL is not always provided by U-Boot. Use protocol interface functions instead of U-Boot internal functions. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d6566113 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose eficonfig_create_device_path() Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use eficonfig_create_device_path() to construct the full device path from device path of the volume and file path, so move it out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d571f9b2 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation All the eficonfig menus other than "Change Boot Order" use 'eficonfig_entry' structure for each menu entry. This commit refactors change boot order implementation to use 'eficonfig_entry' structure same as other menus to have consistent menu handling. This commit also simplifies the data->active handling when KEY_SPACE is pressed, and sizeof() parameter. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
8961e93e |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose append entry function Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use append_entry() and append_quit_entry() to construct the menu, so move them out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
a84040ab |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor file selection handling eficonfig_select_file_handler() is commonly used to select the file. eficonfig_display_select_file_option() adds an additional menu to clear the selected file. eficonfig_display_select_file_option() is not always necessary for the file selection process, so it must be outside of eficonfig_select_file_handler(). This commit also renames the following functions to avoid confusion. eficonfig_select_file_handler() -> eficonfig_process_select_file() eficonfig_select_file() -> eficonfig_show_file_selection() eficonfig_display_select_file_option() -> eficonfig_process_show_file_option() Finally, test_eficonfig.py need to be updated to get aligned with the above modification. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
1167e88a |
|
14-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix missing variable initialization The 'ret' variable must be initialized before use in eficonfig_delete_invalid_boot_option(). Fixes: c416f1c0bc ("bootmenu: add removable media entries") Addresses-Coverity: 376207 ("Uninitialized variables") Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
3d595ac5 |
|
09-Nov-2022 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: remove superfluous if in eficonfig_edit_boot_option Goto for an immediately succeeding label is superfluous. Fixes: 87d791423ac6 ("eficonfig: menu-driven addition of UEFI boot option") Addresses-Coverity: 376202 ("Identical code for different branches") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
9945bc4f |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Fix incorrect return code of boot option update Correct the return code for out-of-memory and no boot option found Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
339b527b |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Move bootorder and bootoption apis to lib Rename and move bootorder and bootoption apis from cmd to lib for re-use between eficonfig and bootmgr Fix 'unexpected indentation' when 'make htmldocs' after functions are moved Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
2c0b0c31 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_SECURE_BOOT This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_SECURE_BOOT defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
83f3d121 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_MM_COMM_TEE This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_MM_COMM_TEE defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
88df3634 |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: CTRL+S to save the boot order 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>
|
#
45f5319f |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
menu: remove CTRL+C to quit On the sandbox called without "--terminal raw" CTRL+C leaves U-Boot, "ESC/CTRL+C to quit" is misleading. Let's remove CTRL+C to quit key handling from bootmenu and eficonfig menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
|
#
8dbd0a0f |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add vertical scroll support The current eficonfig menu does not support vertical scroll, so it can not display the menu entries greater than the console row size. This commit add the vertial scroll support. The console size is retrieved by SIMPLE_TEXT_OUTPUT_PROTOCOL.QueryMode() service, then calculates the row size for menu entry by subtracting menu header and description row size from the console row size. "start" and "end" are added in the efimenu structure. "start" keeps the menu entry index at the top, "end" keeps the bottom menu entry index. item_data_print() menu function only draws the menu entry between "start" and "end". This commit also fixes the issue that "Save" and "Quit" entries can be moved by BKEY_PLUS in change boot order menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
0d590852 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation This commit removes the change boot order specific menu implementation. The change boot order implementation calls eficonfig_process_common() same as other menus. The change boot order menu requires own item_data_print and item_choice implementation, but display_statusline function can be a same function as other menus. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
cd160b27 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor eficonfig_process_common function Current change boot order implementation does not call eficonfig_process_common() and call own menu functions for display_statusline, item_data_print and item_choice. Change boot order functionality should call eficonfig_process_common() to improve maintenanceability. This commit is a preparation to remove the change boot order specific implementation. The menu functions (display_statusline, item_data_print and item_choice) are added as argument of eficonfig_process_common(). The menu description string displayed at the bottom of the menu is also added as argument. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
32bab0ea |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Make use of CLI character processing Avoid duplicating some of the escape-sequence processing here and use the CLI function instead. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
d0ca98db |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Update bootmenu_loop() to return the code Use the return value to save having to pass around a pointer. This also resolves any ambiguity about what *key contains when the function is called. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
2da4a15e |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Rename KEY_... to BKEY_... This enum values conflict with linux/input.h so rename them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
64550274 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: avoid SetVariable between GetNextVariableName calls The current code calls efi_set_variable_int() to delete the invalid boot option between calls to efi_get_next_variable_name_int(), it may produce unpredictable results. This commit moves removal of the invalid boot option outside of the efi_get_next_variable_name_int() calls. EFI_NOT_FOUND returned from efi_get_next_variable_name_int() indicates we retrieved all EFI variables, it should be treated as EFI_SUCEESS. To address the checkpatch warning of too many leading tabs, combine two if statement into one. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
ce327084 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: carve out efi_get_next_variable_name_int calls To retrieve the EFI variable name by efi_get_next_variable_name_int(), the sequence of alloc -> efi_get_next_variable_name_int -> realloc -> efi_get_next_variable_name_int is required. In current code, this sequence repeatedly appears in the several functions. It should be curved out a common function. This commit also fixes the missing free() of var_name16 in eficonfig_delete_invalid_boot_option(). Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
140a8959 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use efi_get_next_variable_name_int() eficonfig command reads all possible UEFI load options from 0x0000 to 0xFFFF to construct the menu. This takes too much time in some environment. This commit uses efi_get_next_variable_name_int() to read all existing UEFI load options to significantlly reduce the count of efi_get_var() call. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
78b1ccc4 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use u16_strsize() to get u16 string buffer size Use u16_strsize() to simplify the u16 string buffer size calculation. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c67d3c9e |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix going one directory up issue The directory name in eficonfig menu entry contains the '\' separator. strcmp() argument ".." is wrong and one directory up handling does not work correctly. strcmp() argument must include '\' separator. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c3b5af63 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add UEFI Secure Boot Key enrollment interface This commit adds the menu-driven UEFI Secure Boot Key enrollment interface. User can enroll PK, KEK, db and dbx by selecting file. Only the signed EFI Signature List(s) with an authenticated header, typically '.auth' file, is accepted. To clear the PK, KEK, db and dbx, user needs to enroll the null key signed by PK or KEK. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
21faf4ef |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use protocol interface for file selection EFI_SIMPLE_FILE_SYSTEM_PROTOCOL is not always provided by U-Boot. Use protocol interface functions instead of U-Boot internal functions. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d6566113 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose eficonfig_create_device_path() Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use eficonfig_create_device_path() to construct the full device path from device path of the volume and file path, so move it out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d571f9b2 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation All the eficonfig menus other than "Change Boot Order" use 'eficonfig_entry' structure for each menu entry. This commit refactors change boot order implementation to use 'eficonfig_entry' structure same as other menus to have consistent menu handling. This commit also simplifies the data->active handling when KEY_SPACE is pressed, and sizeof() parameter. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
8961e93e |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose append entry function Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use append_entry() and append_quit_entry() to construct the menu, so move them out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
a84040ab |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor file selection handling eficonfig_select_file_handler() is commonly used to select the file. eficonfig_display_select_file_option() adds an additional menu to clear the selected file. eficonfig_display_select_file_option() is not always necessary for the file selection process, so it must be outside of eficonfig_select_file_handler(). This commit also renames the following functions to avoid confusion. eficonfig_select_file_handler() -> eficonfig_process_select_file() eficonfig_select_file() -> eficonfig_show_file_selection() eficonfig_display_select_file_option() -> eficonfig_process_show_file_option() Finally, test_eficonfig.py need to be updated to get aligned with the above modification. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
1167e88a |
|
14-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix missing variable initialization The 'ret' variable must be initialized before use in eficonfig_delete_invalid_boot_option(). Fixes: c416f1c0bc ("bootmenu: add removable media entries") Addresses-Coverity: 376207 ("Uninitialized variables") Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
3d595ac5 |
|
09-Nov-2022 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: remove superfluous if in eficonfig_edit_boot_option Goto for an immediately succeeding label is superfluous. Fixes: 87d791423ac6 ("eficonfig: menu-driven addition of UEFI boot option") Addresses-Coverity: 376202 ("Identical code for different branches") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
9945bc4f |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Fix incorrect return code of boot option update Correct the return code for out-of-memory and no boot option found Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
339b527b |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Move bootorder and bootoption apis to lib Rename and move bootorder and bootoption apis from cmd to lib for re-use between eficonfig and bootmgr Fix 'unexpected indentation' when 'make htmldocs' after functions are moved Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
2c0b0c31 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_SECURE_BOOT This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_SECURE_BOOT defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
83f3d121 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_MM_COMM_TEE This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_MM_COMM_TEE defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
88df3634 |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: CTRL+S to save the boot order 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>
|
#
45f5319f |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
menu: remove CTRL+C to quit On the sandbox called without "--terminal raw" CTRL+C leaves U-Boot, "ESC/CTRL+C to quit" is misleading. Let's remove CTRL+C to quit key handling from bootmenu and eficonfig menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
|
#
8dbd0a0f |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add vertical scroll support The current eficonfig menu does not support vertical scroll, so it can not display the menu entries greater than the console row size. This commit add the vertial scroll support. The console size is retrieved by SIMPLE_TEXT_OUTPUT_PROTOCOL.QueryMode() service, then calculates the row size for menu entry by subtracting menu header and description row size from the console row size. "start" and "end" are added in the efimenu structure. "start" keeps the menu entry index at the top, "end" keeps the bottom menu entry index. item_data_print() menu function only draws the menu entry between "start" and "end". This commit also fixes the issue that "Save" and "Quit" entries can be moved by BKEY_PLUS in change boot order menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
0d590852 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation This commit removes the change boot order specific menu implementation. The change boot order implementation calls eficonfig_process_common() same as other menus. The change boot order menu requires own item_data_print and item_choice implementation, but display_statusline function can be a same function as other menus. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
cd160b27 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor eficonfig_process_common function Current change boot order implementation does not call eficonfig_process_common() and call own menu functions for display_statusline, item_data_print and item_choice. Change boot order functionality should call eficonfig_process_common() to improve maintenanceability. This commit is a preparation to remove the change boot order specific implementation. The menu functions (display_statusline, item_data_print and item_choice) are added as argument of eficonfig_process_common(). The menu description string displayed at the bottom of the menu is also added as argument. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
32bab0ea |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Make use of CLI character processing Avoid duplicating some of the escape-sequence processing here and use the CLI function instead. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
d0ca98db |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Update bootmenu_loop() to return the code Use the return value to save having to pass around a pointer. This also resolves any ambiguity about what *key contains when the function is called. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
2da4a15e |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Rename KEY_... to BKEY_... This enum values conflict with linux/input.h so rename them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
64550274 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: avoid SetVariable between GetNextVariableName calls The current code calls efi_set_variable_int() to delete the invalid boot option between calls to efi_get_next_variable_name_int(), it may produce unpredictable results. This commit moves removal of the invalid boot option outside of the efi_get_next_variable_name_int() calls. EFI_NOT_FOUND returned from efi_get_next_variable_name_int() indicates we retrieved all EFI variables, it should be treated as EFI_SUCEESS. To address the checkpatch warning of too many leading tabs, combine two if statement into one. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
ce327084 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: carve out efi_get_next_variable_name_int calls To retrieve the EFI variable name by efi_get_next_variable_name_int(), the sequence of alloc -> efi_get_next_variable_name_int -> realloc -> efi_get_next_variable_name_int is required. In current code, this sequence repeatedly appears in the several functions. It should be curved out a common function. This commit also fixes the missing free() of var_name16 in eficonfig_delete_invalid_boot_option(). Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
140a8959 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use efi_get_next_variable_name_int() eficonfig command reads all possible UEFI load options from 0x0000 to 0xFFFF to construct the menu. This takes too much time in some environment. This commit uses efi_get_next_variable_name_int() to read all existing UEFI load options to significantlly reduce the count of efi_get_var() call. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
78b1ccc4 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use u16_strsize() to get u16 string buffer size Use u16_strsize() to simplify the u16 string buffer size calculation. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c67d3c9e |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix going one directory up issue The directory name in eficonfig menu entry contains the '\' separator. strcmp() argument ".." is wrong and one directory up handling does not work correctly. strcmp() argument must include '\' separator. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c3b5af63 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add UEFI Secure Boot Key enrollment interface This commit adds the menu-driven UEFI Secure Boot Key enrollment interface. User can enroll PK, KEK, db and dbx by selecting file. Only the signed EFI Signature List(s) with an authenticated header, typically '.auth' file, is accepted. To clear the PK, KEK, db and dbx, user needs to enroll the null key signed by PK or KEK. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
21faf4ef |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use protocol interface for file selection EFI_SIMPLE_FILE_SYSTEM_PROTOCOL is not always provided by U-Boot. Use protocol interface functions instead of U-Boot internal functions. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d6566113 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose eficonfig_create_device_path() Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use eficonfig_create_device_path() to construct the full device path from device path of the volume and file path, so move it out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d571f9b2 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation All the eficonfig menus other than "Change Boot Order" use 'eficonfig_entry' structure for each menu entry. This commit refactors change boot order implementation to use 'eficonfig_entry' structure same as other menus to have consistent menu handling. This commit also simplifies the data->active handling when KEY_SPACE is pressed, and sizeof() parameter. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
8961e93e |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose append entry function Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use append_entry() and append_quit_entry() to construct the menu, so move them out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
a84040ab |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor file selection handling eficonfig_select_file_handler() is commonly used to select the file. eficonfig_display_select_file_option() adds an additional menu to clear the selected file. eficonfig_display_select_file_option() is not always necessary for the file selection process, so it must be outside of eficonfig_select_file_handler(). This commit also renames the following functions to avoid confusion. eficonfig_select_file_handler() -> eficonfig_process_select_file() eficonfig_select_file() -> eficonfig_show_file_selection() eficonfig_display_select_file_option() -> eficonfig_process_show_file_option() Finally, test_eficonfig.py need to be updated to get aligned with the above modification. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
1167e88a |
|
14-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix missing variable initialization The 'ret' variable must be initialized before use in eficonfig_delete_invalid_boot_option(). Fixes: c416f1c0bc ("bootmenu: add removable media entries") Addresses-Coverity: 376207 ("Uninitialized variables") Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
3d595ac5 |
|
09-Nov-2022 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: remove superfluous if in eficonfig_edit_boot_option Goto for an immediately succeeding label is superfluous. Fixes: 87d791423ac6 ("eficonfig: menu-driven addition of UEFI boot option") Addresses-Coverity: 376202 ("Identical code for different branches") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
9945bc4f |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Fix incorrect return code of boot option update Correct the return code for out-of-memory and no boot option found Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
339b527b |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Move bootorder and bootoption apis to lib Rename and move bootorder and bootoption apis from cmd to lib for re-use between eficonfig and bootmgr Fix 'unexpected indentation' when 'make htmldocs' after functions are moved Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
2c0b0c31 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_SECURE_BOOT This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_SECURE_BOOT defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
83f3d121 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_MM_COMM_TEE This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_MM_COMM_TEE defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
88df3634 |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: CTRL+S to save the boot order 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>
|
#
45f5319f |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
menu: remove CTRL+C to quit On the sandbox called without "--terminal raw" CTRL+C leaves U-Boot, "ESC/CTRL+C to quit" is misleading. Let's remove CTRL+C to quit key handling from bootmenu and eficonfig menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
|
#
8dbd0a0f |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add vertical scroll support The current eficonfig menu does not support vertical scroll, so it can not display the menu entries greater than the console row size. This commit add the vertial scroll support. The console size is retrieved by SIMPLE_TEXT_OUTPUT_PROTOCOL.QueryMode() service, then calculates the row size for menu entry by subtracting menu header and description row size from the console row size. "start" and "end" are added in the efimenu structure. "start" keeps the menu entry index at the top, "end" keeps the bottom menu entry index. item_data_print() menu function only draws the menu entry between "start" and "end". This commit also fixes the issue that "Save" and "Quit" entries can be moved by BKEY_PLUS in change boot order menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
0d590852 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation This commit removes the change boot order specific menu implementation. The change boot order implementation calls eficonfig_process_common() same as other menus. The change boot order menu requires own item_data_print and item_choice implementation, but display_statusline function can be a same function as other menus. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
cd160b27 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor eficonfig_process_common function Current change boot order implementation does not call eficonfig_process_common() and call own menu functions for display_statusline, item_data_print and item_choice. Change boot order functionality should call eficonfig_process_common() to improve maintenanceability. This commit is a preparation to remove the change boot order specific implementation. The menu functions (display_statusline, item_data_print and item_choice) are added as argument of eficonfig_process_common(). The menu description string displayed at the bottom of the menu is also added as argument. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
32bab0ea |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Make use of CLI character processing Avoid duplicating some of the escape-sequence processing here and use the CLI function instead. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
d0ca98db |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Update bootmenu_loop() to return the code Use the return value to save having to pass around a pointer. This also resolves any ambiguity about what *key contains when the function is called. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
2da4a15e |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Rename KEY_... to BKEY_... This enum values conflict with linux/input.h so rename them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
64550274 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: avoid SetVariable between GetNextVariableName calls The current code calls efi_set_variable_int() to delete the invalid boot option between calls to efi_get_next_variable_name_int(), it may produce unpredictable results. This commit moves removal of the invalid boot option outside of the efi_get_next_variable_name_int() calls. EFI_NOT_FOUND returned from efi_get_next_variable_name_int() indicates we retrieved all EFI variables, it should be treated as EFI_SUCEESS. To address the checkpatch warning of too many leading tabs, combine two if statement into one. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
ce327084 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: carve out efi_get_next_variable_name_int calls To retrieve the EFI variable name by efi_get_next_variable_name_int(), the sequence of alloc -> efi_get_next_variable_name_int -> realloc -> efi_get_next_variable_name_int is required. In current code, this sequence repeatedly appears in the several functions. It should be curved out a common function. This commit also fixes the missing free() of var_name16 in eficonfig_delete_invalid_boot_option(). Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
140a8959 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use efi_get_next_variable_name_int() eficonfig command reads all possible UEFI load options from 0x0000 to 0xFFFF to construct the menu. This takes too much time in some environment. This commit uses efi_get_next_variable_name_int() to read all existing UEFI load options to significantlly reduce the count of efi_get_var() call. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
78b1ccc4 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use u16_strsize() to get u16 string buffer size Use u16_strsize() to simplify the u16 string buffer size calculation. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c67d3c9e |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix going one directory up issue The directory name in eficonfig menu entry contains the '\' separator. strcmp() argument ".." is wrong and one directory up handling does not work correctly. strcmp() argument must include '\' separator. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c3b5af63 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add UEFI Secure Boot Key enrollment interface This commit adds the menu-driven UEFI Secure Boot Key enrollment interface. User can enroll PK, KEK, db and dbx by selecting file. Only the signed EFI Signature List(s) with an authenticated header, typically '.auth' file, is accepted. To clear the PK, KEK, db and dbx, user needs to enroll the null key signed by PK or KEK. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
21faf4ef |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use protocol interface for file selection EFI_SIMPLE_FILE_SYSTEM_PROTOCOL is not always provided by U-Boot. Use protocol interface functions instead of U-Boot internal functions. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d6566113 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose eficonfig_create_device_path() Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use eficonfig_create_device_path() to construct the full device path from device path of the volume and file path, so move it out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d571f9b2 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation All the eficonfig menus other than "Change Boot Order" use 'eficonfig_entry' structure for each menu entry. This commit refactors change boot order implementation to use 'eficonfig_entry' structure same as other menus to have consistent menu handling. This commit also simplifies the data->active handling when KEY_SPACE is pressed, and sizeof() parameter. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
8961e93e |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose append entry function Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use append_entry() and append_quit_entry() to construct the menu, so move them out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
a84040ab |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor file selection handling eficonfig_select_file_handler() is commonly used to select the file. eficonfig_display_select_file_option() adds an additional menu to clear the selected file. eficonfig_display_select_file_option() is not always necessary for the file selection process, so it must be outside of eficonfig_select_file_handler(). This commit also renames the following functions to avoid confusion. eficonfig_select_file_handler() -> eficonfig_process_select_file() eficonfig_select_file() -> eficonfig_show_file_selection() eficonfig_display_select_file_option() -> eficonfig_process_show_file_option() Finally, test_eficonfig.py need to be updated to get aligned with the above modification. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
1167e88a |
|
14-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix missing variable initialization The 'ret' variable must be initialized before use in eficonfig_delete_invalid_boot_option(). Fixes: c416f1c0bc ("bootmenu: add removable media entries") Addresses-Coverity: 376207 ("Uninitialized variables") Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
3d595ac5 |
|
09-Nov-2022 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: remove superfluous if in eficonfig_edit_boot_option Goto for an immediately succeeding label is superfluous. Fixes: 87d791423ac6 ("eficonfig: menu-driven addition of UEFI boot option") Addresses-Coverity: 376202 ("Identical code for different branches") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
9945bc4f |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Fix incorrect return code of boot option update Correct the return code for out-of-memory and no boot option found Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
339b527b |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Move bootorder and bootoption apis to lib Rename and move bootorder and bootoption apis from cmd to lib for re-use between eficonfig and bootmgr Fix 'unexpected indentation' when 'make htmldocs' after functions are moved Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
2c0b0c31 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_SECURE_BOOT This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_SECURE_BOOT defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
83f3d121 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_MM_COMM_TEE This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_MM_COMM_TEE defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
88df3634 |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: CTRL+S to save the boot order 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>
|
#
45f5319f |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
menu: remove CTRL+C to quit On the sandbox called without "--terminal raw" CTRL+C leaves U-Boot, "ESC/CTRL+C to quit" is misleading. Let's remove CTRL+C to quit key handling from bootmenu and eficonfig menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
|
#
8dbd0a0f |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add vertical scroll support The current eficonfig menu does not support vertical scroll, so it can not display the menu entries greater than the console row size. This commit add the vertial scroll support. The console size is retrieved by SIMPLE_TEXT_OUTPUT_PROTOCOL.QueryMode() service, then calculates the row size for menu entry by subtracting menu header and description row size from the console row size. "start" and "end" are added in the efimenu structure. "start" keeps the menu entry index at the top, "end" keeps the bottom menu entry index. item_data_print() menu function only draws the menu entry between "start" and "end". This commit also fixes the issue that "Save" and "Quit" entries can be moved by BKEY_PLUS in change boot order menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
0d590852 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation This commit removes the change boot order specific menu implementation. The change boot order implementation calls eficonfig_process_common() same as other menus. The change boot order menu requires own item_data_print and item_choice implementation, but display_statusline function can be a same function as other menus. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
cd160b27 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor eficonfig_process_common function Current change boot order implementation does not call eficonfig_process_common() and call own menu functions for display_statusline, item_data_print and item_choice. Change boot order functionality should call eficonfig_process_common() to improve maintenanceability. This commit is a preparation to remove the change boot order specific implementation. The menu functions (display_statusline, item_data_print and item_choice) are added as argument of eficonfig_process_common(). The menu description string displayed at the bottom of the menu is also added as argument. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
32bab0ea |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Make use of CLI character processing Avoid duplicating some of the escape-sequence processing here and use the CLI function instead. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
d0ca98db |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Update bootmenu_loop() to return the code Use the return value to save having to pass around a pointer. This also resolves any ambiguity about what *key contains when the function is called. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
2da4a15e |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Rename KEY_... to BKEY_... This enum values conflict with linux/input.h so rename them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
64550274 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: avoid SetVariable between GetNextVariableName calls The current code calls efi_set_variable_int() to delete the invalid boot option between calls to efi_get_next_variable_name_int(), it may produce unpredictable results. This commit moves removal of the invalid boot option outside of the efi_get_next_variable_name_int() calls. EFI_NOT_FOUND returned from efi_get_next_variable_name_int() indicates we retrieved all EFI variables, it should be treated as EFI_SUCEESS. To address the checkpatch warning of too many leading tabs, combine two if statement into one. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
ce327084 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: carve out efi_get_next_variable_name_int calls To retrieve the EFI variable name by efi_get_next_variable_name_int(), the sequence of alloc -> efi_get_next_variable_name_int -> realloc -> efi_get_next_variable_name_int is required. In current code, this sequence repeatedly appears in the several functions. It should be curved out a common function. This commit also fixes the missing free() of var_name16 in eficonfig_delete_invalid_boot_option(). Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
140a8959 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use efi_get_next_variable_name_int() eficonfig command reads all possible UEFI load options from 0x0000 to 0xFFFF to construct the menu. This takes too much time in some environment. This commit uses efi_get_next_variable_name_int() to read all existing UEFI load options to significantlly reduce the count of efi_get_var() call. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
78b1ccc4 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use u16_strsize() to get u16 string buffer size Use u16_strsize() to simplify the u16 string buffer size calculation. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c67d3c9e |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix going one directory up issue The directory name in eficonfig menu entry contains the '\' separator. strcmp() argument ".." is wrong and one directory up handling does not work correctly. strcmp() argument must include '\' separator. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c3b5af63 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add UEFI Secure Boot Key enrollment interface This commit adds the menu-driven UEFI Secure Boot Key enrollment interface. User can enroll PK, KEK, db and dbx by selecting file. Only the signed EFI Signature List(s) with an authenticated header, typically '.auth' file, is accepted. To clear the PK, KEK, db and dbx, user needs to enroll the null key signed by PK or KEK. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
21faf4ef |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use protocol interface for file selection EFI_SIMPLE_FILE_SYSTEM_PROTOCOL is not always provided by U-Boot. Use protocol interface functions instead of U-Boot internal functions. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d6566113 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose eficonfig_create_device_path() Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use eficonfig_create_device_path() to construct the full device path from device path of the volume and file path, so move it out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d571f9b2 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation All the eficonfig menus other than "Change Boot Order" use 'eficonfig_entry' structure for each menu entry. This commit refactors change boot order implementation to use 'eficonfig_entry' structure same as other menus to have consistent menu handling. This commit also simplifies the data->active handling when KEY_SPACE is pressed, and sizeof() parameter. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
8961e93e |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose append entry function Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use append_entry() and append_quit_entry() to construct the menu, so move them out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
a84040ab |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor file selection handling eficonfig_select_file_handler() is commonly used to select the file. eficonfig_display_select_file_option() adds an additional menu to clear the selected file. eficonfig_display_select_file_option() is not always necessary for the file selection process, so it must be outside of eficonfig_select_file_handler(). This commit also renames the following functions to avoid confusion. eficonfig_select_file_handler() -> eficonfig_process_select_file() eficonfig_select_file() -> eficonfig_show_file_selection() eficonfig_display_select_file_option() -> eficonfig_process_show_file_option() Finally, test_eficonfig.py need to be updated to get aligned with the above modification. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
1167e88a |
|
14-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix missing variable initialization The 'ret' variable must be initialized before use in eficonfig_delete_invalid_boot_option(). Fixes: c416f1c0bc ("bootmenu: add removable media entries") Addresses-Coverity: 376207 ("Uninitialized variables") Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
3d595ac5 |
|
09-Nov-2022 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: remove superfluous if in eficonfig_edit_boot_option Goto for an immediately succeeding label is superfluous. Fixes: 87d791423ac6 ("eficonfig: menu-driven addition of UEFI boot option") Addresses-Coverity: 376202 ("Identical code for different branches") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
9945bc4f |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Fix incorrect return code of boot option update Correct the return code for out-of-memory and no boot option found Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
339b527b |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Move bootorder and bootoption apis to lib Rename and move bootorder and bootoption apis from cmd to lib for re-use between eficonfig and bootmgr Fix 'unexpected indentation' when 'make htmldocs' after functions are moved Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
2c0b0c31 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_SECURE_BOOT This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_SECURE_BOOT defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
83f3d121 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_MM_COMM_TEE This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_MM_COMM_TEE defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
88df3634 |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: CTRL+S to save the boot order 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>
|
#
45f5319f |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
menu: remove CTRL+C to quit On the sandbox called without "--terminal raw" CTRL+C leaves U-Boot, "ESC/CTRL+C to quit" is misleading. Let's remove CTRL+C to quit key handling from bootmenu and eficonfig menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
|
#
8dbd0a0f |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add vertical scroll support The current eficonfig menu does not support vertical scroll, so it can not display the menu entries greater than the console row size. This commit add the vertial scroll support. The console size is retrieved by SIMPLE_TEXT_OUTPUT_PROTOCOL.QueryMode() service, then calculates the row size for menu entry by subtracting menu header and description row size from the console row size. "start" and "end" are added in the efimenu structure. "start" keeps the menu entry index at the top, "end" keeps the bottom menu entry index. item_data_print() menu function only draws the menu entry between "start" and "end". This commit also fixes the issue that "Save" and "Quit" entries can be moved by BKEY_PLUS in change boot order menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
0d590852 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation This commit removes the change boot order specific menu implementation. The change boot order implementation calls eficonfig_process_common() same as other menus. The change boot order menu requires own item_data_print and item_choice implementation, but display_statusline function can be a same function as other menus. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
cd160b27 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor eficonfig_process_common function Current change boot order implementation does not call eficonfig_process_common() and call own menu functions for display_statusline, item_data_print and item_choice. Change boot order functionality should call eficonfig_process_common() to improve maintenanceability. This commit is a preparation to remove the change boot order specific implementation. The menu functions (display_statusline, item_data_print and item_choice) are added as argument of eficonfig_process_common(). The menu description string displayed at the bottom of the menu is also added as argument. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
32bab0ea |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Make use of CLI character processing Avoid duplicating some of the escape-sequence processing here and use the CLI function instead. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
d0ca98db |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Update bootmenu_loop() to return the code Use the return value to save having to pass around a pointer. This also resolves any ambiguity about what *key contains when the function is called. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
2da4a15e |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Rename KEY_... to BKEY_... This enum values conflict with linux/input.h so rename them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
64550274 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: avoid SetVariable between GetNextVariableName calls The current code calls efi_set_variable_int() to delete the invalid boot option between calls to efi_get_next_variable_name_int(), it may produce unpredictable results. This commit moves removal of the invalid boot option outside of the efi_get_next_variable_name_int() calls. EFI_NOT_FOUND returned from efi_get_next_variable_name_int() indicates we retrieved all EFI variables, it should be treated as EFI_SUCEESS. To address the checkpatch warning of too many leading tabs, combine two if statement into one. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
ce327084 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: carve out efi_get_next_variable_name_int calls To retrieve the EFI variable name by efi_get_next_variable_name_int(), the sequence of alloc -> efi_get_next_variable_name_int -> realloc -> efi_get_next_variable_name_int is required. In current code, this sequence repeatedly appears in the several functions. It should be curved out a common function. This commit also fixes the missing free() of var_name16 in eficonfig_delete_invalid_boot_option(). Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
140a8959 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use efi_get_next_variable_name_int() eficonfig command reads all possible UEFI load options from 0x0000 to 0xFFFF to construct the menu. This takes too much time in some environment. This commit uses efi_get_next_variable_name_int() to read all existing UEFI load options to significantlly reduce the count of efi_get_var() call. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
78b1ccc4 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use u16_strsize() to get u16 string buffer size Use u16_strsize() to simplify the u16 string buffer size calculation. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c67d3c9e |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix going one directory up issue The directory name in eficonfig menu entry contains the '\' separator. strcmp() argument ".." is wrong and one directory up handling does not work correctly. strcmp() argument must include '\' separator. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c3b5af63 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add UEFI Secure Boot Key enrollment interface This commit adds the menu-driven UEFI Secure Boot Key enrollment interface. User can enroll PK, KEK, db and dbx by selecting file. Only the signed EFI Signature List(s) with an authenticated header, typically '.auth' file, is accepted. To clear the PK, KEK, db and dbx, user needs to enroll the null key signed by PK or KEK. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
21faf4ef |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use protocol interface for file selection EFI_SIMPLE_FILE_SYSTEM_PROTOCOL is not always provided by U-Boot. Use protocol interface functions instead of U-Boot internal functions. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d6566113 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose eficonfig_create_device_path() Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use eficonfig_create_device_path() to construct the full device path from device path of the volume and file path, so move it out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d571f9b2 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation All the eficonfig menus other than "Change Boot Order" use 'eficonfig_entry' structure for each menu entry. This commit refactors change boot order implementation to use 'eficonfig_entry' structure same as other menus to have consistent menu handling. This commit also simplifies the data->active handling when KEY_SPACE is pressed, and sizeof() parameter. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
8961e93e |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose append entry function Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use append_entry() and append_quit_entry() to construct the menu, so move them out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
a84040ab |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor file selection handling eficonfig_select_file_handler() is commonly used to select the file. eficonfig_display_select_file_option() adds an additional menu to clear the selected file. eficonfig_display_select_file_option() is not always necessary for the file selection process, so it must be outside of eficonfig_select_file_handler(). This commit also renames the following functions to avoid confusion. eficonfig_select_file_handler() -> eficonfig_process_select_file() eficonfig_select_file() -> eficonfig_show_file_selection() eficonfig_display_select_file_option() -> eficonfig_process_show_file_option() Finally, test_eficonfig.py need to be updated to get aligned with the above modification. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
1167e88a |
|
14-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix missing variable initialization The 'ret' variable must be initialized before use in eficonfig_delete_invalid_boot_option(). Fixes: c416f1c0bc ("bootmenu: add removable media entries") Addresses-Coverity: 376207 ("Uninitialized variables") Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
3d595ac5 |
|
09-Nov-2022 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: remove superfluous if in eficonfig_edit_boot_option Goto for an immediately succeeding label is superfluous. Fixes: 87d791423ac6 ("eficonfig: menu-driven addition of UEFI boot option") Addresses-Coverity: 376202 ("Identical code for different branches") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
9945bc4f |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Fix incorrect return code of boot option update Correct the return code for out-of-memory and no boot option found Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
339b527b |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Move bootorder and bootoption apis to lib Rename and move bootorder and bootoption apis from cmd to lib for re-use between eficonfig and bootmgr Fix 'unexpected indentation' when 'make htmldocs' after functions are moved Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
2c0b0c31 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_SECURE_BOOT This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_SECURE_BOOT defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
83f3d121 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_MM_COMM_TEE This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_MM_COMM_TEE defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
88df3634 |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: CTRL+S to save the boot order 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>
|
#
45f5319f |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
menu: remove CTRL+C to quit On the sandbox called without "--terminal raw" CTRL+C leaves U-Boot, "ESC/CTRL+C to quit" is misleading. Let's remove CTRL+C to quit key handling from bootmenu and eficonfig menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
|
#
8dbd0a0f |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add vertical scroll support The current eficonfig menu does not support vertical scroll, so it can not display the menu entries greater than the console row size. This commit add the vertial scroll support. The console size is retrieved by SIMPLE_TEXT_OUTPUT_PROTOCOL.QueryMode() service, then calculates the row size for menu entry by subtracting menu header and description row size from the console row size. "start" and "end" are added in the efimenu structure. "start" keeps the menu entry index at the top, "end" keeps the bottom menu entry index. item_data_print() menu function only draws the menu entry between "start" and "end". This commit also fixes the issue that "Save" and "Quit" entries can be moved by BKEY_PLUS in change boot order menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
0d590852 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation This commit removes the change boot order specific menu implementation. The change boot order implementation calls eficonfig_process_common() same as other menus. The change boot order menu requires own item_data_print and item_choice implementation, but display_statusline function can be a same function as other menus. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
cd160b27 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor eficonfig_process_common function Current change boot order implementation does not call eficonfig_process_common() and call own menu functions for display_statusline, item_data_print and item_choice. Change boot order functionality should call eficonfig_process_common() to improve maintenanceability. This commit is a preparation to remove the change boot order specific implementation. The menu functions (display_statusline, item_data_print and item_choice) are added as argument of eficonfig_process_common(). The menu description string displayed at the bottom of the menu is also added as argument. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
32bab0ea |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Make use of CLI character processing Avoid duplicating some of the escape-sequence processing here and use the CLI function instead. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
d0ca98db |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Update bootmenu_loop() to return the code Use the return value to save having to pass around a pointer. This also resolves any ambiguity about what *key contains when the function is called. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
2da4a15e |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Rename KEY_... to BKEY_... This enum values conflict with linux/input.h so rename them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
64550274 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: avoid SetVariable between GetNextVariableName calls The current code calls efi_set_variable_int() to delete the invalid boot option between calls to efi_get_next_variable_name_int(), it may produce unpredictable results. This commit moves removal of the invalid boot option outside of the efi_get_next_variable_name_int() calls. EFI_NOT_FOUND returned from efi_get_next_variable_name_int() indicates we retrieved all EFI variables, it should be treated as EFI_SUCEESS. To address the checkpatch warning of too many leading tabs, combine two if statement into one. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
ce327084 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: carve out efi_get_next_variable_name_int calls To retrieve the EFI variable name by efi_get_next_variable_name_int(), the sequence of alloc -> efi_get_next_variable_name_int -> realloc -> efi_get_next_variable_name_int is required. In current code, this sequence repeatedly appears in the several functions. It should be curved out a common function. This commit also fixes the missing free() of var_name16 in eficonfig_delete_invalid_boot_option(). Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
140a8959 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use efi_get_next_variable_name_int() eficonfig command reads all possible UEFI load options from 0x0000 to 0xFFFF to construct the menu. This takes too much time in some environment. This commit uses efi_get_next_variable_name_int() to read all existing UEFI load options to significantlly reduce the count of efi_get_var() call. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
78b1ccc4 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use u16_strsize() to get u16 string buffer size Use u16_strsize() to simplify the u16 string buffer size calculation. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c67d3c9e |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix going one directory up issue The directory name in eficonfig menu entry contains the '\' separator. strcmp() argument ".." is wrong and one directory up handling does not work correctly. strcmp() argument must include '\' separator. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c3b5af63 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add UEFI Secure Boot Key enrollment interface This commit adds the menu-driven UEFI Secure Boot Key enrollment interface. User can enroll PK, KEK, db and dbx by selecting file. Only the signed EFI Signature List(s) with an authenticated header, typically '.auth' file, is accepted. To clear the PK, KEK, db and dbx, user needs to enroll the null key signed by PK or KEK. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
21faf4ef |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use protocol interface for file selection EFI_SIMPLE_FILE_SYSTEM_PROTOCOL is not always provided by U-Boot. Use protocol interface functions instead of U-Boot internal functions. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d6566113 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose eficonfig_create_device_path() Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use eficonfig_create_device_path() to construct the full device path from device path of the volume and file path, so move it out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d571f9b2 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation All the eficonfig menus other than "Change Boot Order" use 'eficonfig_entry' structure for each menu entry. This commit refactors change boot order implementation to use 'eficonfig_entry' structure same as other menus to have consistent menu handling. This commit also simplifies the data->active handling when KEY_SPACE is pressed, and sizeof() parameter. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
8961e93e |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose append entry function Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use append_entry() and append_quit_entry() to construct the menu, so move them out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
a84040ab |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor file selection handling eficonfig_select_file_handler() is commonly used to select the file. eficonfig_display_select_file_option() adds an additional menu to clear the selected file. eficonfig_display_select_file_option() is not always necessary for the file selection process, so it must be outside of eficonfig_select_file_handler(). This commit also renames the following functions to avoid confusion. eficonfig_select_file_handler() -> eficonfig_process_select_file() eficonfig_select_file() -> eficonfig_show_file_selection() eficonfig_display_select_file_option() -> eficonfig_process_show_file_option() Finally, test_eficonfig.py need to be updated to get aligned with the above modification. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
1167e88a |
|
14-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix missing variable initialization The 'ret' variable must be initialized before use in eficonfig_delete_invalid_boot_option(). Fixes: c416f1c0bc ("bootmenu: add removable media entries") Addresses-Coverity: 376207 ("Uninitialized variables") Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
3d595ac5 |
|
09-Nov-2022 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: remove superfluous if in eficonfig_edit_boot_option Goto for an immediately succeeding label is superfluous. Fixes: 87d791423ac6 ("eficonfig: menu-driven addition of UEFI boot option") Addresses-Coverity: 376202 ("Identical code for different branches") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
9945bc4f |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Fix incorrect return code of boot option update Correct the return code for out-of-memory and no boot option found Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
339b527b |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Move bootorder and bootoption apis to lib Rename and move bootorder and bootoption apis from cmd to lib for re-use between eficonfig and bootmgr Fix 'unexpected indentation' when 'make htmldocs' after functions are moved Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
2c0b0c31 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_SECURE_BOOT This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_SECURE_BOOT defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
83f3d121 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_MM_COMM_TEE This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_MM_COMM_TEE defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
88df3634 |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: CTRL+S to save the boot order 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>
|
#
45f5319f |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
menu: remove CTRL+C to quit On the sandbox called without "--terminal raw" CTRL+C leaves U-Boot, "ESC/CTRL+C to quit" is misleading. Let's remove CTRL+C to quit key handling from bootmenu and eficonfig menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
|
#
8dbd0a0f |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add vertical scroll support The current eficonfig menu does not support vertical scroll, so it can not display the menu entries greater than the console row size. This commit add the vertial scroll support. The console size is retrieved by SIMPLE_TEXT_OUTPUT_PROTOCOL.QueryMode() service, then calculates the row size for menu entry by subtracting menu header and description row size from the console row size. "start" and "end" are added in the efimenu structure. "start" keeps the menu entry index at the top, "end" keeps the bottom menu entry index. item_data_print() menu function only draws the menu entry between "start" and "end". This commit also fixes the issue that "Save" and "Quit" entries can be moved by BKEY_PLUS in change boot order menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
0d590852 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation This commit removes the change boot order specific menu implementation. The change boot order implementation calls eficonfig_process_common() same as other menus. The change boot order menu requires own item_data_print and item_choice implementation, but display_statusline function can be a same function as other menus. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
cd160b27 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor eficonfig_process_common function Current change boot order implementation does not call eficonfig_process_common() and call own menu functions for display_statusline, item_data_print and item_choice. Change boot order functionality should call eficonfig_process_common() to improve maintenanceability. This commit is a preparation to remove the change boot order specific implementation. The menu functions (display_statusline, item_data_print and item_choice) are added as argument of eficonfig_process_common(). The menu description string displayed at the bottom of the menu is also added as argument. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
32bab0ea |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Make use of CLI character processing Avoid duplicating some of the escape-sequence processing here and use the CLI function instead. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
d0ca98db |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Update bootmenu_loop() to return the code Use the return value to save having to pass around a pointer. This also resolves any ambiguity about what *key contains when the function is called. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
2da4a15e |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Rename KEY_... to BKEY_... This enum values conflict with linux/input.h so rename them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
64550274 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: avoid SetVariable between GetNextVariableName calls The current code calls efi_set_variable_int() to delete the invalid boot option between calls to efi_get_next_variable_name_int(), it may produce unpredictable results. This commit moves removal of the invalid boot option outside of the efi_get_next_variable_name_int() calls. EFI_NOT_FOUND returned from efi_get_next_variable_name_int() indicates we retrieved all EFI variables, it should be treated as EFI_SUCEESS. To address the checkpatch warning of too many leading tabs, combine two if statement into one. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
ce327084 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: carve out efi_get_next_variable_name_int calls To retrieve the EFI variable name by efi_get_next_variable_name_int(), the sequence of alloc -> efi_get_next_variable_name_int -> realloc -> efi_get_next_variable_name_int is required. In current code, this sequence repeatedly appears in the several functions. It should be curved out a common function. This commit also fixes the missing free() of var_name16 in eficonfig_delete_invalid_boot_option(). Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
140a8959 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use efi_get_next_variable_name_int() eficonfig command reads all possible UEFI load options from 0x0000 to 0xFFFF to construct the menu. This takes too much time in some environment. This commit uses efi_get_next_variable_name_int() to read all existing UEFI load options to significantlly reduce the count of efi_get_var() call. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
78b1ccc4 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use u16_strsize() to get u16 string buffer size Use u16_strsize() to simplify the u16 string buffer size calculation. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c67d3c9e |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix going one directory up issue The directory name in eficonfig menu entry contains the '\' separator. strcmp() argument ".." is wrong and one directory up handling does not work correctly. strcmp() argument must include '\' separator. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c3b5af63 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add UEFI Secure Boot Key enrollment interface This commit adds the menu-driven UEFI Secure Boot Key enrollment interface. User can enroll PK, KEK, db and dbx by selecting file. Only the signed EFI Signature List(s) with an authenticated header, typically '.auth' file, is accepted. To clear the PK, KEK, db and dbx, user needs to enroll the null key signed by PK or KEK. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
21faf4ef |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use protocol interface for file selection EFI_SIMPLE_FILE_SYSTEM_PROTOCOL is not always provided by U-Boot. Use protocol interface functions instead of U-Boot internal functions. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d6566113 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose eficonfig_create_device_path() Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use eficonfig_create_device_path() to construct the full device path from device path of the volume and file path, so move it out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d571f9b2 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation All the eficonfig menus other than "Change Boot Order" use 'eficonfig_entry' structure for each menu entry. This commit refactors change boot order implementation to use 'eficonfig_entry' structure same as other menus to have consistent menu handling. This commit also simplifies the data->active handling when KEY_SPACE is pressed, and sizeof() parameter. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
8961e93e |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose append entry function Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use append_entry() and append_quit_entry() to construct the menu, so move them out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
a84040ab |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor file selection handling eficonfig_select_file_handler() is commonly used to select the file. eficonfig_display_select_file_option() adds an additional menu to clear the selected file. eficonfig_display_select_file_option() is not always necessary for the file selection process, so it must be outside of eficonfig_select_file_handler(). This commit also renames the following functions to avoid confusion. eficonfig_select_file_handler() -> eficonfig_process_select_file() eficonfig_select_file() -> eficonfig_show_file_selection() eficonfig_display_select_file_option() -> eficonfig_process_show_file_option() Finally, test_eficonfig.py need to be updated to get aligned with the above modification. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
1167e88a |
|
14-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix missing variable initialization The 'ret' variable must be initialized before use in eficonfig_delete_invalid_boot_option(). Fixes: c416f1c0bc ("bootmenu: add removable media entries") Addresses-Coverity: 376207 ("Uninitialized variables") Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
3d595ac5 |
|
09-Nov-2022 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: remove superfluous if in eficonfig_edit_boot_option Goto for an immediately succeeding label is superfluous. Fixes: 87d791423ac6 ("eficonfig: menu-driven addition of UEFI boot option") Addresses-Coverity: 376202 ("Identical code for different branches") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
9945bc4f |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Fix incorrect return code of boot option update Correct the return code for out-of-memory and no boot option found Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
339b527b |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Move bootorder and bootoption apis to lib Rename and move bootorder and bootoption apis from cmd to lib for re-use between eficonfig and bootmgr Fix 'unexpected indentation' when 'make htmldocs' after functions are moved Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
2c0b0c31 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_SECURE_BOOT This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_SECURE_BOOT defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
83f3d121 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_MM_COMM_TEE This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_MM_COMM_TEE defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
88df3634 |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: CTRL+S to save the boot order 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>
|
#
45f5319f |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
menu: remove CTRL+C to quit On the sandbox called without "--terminal raw" CTRL+C leaves U-Boot, "ESC/CTRL+C to quit" is misleading. Let's remove CTRL+C to quit key handling from bootmenu and eficonfig menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
|
#
8dbd0a0f |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add vertical scroll support The current eficonfig menu does not support vertical scroll, so it can not display the menu entries greater than the console row size. This commit add the vertial scroll support. The console size is retrieved by SIMPLE_TEXT_OUTPUT_PROTOCOL.QueryMode() service, then calculates the row size for menu entry by subtracting menu header and description row size from the console row size. "start" and "end" are added in the efimenu structure. "start" keeps the menu entry index at the top, "end" keeps the bottom menu entry index. item_data_print() menu function only draws the menu entry between "start" and "end". This commit also fixes the issue that "Save" and "Quit" entries can be moved by BKEY_PLUS in change boot order menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
0d590852 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation This commit removes the change boot order specific menu implementation. The change boot order implementation calls eficonfig_process_common() same as other menus. The change boot order menu requires own item_data_print and item_choice implementation, but display_statusline function can be a same function as other menus. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
cd160b27 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor eficonfig_process_common function Current change boot order implementation does not call eficonfig_process_common() and call own menu functions for display_statusline, item_data_print and item_choice. Change boot order functionality should call eficonfig_process_common() to improve maintenanceability. This commit is a preparation to remove the change boot order specific implementation. The menu functions (display_statusline, item_data_print and item_choice) are added as argument of eficonfig_process_common(). The menu description string displayed at the bottom of the menu is also added as argument. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
32bab0ea |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Make use of CLI character processing Avoid duplicating some of the escape-sequence processing here and use the CLI function instead. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
d0ca98db |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Update bootmenu_loop() to return the code Use the return value to save having to pass around a pointer. This also resolves any ambiguity about what *key contains when the function is called. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
2da4a15e |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Rename KEY_... to BKEY_... This enum values conflict with linux/input.h so rename them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
64550274 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: avoid SetVariable between GetNextVariableName calls The current code calls efi_set_variable_int() to delete the invalid boot option between calls to efi_get_next_variable_name_int(), it may produce unpredictable results. This commit moves removal of the invalid boot option outside of the efi_get_next_variable_name_int() calls. EFI_NOT_FOUND returned from efi_get_next_variable_name_int() indicates we retrieved all EFI variables, it should be treated as EFI_SUCEESS. To address the checkpatch warning of too many leading tabs, combine two if statement into one. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
ce327084 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: carve out efi_get_next_variable_name_int calls To retrieve the EFI variable name by efi_get_next_variable_name_int(), the sequence of alloc -> efi_get_next_variable_name_int -> realloc -> efi_get_next_variable_name_int is required. In current code, this sequence repeatedly appears in the several functions. It should be curved out a common function. This commit also fixes the missing free() of var_name16 in eficonfig_delete_invalid_boot_option(). Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
140a8959 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use efi_get_next_variable_name_int() eficonfig command reads all possible UEFI load options from 0x0000 to 0xFFFF to construct the menu. This takes too much time in some environment. This commit uses efi_get_next_variable_name_int() to read all existing UEFI load options to significantlly reduce the count of efi_get_var() call. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
78b1ccc4 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use u16_strsize() to get u16 string buffer size Use u16_strsize() to simplify the u16 string buffer size calculation. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c67d3c9e |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix going one directory up issue The directory name in eficonfig menu entry contains the '\' separator. strcmp() argument ".." is wrong and one directory up handling does not work correctly. strcmp() argument must include '\' separator. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c3b5af63 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add UEFI Secure Boot Key enrollment interface This commit adds the menu-driven UEFI Secure Boot Key enrollment interface. User can enroll PK, KEK, db and dbx by selecting file. Only the signed EFI Signature List(s) with an authenticated header, typically '.auth' file, is accepted. To clear the PK, KEK, db and dbx, user needs to enroll the null key signed by PK or KEK. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
21faf4ef |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use protocol interface for file selection EFI_SIMPLE_FILE_SYSTEM_PROTOCOL is not always provided by U-Boot. Use protocol interface functions instead of U-Boot internal functions. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d6566113 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose eficonfig_create_device_path() Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use eficonfig_create_device_path() to construct the full device path from device path of the volume and file path, so move it out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d571f9b2 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation All the eficonfig menus other than "Change Boot Order" use 'eficonfig_entry' structure for each menu entry. This commit refactors change boot order implementation to use 'eficonfig_entry' structure same as other menus to have consistent menu handling. This commit also simplifies the data->active handling when KEY_SPACE is pressed, and sizeof() parameter. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
8961e93e |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose append entry function Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use append_entry() and append_quit_entry() to construct the menu, so move them out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
a84040ab |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor file selection handling eficonfig_select_file_handler() is commonly used to select the file. eficonfig_display_select_file_option() adds an additional menu to clear the selected file. eficonfig_display_select_file_option() is not always necessary for the file selection process, so it must be outside of eficonfig_select_file_handler(). This commit also renames the following functions to avoid confusion. eficonfig_select_file_handler() -> eficonfig_process_select_file() eficonfig_select_file() -> eficonfig_show_file_selection() eficonfig_display_select_file_option() -> eficonfig_process_show_file_option() Finally, test_eficonfig.py need to be updated to get aligned with the above modification. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
1167e88a |
|
14-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix missing variable initialization The 'ret' variable must be initialized before use in eficonfig_delete_invalid_boot_option(). Fixes: c416f1c0bc ("bootmenu: add removable media entries") Addresses-Coverity: 376207 ("Uninitialized variables") Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
3d595ac5 |
|
09-Nov-2022 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: remove superfluous if in eficonfig_edit_boot_option Goto for an immediately succeeding label is superfluous. Fixes: 87d791423ac6 ("eficonfig: menu-driven addition of UEFI boot option") Addresses-Coverity: 376202 ("Identical code for different branches") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
9945bc4f |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Fix incorrect return code of boot option update Correct the return code for out-of-memory and no boot option found Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
339b527b |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Move bootorder and bootoption apis to lib Rename and move bootorder and bootoption apis from cmd to lib for re-use between eficonfig and bootmgr Fix 'unexpected indentation' when 'make htmldocs' after functions are moved Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
2c0b0c31 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_SECURE_BOOT This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_SECURE_BOOT defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
83f3d121 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_MM_COMM_TEE This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_MM_COMM_TEE defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
88df3634 |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: CTRL+S to save the boot order 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>
|
#
45f5319f |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
menu: remove CTRL+C to quit On the sandbox called without "--terminal raw" CTRL+C leaves U-Boot, "ESC/CTRL+C to quit" is misleading. Let's remove CTRL+C to quit key handling from bootmenu and eficonfig menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
|
#
8dbd0a0f |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add vertical scroll support The current eficonfig menu does not support vertical scroll, so it can not display the menu entries greater than the console row size. This commit add the vertial scroll support. The console size is retrieved by SIMPLE_TEXT_OUTPUT_PROTOCOL.QueryMode() service, then calculates the row size for menu entry by subtracting menu header and description row size from the console row size. "start" and "end" are added in the efimenu structure. "start" keeps the menu entry index at the top, "end" keeps the bottom menu entry index. item_data_print() menu function only draws the menu entry between "start" and "end". This commit also fixes the issue that "Save" and "Quit" entries can be moved by BKEY_PLUS in change boot order menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
0d590852 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation This commit removes the change boot order specific menu implementation. The change boot order implementation calls eficonfig_process_common() same as other menus. The change boot order menu requires own item_data_print and item_choice implementation, but display_statusline function can be a same function as other menus. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
cd160b27 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor eficonfig_process_common function Current change boot order implementation does not call eficonfig_process_common() and call own menu functions for display_statusline, item_data_print and item_choice. Change boot order functionality should call eficonfig_process_common() to improve maintenanceability. This commit is a preparation to remove the change boot order specific implementation. The menu functions (display_statusline, item_data_print and item_choice) are added as argument of eficonfig_process_common(). The menu description string displayed at the bottom of the menu is also added as argument. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
32bab0ea |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Make use of CLI character processing Avoid duplicating some of the escape-sequence processing here and use the CLI function instead. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
d0ca98db |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Update bootmenu_loop() to return the code Use the return value to save having to pass around a pointer. This also resolves any ambiguity about what *key contains when the function is called. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
2da4a15e |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Rename KEY_... to BKEY_... This enum values conflict with linux/input.h so rename them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
64550274 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: avoid SetVariable between GetNextVariableName calls The current code calls efi_set_variable_int() to delete the invalid boot option between calls to efi_get_next_variable_name_int(), it may produce unpredictable results. This commit moves removal of the invalid boot option outside of the efi_get_next_variable_name_int() calls. EFI_NOT_FOUND returned from efi_get_next_variable_name_int() indicates we retrieved all EFI variables, it should be treated as EFI_SUCEESS. To address the checkpatch warning of too many leading tabs, combine two if statement into one. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
ce327084 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: carve out efi_get_next_variable_name_int calls To retrieve the EFI variable name by efi_get_next_variable_name_int(), the sequence of alloc -> efi_get_next_variable_name_int -> realloc -> efi_get_next_variable_name_int is required. In current code, this sequence repeatedly appears in the several functions. It should be curved out a common function. This commit also fixes the missing free() of var_name16 in eficonfig_delete_invalid_boot_option(). Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
140a8959 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use efi_get_next_variable_name_int() eficonfig command reads all possible UEFI load options from 0x0000 to 0xFFFF to construct the menu. This takes too much time in some environment. This commit uses efi_get_next_variable_name_int() to read all existing UEFI load options to significantlly reduce the count of efi_get_var() call. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
78b1ccc4 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use u16_strsize() to get u16 string buffer size Use u16_strsize() to simplify the u16 string buffer size calculation. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c67d3c9e |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix going one directory up issue The directory name in eficonfig menu entry contains the '\' separator. strcmp() argument ".." is wrong and one directory up handling does not work correctly. strcmp() argument must include '\' separator. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c3b5af63 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add UEFI Secure Boot Key enrollment interface This commit adds the menu-driven UEFI Secure Boot Key enrollment interface. User can enroll PK, KEK, db and dbx by selecting file. Only the signed EFI Signature List(s) with an authenticated header, typically '.auth' file, is accepted. To clear the PK, KEK, db and dbx, user needs to enroll the null key signed by PK or KEK. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
21faf4ef |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use protocol interface for file selection EFI_SIMPLE_FILE_SYSTEM_PROTOCOL is not always provided by U-Boot. Use protocol interface functions instead of U-Boot internal functions. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d6566113 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose eficonfig_create_device_path() Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use eficonfig_create_device_path() to construct the full device path from device path of the volume and file path, so move it out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d571f9b2 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation All the eficonfig menus other than "Change Boot Order" use 'eficonfig_entry' structure for each menu entry. This commit refactors change boot order implementation to use 'eficonfig_entry' structure same as other menus to have consistent menu handling. This commit also simplifies the data->active handling when KEY_SPACE is pressed, and sizeof() parameter. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
8961e93e |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose append entry function Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use append_entry() and append_quit_entry() to construct the menu, so move them out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
a84040ab |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor file selection handling eficonfig_select_file_handler() is commonly used to select the file. eficonfig_display_select_file_option() adds an additional menu to clear the selected file. eficonfig_display_select_file_option() is not always necessary for the file selection process, so it must be outside of eficonfig_select_file_handler(). This commit also renames the following functions to avoid confusion. eficonfig_select_file_handler() -> eficonfig_process_select_file() eficonfig_select_file() -> eficonfig_show_file_selection() eficonfig_display_select_file_option() -> eficonfig_process_show_file_option() Finally, test_eficonfig.py need to be updated to get aligned with the above modification. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
1167e88a |
|
14-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix missing variable initialization The 'ret' variable must be initialized before use in eficonfig_delete_invalid_boot_option(). Fixes: c416f1c0bc ("bootmenu: add removable media entries") Addresses-Coverity: 376207 ("Uninitialized variables") Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
3d595ac5 |
|
09-Nov-2022 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: remove superfluous if in eficonfig_edit_boot_option Goto for an immediately succeeding label is superfluous. Fixes: 87d791423ac6 ("eficonfig: menu-driven addition of UEFI boot option") Addresses-Coverity: 376202 ("Identical code for different branches") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
9945bc4f |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Fix incorrect return code of boot option update Correct the return code for out-of-memory and no boot option found Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
339b527b |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Move bootorder and bootoption apis to lib Rename and move bootorder and bootoption apis from cmd to lib for re-use between eficonfig and bootmgr Fix 'unexpected indentation' when 'make htmldocs' after functions are moved Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
2c0b0c31 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_SECURE_BOOT This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_SECURE_BOOT defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
83f3d121 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_MM_COMM_TEE This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_MM_COMM_TEE defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
88df3634 |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: CTRL+S to save the boot order 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>
|
#
45f5319f |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
menu: remove CTRL+C to quit On the sandbox called without "--terminal raw" CTRL+C leaves U-Boot, "ESC/CTRL+C to quit" is misleading. Let's remove CTRL+C to quit key handling from bootmenu and eficonfig menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
|
#
8dbd0a0f |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add vertical scroll support The current eficonfig menu does not support vertical scroll, so it can not display the menu entries greater than the console row size. This commit add the vertial scroll support. The console size is retrieved by SIMPLE_TEXT_OUTPUT_PROTOCOL.QueryMode() service, then calculates the row size for menu entry by subtracting menu header and description row size from the console row size. "start" and "end" are added in the efimenu structure. "start" keeps the menu entry index at the top, "end" keeps the bottom menu entry index. item_data_print() menu function only draws the menu entry between "start" and "end". This commit also fixes the issue that "Save" and "Quit" entries can be moved by BKEY_PLUS in change boot order menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
0d590852 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation This commit removes the change boot order specific menu implementation. The change boot order implementation calls eficonfig_process_common() same as other menus. The change boot order menu requires own item_data_print and item_choice implementation, but display_statusline function can be a same function as other menus. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
cd160b27 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor eficonfig_process_common function Current change boot order implementation does not call eficonfig_process_common() and call own menu functions for display_statusline, item_data_print and item_choice. Change boot order functionality should call eficonfig_process_common() to improve maintenanceability. This commit is a preparation to remove the change boot order specific implementation. The menu functions (display_statusline, item_data_print and item_choice) are added as argument of eficonfig_process_common(). The menu description string displayed at the bottom of the menu is also added as argument. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
32bab0ea |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Make use of CLI character processing Avoid duplicating some of the escape-sequence processing here and use the CLI function instead. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
d0ca98db |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Update bootmenu_loop() to return the code Use the return value to save having to pass around a pointer. This also resolves any ambiguity about what *key contains when the function is called. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
2da4a15e |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Rename KEY_... to BKEY_... This enum values conflict with linux/input.h so rename them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
64550274 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: avoid SetVariable between GetNextVariableName calls The current code calls efi_set_variable_int() to delete the invalid boot option between calls to efi_get_next_variable_name_int(), it may produce unpredictable results. This commit moves removal of the invalid boot option outside of the efi_get_next_variable_name_int() calls. EFI_NOT_FOUND returned from efi_get_next_variable_name_int() indicates we retrieved all EFI variables, it should be treated as EFI_SUCEESS. To address the checkpatch warning of too many leading tabs, combine two if statement into one. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
ce327084 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: carve out efi_get_next_variable_name_int calls To retrieve the EFI variable name by efi_get_next_variable_name_int(), the sequence of alloc -> efi_get_next_variable_name_int -> realloc -> efi_get_next_variable_name_int is required. In current code, this sequence repeatedly appears in the several functions. It should be curved out a common function. This commit also fixes the missing free() of var_name16 in eficonfig_delete_invalid_boot_option(). Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
140a8959 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use efi_get_next_variable_name_int() eficonfig command reads all possible UEFI load options from 0x0000 to 0xFFFF to construct the menu. This takes too much time in some environment. This commit uses efi_get_next_variable_name_int() to read all existing UEFI load options to significantlly reduce the count of efi_get_var() call. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
78b1ccc4 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use u16_strsize() to get u16 string buffer size Use u16_strsize() to simplify the u16 string buffer size calculation. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c67d3c9e |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix going one directory up issue The directory name in eficonfig menu entry contains the '\' separator. strcmp() argument ".." is wrong and one directory up handling does not work correctly. strcmp() argument must include '\' separator. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c3b5af63 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add UEFI Secure Boot Key enrollment interface This commit adds the menu-driven UEFI Secure Boot Key enrollment interface. User can enroll PK, KEK, db and dbx by selecting file. Only the signed EFI Signature List(s) with an authenticated header, typically '.auth' file, is accepted. To clear the PK, KEK, db and dbx, user needs to enroll the null key signed by PK or KEK. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
21faf4ef |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use protocol interface for file selection EFI_SIMPLE_FILE_SYSTEM_PROTOCOL is not always provided by U-Boot. Use protocol interface functions instead of U-Boot internal functions. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d6566113 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose eficonfig_create_device_path() Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use eficonfig_create_device_path() to construct the full device path from device path of the volume and file path, so move it out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d571f9b2 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation All the eficonfig menus other than "Change Boot Order" use 'eficonfig_entry' structure for each menu entry. This commit refactors change boot order implementation to use 'eficonfig_entry' structure same as other menus to have consistent menu handling. This commit also simplifies the data->active handling when KEY_SPACE is pressed, and sizeof() parameter. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
8961e93e |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose append entry function Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use append_entry() and append_quit_entry() to construct the menu, so move them out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
a84040ab |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor file selection handling eficonfig_select_file_handler() is commonly used to select the file. eficonfig_display_select_file_option() adds an additional menu to clear the selected file. eficonfig_display_select_file_option() is not always necessary for the file selection process, so it must be outside of eficonfig_select_file_handler(). This commit also renames the following functions to avoid confusion. eficonfig_select_file_handler() -> eficonfig_process_select_file() eficonfig_select_file() -> eficonfig_show_file_selection() eficonfig_display_select_file_option() -> eficonfig_process_show_file_option() Finally, test_eficonfig.py need to be updated to get aligned with the above modification. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
1167e88a |
|
14-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix missing variable initialization The 'ret' variable must be initialized before use in eficonfig_delete_invalid_boot_option(). Fixes: c416f1c0bc ("bootmenu: add removable media entries") Addresses-Coverity: 376207 ("Uninitialized variables") Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
3d595ac5 |
|
09-Nov-2022 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: remove superfluous if in eficonfig_edit_boot_option Goto for an immediately succeeding label is superfluous. Fixes: 87d791423ac6 ("eficonfig: menu-driven addition of UEFI boot option") Addresses-Coverity: 376202 ("Identical code for different branches") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
9945bc4f |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Fix incorrect return code of boot option update Correct the return code for out-of-memory and no boot option found Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
339b527b |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Move bootorder and bootoption apis to lib Rename and move bootorder and bootoption apis from cmd to lib for re-use between eficonfig and bootmgr Fix 'unexpected indentation' when 'make htmldocs' after functions are moved Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
2c0b0c31 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_SECURE_BOOT This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_SECURE_BOOT defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
83f3d121 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_MM_COMM_TEE This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_MM_COMM_TEE defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
88df3634 |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: CTRL+S to save the boot order 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>
|
#
45f5319f |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
menu: remove CTRL+C to quit On the sandbox called without "--terminal raw" CTRL+C leaves U-Boot, "ESC/CTRL+C to quit" is misleading. Let's remove CTRL+C to quit key handling from bootmenu and eficonfig menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
|
#
8dbd0a0f |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add vertical scroll support The current eficonfig menu does not support vertical scroll, so it can not display the menu entries greater than the console row size. This commit add the vertial scroll support. The console size is retrieved by SIMPLE_TEXT_OUTPUT_PROTOCOL.QueryMode() service, then calculates the row size for menu entry by subtracting menu header and description row size from the console row size. "start" and "end" are added in the efimenu structure. "start" keeps the menu entry index at the top, "end" keeps the bottom menu entry index. item_data_print() menu function only draws the menu entry between "start" and "end". This commit also fixes the issue that "Save" and "Quit" entries can be moved by BKEY_PLUS in change boot order menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
0d590852 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation This commit removes the change boot order specific menu implementation. The change boot order implementation calls eficonfig_process_common() same as other menus. The change boot order menu requires own item_data_print and item_choice implementation, but display_statusline function can be a same function as other menus. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
cd160b27 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor eficonfig_process_common function Current change boot order implementation does not call eficonfig_process_common() and call own menu functions for display_statusline, item_data_print and item_choice. Change boot order functionality should call eficonfig_process_common() to improve maintenanceability. This commit is a preparation to remove the change boot order specific implementation. The menu functions (display_statusline, item_data_print and item_choice) are added as argument of eficonfig_process_common(). The menu description string displayed at the bottom of the menu is also added as argument. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
32bab0ea |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Make use of CLI character processing Avoid duplicating some of the escape-sequence processing here and use the CLI function instead. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
d0ca98db |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Update bootmenu_loop() to return the code Use the return value to save having to pass around a pointer. This also resolves any ambiguity about what *key contains when the function is called. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
2da4a15e |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Rename KEY_... to BKEY_... This enum values conflict with linux/input.h so rename them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
64550274 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: avoid SetVariable between GetNextVariableName calls The current code calls efi_set_variable_int() to delete the invalid boot option between calls to efi_get_next_variable_name_int(), it may produce unpredictable results. This commit moves removal of the invalid boot option outside of the efi_get_next_variable_name_int() calls. EFI_NOT_FOUND returned from efi_get_next_variable_name_int() indicates we retrieved all EFI variables, it should be treated as EFI_SUCEESS. To address the checkpatch warning of too many leading tabs, combine two if statement into one. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
ce327084 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: carve out efi_get_next_variable_name_int calls To retrieve the EFI variable name by efi_get_next_variable_name_int(), the sequence of alloc -> efi_get_next_variable_name_int -> realloc -> efi_get_next_variable_name_int is required. In current code, this sequence repeatedly appears in the several functions. It should be curved out a common function. This commit also fixes the missing free() of var_name16 in eficonfig_delete_invalid_boot_option(). Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
140a8959 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use efi_get_next_variable_name_int() eficonfig command reads all possible UEFI load options from 0x0000 to 0xFFFF to construct the menu. This takes too much time in some environment. This commit uses efi_get_next_variable_name_int() to read all existing UEFI load options to significantlly reduce the count of efi_get_var() call. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
78b1ccc4 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use u16_strsize() to get u16 string buffer size Use u16_strsize() to simplify the u16 string buffer size calculation. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c67d3c9e |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix going one directory up issue The directory name in eficonfig menu entry contains the '\' separator. strcmp() argument ".." is wrong and one directory up handling does not work correctly. strcmp() argument must include '\' separator. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c3b5af63 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add UEFI Secure Boot Key enrollment interface This commit adds the menu-driven UEFI Secure Boot Key enrollment interface. User can enroll PK, KEK, db and dbx by selecting file. Only the signed EFI Signature List(s) with an authenticated header, typically '.auth' file, is accepted. To clear the PK, KEK, db and dbx, user needs to enroll the null key signed by PK or KEK. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
21faf4ef |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use protocol interface for file selection EFI_SIMPLE_FILE_SYSTEM_PROTOCOL is not always provided by U-Boot. Use protocol interface functions instead of U-Boot internal functions. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d6566113 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose eficonfig_create_device_path() Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use eficonfig_create_device_path() to construct the full device path from device path of the volume and file path, so move it out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d571f9b2 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation All the eficonfig menus other than "Change Boot Order" use 'eficonfig_entry' structure for each menu entry. This commit refactors change boot order implementation to use 'eficonfig_entry' structure same as other menus to have consistent menu handling. This commit also simplifies the data->active handling when KEY_SPACE is pressed, and sizeof() parameter. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
8961e93e |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose append entry function Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use append_entry() and append_quit_entry() to construct the menu, so move them out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
a84040ab |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor file selection handling eficonfig_select_file_handler() is commonly used to select the file. eficonfig_display_select_file_option() adds an additional menu to clear the selected file. eficonfig_display_select_file_option() is not always necessary for the file selection process, so it must be outside of eficonfig_select_file_handler(). This commit also renames the following functions to avoid confusion. eficonfig_select_file_handler() -> eficonfig_process_select_file() eficonfig_select_file() -> eficonfig_show_file_selection() eficonfig_display_select_file_option() -> eficonfig_process_show_file_option() Finally, test_eficonfig.py need to be updated to get aligned with the above modification. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
1167e88a |
|
14-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix missing variable initialization The 'ret' variable must be initialized before use in eficonfig_delete_invalid_boot_option(). Fixes: c416f1c0bc ("bootmenu: add removable media entries") Addresses-Coverity: 376207 ("Uninitialized variables") Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
3d595ac5 |
|
09-Nov-2022 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: remove superfluous if in eficonfig_edit_boot_option Goto for an immediately succeeding label is superfluous. Fixes: 87d791423ac6 ("eficonfig: menu-driven addition of UEFI boot option") Addresses-Coverity: 376202 ("Identical code for different branches") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
9945bc4f |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Fix incorrect return code of boot option update Correct the return code for out-of-memory and no boot option found Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
339b527b |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Move bootorder and bootoption apis to lib Rename and move bootorder and bootoption apis from cmd to lib for re-use between eficonfig and bootmgr Fix 'unexpected indentation' when 'make htmldocs' after functions are moved Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
2c0b0c31 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_SECURE_BOOT This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_SECURE_BOOT defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
83f3d121 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_MM_COMM_TEE This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_MM_COMM_TEE defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
88df3634 |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: CTRL+S to save the boot order 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>
|
#
45f5319f |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
menu: remove CTRL+C to quit On the sandbox called without "--terminal raw" CTRL+C leaves U-Boot, "ESC/CTRL+C to quit" is misleading. Let's remove CTRL+C to quit key handling from bootmenu and eficonfig menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
|
#
8dbd0a0f |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add vertical scroll support The current eficonfig menu does not support vertical scroll, so it can not display the menu entries greater than the console row size. This commit add the vertial scroll support. The console size is retrieved by SIMPLE_TEXT_OUTPUT_PROTOCOL.QueryMode() service, then calculates the row size for menu entry by subtracting menu header and description row size from the console row size. "start" and "end" are added in the efimenu structure. "start" keeps the menu entry index at the top, "end" keeps the bottom menu entry index. item_data_print() menu function only draws the menu entry between "start" and "end". This commit also fixes the issue that "Save" and "Quit" entries can be moved by BKEY_PLUS in change boot order menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
0d590852 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation This commit removes the change boot order specific menu implementation. The change boot order implementation calls eficonfig_process_common() same as other menus. The change boot order menu requires own item_data_print and item_choice implementation, but display_statusline function can be a same function as other menus. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
cd160b27 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor eficonfig_process_common function Current change boot order implementation does not call eficonfig_process_common() and call own menu functions for display_statusline, item_data_print and item_choice. Change boot order functionality should call eficonfig_process_common() to improve maintenanceability. This commit is a preparation to remove the change boot order specific implementation. The menu functions (display_statusline, item_data_print and item_choice) are added as argument of eficonfig_process_common(). The menu description string displayed at the bottom of the menu is also added as argument. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
32bab0ea |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Make use of CLI character processing Avoid duplicating some of the escape-sequence processing here and use the CLI function instead. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
d0ca98db |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Update bootmenu_loop() to return the code Use the return value to save having to pass around a pointer. This also resolves any ambiguity about what *key contains when the function is called. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
2da4a15e |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Rename KEY_... to BKEY_... This enum values conflict with linux/input.h so rename them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
64550274 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: avoid SetVariable between GetNextVariableName calls The current code calls efi_set_variable_int() to delete the invalid boot option between calls to efi_get_next_variable_name_int(), it may produce unpredictable results. This commit moves removal of the invalid boot option outside of the efi_get_next_variable_name_int() calls. EFI_NOT_FOUND returned from efi_get_next_variable_name_int() indicates we retrieved all EFI variables, it should be treated as EFI_SUCEESS. To address the checkpatch warning of too many leading tabs, combine two if statement into one. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
ce327084 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: carve out efi_get_next_variable_name_int calls To retrieve the EFI variable name by efi_get_next_variable_name_int(), the sequence of alloc -> efi_get_next_variable_name_int -> realloc -> efi_get_next_variable_name_int is required. In current code, this sequence repeatedly appears in the several functions. It should be curved out a common function. This commit also fixes the missing free() of var_name16 in eficonfig_delete_invalid_boot_option(). Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
140a8959 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use efi_get_next_variable_name_int() eficonfig command reads all possible UEFI load options from 0x0000 to 0xFFFF to construct the menu. This takes too much time in some environment. This commit uses efi_get_next_variable_name_int() to read all existing UEFI load options to significantlly reduce the count of efi_get_var() call. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
78b1ccc4 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use u16_strsize() to get u16 string buffer size Use u16_strsize() to simplify the u16 string buffer size calculation. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c67d3c9e |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix going one directory up issue The directory name in eficonfig menu entry contains the '\' separator. strcmp() argument ".." is wrong and one directory up handling does not work correctly. strcmp() argument must include '\' separator. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c3b5af63 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add UEFI Secure Boot Key enrollment interface This commit adds the menu-driven UEFI Secure Boot Key enrollment interface. User can enroll PK, KEK, db and dbx by selecting file. Only the signed EFI Signature List(s) with an authenticated header, typically '.auth' file, is accepted. To clear the PK, KEK, db and dbx, user needs to enroll the null key signed by PK or KEK. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
21faf4ef |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use protocol interface for file selection EFI_SIMPLE_FILE_SYSTEM_PROTOCOL is not always provided by U-Boot. Use protocol interface functions instead of U-Boot internal functions. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d6566113 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose eficonfig_create_device_path() Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use eficonfig_create_device_path() to construct the full device path from device path of the volume and file path, so move it out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d571f9b2 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation All the eficonfig menus other than "Change Boot Order" use 'eficonfig_entry' structure for each menu entry. This commit refactors change boot order implementation to use 'eficonfig_entry' structure same as other menus to have consistent menu handling. This commit also simplifies the data->active handling when KEY_SPACE is pressed, and sizeof() parameter. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
8961e93e |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose append entry function Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use append_entry() and append_quit_entry() to construct the menu, so move them out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
a84040ab |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor file selection handling eficonfig_select_file_handler() is commonly used to select the file. eficonfig_display_select_file_option() adds an additional menu to clear the selected file. eficonfig_display_select_file_option() is not always necessary for the file selection process, so it must be outside of eficonfig_select_file_handler(). This commit also renames the following functions to avoid confusion. eficonfig_select_file_handler() -> eficonfig_process_select_file() eficonfig_select_file() -> eficonfig_show_file_selection() eficonfig_display_select_file_option() -> eficonfig_process_show_file_option() Finally, test_eficonfig.py need to be updated to get aligned with the above modification. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
1167e88a |
|
14-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix missing variable initialization The 'ret' variable must be initialized before use in eficonfig_delete_invalid_boot_option(). Fixes: c416f1c0bc ("bootmenu: add removable media entries") Addresses-Coverity: 376207 ("Uninitialized variables") Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
3d595ac5 |
|
09-Nov-2022 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: remove superfluous if in eficonfig_edit_boot_option Goto for an immediately succeeding label is superfluous. Fixes: 87d791423ac6 ("eficonfig: menu-driven addition of UEFI boot option") Addresses-Coverity: 376202 ("Identical code for different branches") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
9945bc4f |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Fix incorrect return code of boot option update Correct the return code for out-of-memory and no boot option found Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
339b527b |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Move bootorder and bootoption apis to lib Rename and move bootorder and bootoption apis from cmd to lib for re-use between eficonfig and bootmgr Fix 'unexpected indentation' when 'make htmldocs' after functions are moved Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
2c0b0c31 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_SECURE_BOOT This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_SECURE_BOOT defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
83f3d121 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_MM_COMM_TEE This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_MM_COMM_TEE defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
88df3634 |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: CTRL+S to save the boot order 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>
|
#
45f5319f |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
menu: remove CTRL+C to quit On the sandbox called without "--terminal raw" CTRL+C leaves U-Boot, "ESC/CTRL+C to quit" is misleading. Let's remove CTRL+C to quit key handling from bootmenu and eficonfig menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
|
#
8dbd0a0f |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add vertical scroll support The current eficonfig menu does not support vertical scroll, so it can not display the menu entries greater than the console row size. This commit add the vertial scroll support. The console size is retrieved by SIMPLE_TEXT_OUTPUT_PROTOCOL.QueryMode() service, then calculates the row size for menu entry by subtracting menu header and description row size from the console row size. "start" and "end" are added in the efimenu structure. "start" keeps the menu entry index at the top, "end" keeps the bottom menu entry index. item_data_print() menu function only draws the menu entry between "start" and "end". This commit also fixes the issue that "Save" and "Quit" entries can be moved by BKEY_PLUS in change boot order menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
0d590852 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation This commit removes the change boot order specific menu implementation. The change boot order implementation calls eficonfig_process_common() same as other menus. The change boot order menu requires own item_data_print and item_choice implementation, but display_statusline function can be a same function as other menus. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
cd160b27 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor eficonfig_process_common function Current change boot order implementation does not call eficonfig_process_common() and call own menu functions for display_statusline, item_data_print and item_choice. Change boot order functionality should call eficonfig_process_common() to improve maintenanceability. This commit is a preparation to remove the change boot order specific implementation. The menu functions (display_statusline, item_data_print and item_choice) are added as argument of eficonfig_process_common(). The menu description string displayed at the bottom of the menu is also added as argument. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
32bab0ea |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Make use of CLI character processing Avoid duplicating some of the escape-sequence processing here and use the CLI function instead. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
d0ca98db |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Update bootmenu_loop() to return the code Use the return value to save having to pass around a pointer. This also resolves any ambiguity about what *key contains when the function is called. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
2da4a15e |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Rename KEY_... to BKEY_... This enum values conflict with linux/input.h so rename them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
64550274 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: avoid SetVariable between GetNextVariableName calls The current code calls efi_set_variable_int() to delete the invalid boot option between calls to efi_get_next_variable_name_int(), it may produce unpredictable results. This commit moves removal of the invalid boot option outside of the efi_get_next_variable_name_int() calls. EFI_NOT_FOUND returned from efi_get_next_variable_name_int() indicates we retrieved all EFI variables, it should be treated as EFI_SUCEESS. To address the checkpatch warning of too many leading tabs, combine two if statement into one. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
ce327084 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: carve out efi_get_next_variable_name_int calls To retrieve the EFI variable name by efi_get_next_variable_name_int(), the sequence of alloc -> efi_get_next_variable_name_int -> realloc -> efi_get_next_variable_name_int is required. In current code, this sequence repeatedly appears in the several functions. It should be curved out a common function. This commit also fixes the missing free() of var_name16 in eficonfig_delete_invalid_boot_option(). Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
140a8959 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use efi_get_next_variable_name_int() eficonfig command reads all possible UEFI load options from 0x0000 to 0xFFFF to construct the menu. This takes too much time in some environment. This commit uses efi_get_next_variable_name_int() to read all existing UEFI load options to significantlly reduce the count of efi_get_var() call. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
78b1ccc4 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use u16_strsize() to get u16 string buffer size Use u16_strsize() to simplify the u16 string buffer size calculation. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c67d3c9e |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix going one directory up issue The directory name in eficonfig menu entry contains the '\' separator. strcmp() argument ".." is wrong and one directory up handling does not work correctly. strcmp() argument must include '\' separator. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c3b5af63 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add UEFI Secure Boot Key enrollment interface This commit adds the menu-driven UEFI Secure Boot Key enrollment interface. User can enroll PK, KEK, db and dbx by selecting file. Only the signed EFI Signature List(s) with an authenticated header, typically '.auth' file, is accepted. To clear the PK, KEK, db and dbx, user needs to enroll the null key signed by PK or KEK. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
21faf4ef |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use protocol interface for file selection EFI_SIMPLE_FILE_SYSTEM_PROTOCOL is not always provided by U-Boot. Use protocol interface functions instead of U-Boot internal functions. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d6566113 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose eficonfig_create_device_path() Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use eficonfig_create_device_path() to construct the full device path from device path of the volume and file path, so move it out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d571f9b2 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation All the eficonfig menus other than "Change Boot Order" use 'eficonfig_entry' structure for each menu entry. This commit refactors change boot order implementation to use 'eficonfig_entry' structure same as other menus to have consistent menu handling. This commit also simplifies the data->active handling when KEY_SPACE is pressed, and sizeof() parameter. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
8961e93e |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose append entry function Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use append_entry() and append_quit_entry() to construct the menu, so move them out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
a84040ab |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor file selection handling eficonfig_select_file_handler() is commonly used to select the file. eficonfig_display_select_file_option() adds an additional menu to clear the selected file. eficonfig_display_select_file_option() is not always necessary for the file selection process, so it must be outside of eficonfig_select_file_handler(). This commit also renames the following functions to avoid confusion. eficonfig_select_file_handler() -> eficonfig_process_select_file() eficonfig_select_file() -> eficonfig_show_file_selection() eficonfig_display_select_file_option() -> eficonfig_process_show_file_option() Finally, test_eficonfig.py need to be updated to get aligned with the above modification. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
1167e88a |
|
14-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix missing variable initialization The 'ret' variable must be initialized before use in eficonfig_delete_invalid_boot_option(). Fixes: c416f1c0bc ("bootmenu: add removable media entries") Addresses-Coverity: 376207 ("Uninitialized variables") Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
3d595ac5 |
|
09-Nov-2022 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: remove superfluous if in eficonfig_edit_boot_option Goto for an immediately succeeding label is superfluous. Fixes: 87d791423ac6 ("eficonfig: menu-driven addition of UEFI boot option") Addresses-Coverity: 376202 ("Identical code for different branches") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
9945bc4f |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Fix incorrect return code of boot option update Correct the return code for out-of-memory and no boot option found Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
339b527b |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Move bootorder and bootoption apis to lib Rename and move bootorder and bootoption apis from cmd to lib for re-use between eficonfig and bootmgr Fix 'unexpected indentation' when 'make htmldocs' after functions are moved Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
2c0b0c31 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_SECURE_BOOT This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_SECURE_BOOT defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
83f3d121 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_MM_COMM_TEE This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_MM_COMM_TEE defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
88df3634 |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: CTRL+S to save the boot order 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>
|
#
45f5319f |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
menu: remove CTRL+C to quit On the sandbox called without "--terminal raw" CTRL+C leaves U-Boot, "ESC/CTRL+C to quit" is misleading. Let's remove CTRL+C to quit key handling from bootmenu and eficonfig menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
|
#
8dbd0a0f |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add vertical scroll support The current eficonfig menu does not support vertical scroll, so it can not display the menu entries greater than the console row size. This commit add the vertial scroll support. The console size is retrieved by SIMPLE_TEXT_OUTPUT_PROTOCOL.QueryMode() service, then calculates the row size for menu entry by subtracting menu header and description row size from the console row size. "start" and "end" are added in the efimenu structure. "start" keeps the menu entry index at the top, "end" keeps the bottom menu entry index. item_data_print() menu function only draws the menu entry between "start" and "end". This commit also fixes the issue that "Save" and "Quit" entries can be moved by BKEY_PLUS in change boot order menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
0d590852 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation This commit removes the change boot order specific menu implementation. The change boot order implementation calls eficonfig_process_common() same as other menus. The change boot order menu requires own item_data_print and item_choice implementation, but display_statusline function can be a same function as other menus. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
cd160b27 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor eficonfig_process_common function Current change boot order implementation does not call eficonfig_process_common() and call own menu functions for display_statusline, item_data_print and item_choice. Change boot order functionality should call eficonfig_process_common() to improve maintenanceability. This commit is a preparation to remove the change boot order specific implementation. The menu functions (display_statusline, item_data_print and item_choice) are added as argument of eficonfig_process_common(). The menu description string displayed at the bottom of the menu is also added as argument. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
32bab0ea |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Make use of CLI character processing Avoid duplicating some of the escape-sequence processing here and use the CLI function instead. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
d0ca98db |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Update bootmenu_loop() to return the code Use the return value to save having to pass around a pointer. This also resolves any ambiguity about what *key contains when the function is called. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
2da4a15e |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Rename KEY_... to BKEY_... This enum values conflict with linux/input.h so rename them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
64550274 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: avoid SetVariable between GetNextVariableName calls The current code calls efi_set_variable_int() to delete the invalid boot option between calls to efi_get_next_variable_name_int(), it may produce unpredictable results. This commit moves removal of the invalid boot option outside of the efi_get_next_variable_name_int() calls. EFI_NOT_FOUND returned from efi_get_next_variable_name_int() indicates we retrieved all EFI variables, it should be treated as EFI_SUCEESS. To address the checkpatch warning of too many leading tabs, combine two if statement into one. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
ce327084 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: carve out efi_get_next_variable_name_int calls To retrieve the EFI variable name by efi_get_next_variable_name_int(), the sequence of alloc -> efi_get_next_variable_name_int -> realloc -> efi_get_next_variable_name_int is required. In current code, this sequence repeatedly appears in the several functions. It should be curved out a common function. This commit also fixes the missing free() of var_name16 in eficonfig_delete_invalid_boot_option(). Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
140a8959 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use efi_get_next_variable_name_int() eficonfig command reads all possible UEFI load options from 0x0000 to 0xFFFF to construct the menu. This takes too much time in some environment. This commit uses efi_get_next_variable_name_int() to read all existing UEFI load options to significantlly reduce the count of efi_get_var() call. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
78b1ccc4 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use u16_strsize() to get u16 string buffer size Use u16_strsize() to simplify the u16 string buffer size calculation. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c67d3c9e |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix going one directory up issue The directory name in eficonfig menu entry contains the '\' separator. strcmp() argument ".." is wrong and one directory up handling does not work correctly. strcmp() argument must include '\' separator. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c3b5af63 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add UEFI Secure Boot Key enrollment interface This commit adds the menu-driven UEFI Secure Boot Key enrollment interface. User can enroll PK, KEK, db and dbx by selecting file. Only the signed EFI Signature List(s) with an authenticated header, typically '.auth' file, is accepted. To clear the PK, KEK, db and dbx, user needs to enroll the null key signed by PK or KEK. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
21faf4ef |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use protocol interface for file selection EFI_SIMPLE_FILE_SYSTEM_PROTOCOL is not always provided by U-Boot. Use protocol interface functions instead of U-Boot internal functions. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d6566113 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose eficonfig_create_device_path() Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use eficonfig_create_device_path() to construct the full device path from device path of the volume and file path, so move it out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d571f9b2 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation All the eficonfig menus other than "Change Boot Order" use 'eficonfig_entry' structure for each menu entry. This commit refactors change boot order implementation to use 'eficonfig_entry' structure same as other menus to have consistent menu handling. This commit also simplifies the data->active handling when KEY_SPACE is pressed, and sizeof() parameter. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
8961e93e |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose append entry function Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use append_entry() and append_quit_entry() to construct the menu, so move them out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
a84040ab |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor file selection handling eficonfig_select_file_handler() is commonly used to select the file. eficonfig_display_select_file_option() adds an additional menu to clear the selected file. eficonfig_display_select_file_option() is not always necessary for the file selection process, so it must be outside of eficonfig_select_file_handler(). This commit also renames the following functions to avoid confusion. eficonfig_select_file_handler() -> eficonfig_process_select_file() eficonfig_select_file() -> eficonfig_show_file_selection() eficonfig_display_select_file_option() -> eficonfig_process_show_file_option() Finally, test_eficonfig.py need to be updated to get aligned with the above modification. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
1167e88a |
|
14-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix missing variable initialization The 'ret' variable must be initialized before use in eficonfig_delete_invalid_boot_option(). Fixes: c416f1c0bc ("bootmenu: add removable media entries") Addresses-Coverity: 376207 ("Uninitialized variables") Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
3d595ac5 |
|
09-Nov-2022 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: remove superfluous if in eficonfig_edit_boot_option Goto for an immediately succeeding label is superfluous. Fixes: 87d791423ac6 ("eficonfig: menu-driven addition of UEFI boot option") Addresses-Coverity: 376202 ("Identical code for different branches") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
9945bc4f |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Fix incorrect return code of boot option update Correct the return code for out-of-memory and no boot option found Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
339b527b |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Move bootorder and bootoption apis to lib Rename and move bootorder and bootoption apis from cmd to lib for re-use between eficonfig and bootmgr Fix 'unexpected indentation' when 'make htmldocs' after functions are moved Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
2c0b0c31 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_SECURE_BOOT This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_SECURE_BOOT defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
83f3d121 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_MM_COMM_TEE This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_MM_COMM_TEE defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
88df3634 |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: CTRL+S to save the boot order 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>
|
#
45f5319f |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
menu: remove CTRL+C to quit On the sandbox called without "--terminal raw" CTRL+C leaves U-Boot, "ESC/CTRL+C to quit" is misleading. Let's remove CTRL+C to quit key handling from bootmenu and eficonfig menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
|
#
8dbd0a0f |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add vertical scroll support The current eficonfig menu does not support vertical scroll, so it can not display the menu entries greater than the console row size. This commit add the vertial scroll support. The console size is retrieved by SIMPLE_TEXT_OUTPUT_PROTOCOL.QueryMode() service, then calculates the row size for menu entry by subtracting menu header and description row size from the console row size. "start" and "end" are added in the efimenu structure. "start" keeps the menu entry index at the top, "end" keeps the bottom menu entry index. item_data_print() menu function only draws the menu entry between "start" and "end". This commit also fixes the issue that "Save" and "Quit" entries can be moved by BKEY_PLUS in change boot order menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
0d590852 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation This commit removes the change boot order specific menu implementation. The change boot order implementation calls eficonfig_process_common() same as other menus. The change boot order menu requires own item_data_print and item_choice implementation, but display_statusline function can be a same function as other menus. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
cd160b27 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor eficonfig_process_common function Current change boot order implementation does not call eficonfig_process_common() and call own menu functions for display_statusline, item_data_print and item_choice. Change boot order functionality should call eficonfig_process_common() to improve maintenanceability. This commit is a preparation to remove the change boot order specific implementation. The menu functions (display_statusline, item_data_print and item_choice) are added as argument of eficonfig_process_common(). The menu description string displayed at the bottom of the menu is also added as argument. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
32bab0ea |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Make use of CLI character processing Avoid duplicating some of the escape-sequence processing here and use the CLI function instead. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
d0ca98db |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Update bootmenu_loop() to return the code Use the return value to save having to pass around a pointer. This also resolves any ambiguity about what *key contains when the function is called. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
2da4a15e |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Rename KEY_... to BKEY_... This enum values conflict with linux/input.h so rename them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
64550274 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: avoid SetVariable between GetNextVariableName calls The current code calls efi_set_variable_int() to delete the invalid boot option between calls to efi_get_next_variable_name_int(), it may produce unpredictable results. This commit moves removal of the invalid boot option outside of the efi_get_next_variable_name_int() calls. EFI_NOT_FOUND returned from efi_get_next_variable_name_int() indicates we retrieved all EFI variables, it should be treated as EFI_SUCEESS. To address the checkpatch warning of too many leading tabs, combine two if statement into one. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
ce327084 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: carve out efi_get_next_variable_name_int calls To retrieve the EFI variable name by efi_get_next_variable_name_int(), the sequence of alloc -> efi_get_next_variable_name_int -> realloc -> efi_get_next_variable_name_int is required. In current code, this sequence repeatedly appears in the several functions. It should be curved out a common function. This commit also fixes the missing free() of var_name16 in eficonfig_delete_invalid_boot_option(). Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
140a8959 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use efi_get_next_variable_name_int() eficonfig command reads all possible UEFI load options from 0x0000 to 0xFFFF to construct the menu. This takes too much time in some environment. This commit uses efi_get_next_variable_name_int() to read all existing UEFI load options to significantlly reduce the count of efi_get_var() call. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
78b1ccc4 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use u16_strsize() to get u16 string buffer size Use u16_strsize() to simplify the u16 string buffer size calculation. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c67d3c9e |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix going one directory up issue The directory name in eficonfig menu entry contains the '\' separator. strcmp() argument ".." is wrong and one directory up handling does not work correctly. strcmp() argument must include '\' separator. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c3b5af63 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add UEFI Secure Boot Key enrollment interface This commit adds the menu-driven UEFI Secure Boot Key enrollment interface. User can enroll PK, KEK, db and dbx by selecting file. Only the signed EFI Signature List(s) with an authenticated header, typically '.auth' file, is accepted. To clear the PK, KEK, db and dbx, user needs to enroll the null key signed by PK or KEK. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
21faf4ef |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use protocol interface for file selection EFI_SIMPLE_FILE_SYSTEM_PROTOCOL is not always provided by U-Boot. Use protocol interface functions instead of U-Boot internal functions. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d6566113 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose eficonfig_create_device_path() Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use eficonfig_create_device_path() to construct the full device path from device path of the volume and file path, so move it out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d571f9b2 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation All the eficonfig menus other than "Change Boot Order" use 'eficonfig_entry' structure for each menu entry. This commit refactors change boot order implementation to use 'eficonfig_entry' structure same as other menus to have consistent menu handling. This commit also simplifies the data->active handling when KEY_SPACE is pressed, and sizeof() parameter. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
8961e93e |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose append entry function Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use append_entry() and append_quit_entry() to construct the menu, so move them out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
a84040ab |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor file selection handling eficonfig_select_file_handler() is commonly used to select the file. eficonfig_display_select_file_option() adds an additional menu to clear the selected file. eficonfig_display_select_file_option() is not always necessary for the file selection process, so it must be outside of eficonfig_select_file_handler(). This commit also renames the following functions to avoid confusion. eficonfig_select_file_handler() -> eficonfig_process_select_file() eficonfig_select_file() -> eficonfig_show_file_selection() eficonfig_display_select_file_option() -> eficonfig_process_show_file_option() Finally, test_eficonfig.py need to be updated to get aligned with the above modification. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
1167e88a |
|
14-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix missing variable initialization The 'ret' variable must be initialized before use in eficonfig_delete_invalid_boot_option(). Fixes: c416f1c0bc ("bootmenu: add removable media entries") Addresses-Coverity: 376207 ("Uninitialized variables") Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
3d595ac5 |
|
09-Nov-2022 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: remove superfluous if in eficonfig_edit_boot_option Goto for an immediately succeeding label is superfluous. Fixes: 87d791423ac6 ("eficonfig: menu-driven addition of UEFI boot option") Addresses-Coverity: 376202 ("Identical code for different branches") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
9945bc4f |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Fix incorrect return code of boot option update Correct the return code for out-of-memory and no boot option found Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
339b527b |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Move bootorder and bootoption apis to lib Rename and move bootorder and bootoption apis from cmd to lib for re-use between eficonfig and bootmgr Fix 'unexpected indentation' when 'make htmldocs' after functions are moved Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
2c0b0c31 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_SECURE_BOOT This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_SECURE_BOOT defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
83f3d121 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_MM_COMM_TEE This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_MM_COMM_TEE defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
88df3634 |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: CTRL+S to save the boot order 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>
|
#
45f5319f |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
menu: remove CTRL+C to quit On the sandbox called without "--terminal raw" CTRL+C leaves U-Boot, "ESC/CTRL+C to quit" is misleading. Let's remove CTRL+C to quit key handling from bootmenu and eficonfig menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
|
#
8dbd0a0f |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add vertical scroll support The current eficonfig menu does not support vertical scroll, so it can not display the menu entries greater than the console row size. This commit add the vertial scroll support. The console size is retrieved by SIMPLE_TEXT_OUTPUT_PROTOCOL.QueryMode() service, then calculates the row size for menu entry by subtracting menu header and description row size from the console row size. "start" and "end" are added in the efimenu structure. "start" keeps the menu entry index at the top, "end" keeps the bottom menu entry index. item_data_print() menu function only draws the menu entry between "start" and "end". This commit also fixes the issue that "Save" and "Quit" entries can be moved by BKEY_PLUS in change boot order menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
0d590852 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation This commit removes the change boot order specific menu implementation. The change boot order implementation calls eficonfig_process_common() same as other menus. The change boot order menu requires own item_data_print and item_choice implementation, but display_statusline function can be a same function as other menus. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
cd160b27 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor eficonfig_process_common function Current change boot order implementation does not call eficonfig_process_common() and call own menu functions for display_statusline, item_data_print and item_choice. Change boot order functionality should call eficonfig_process_common() to improve maintenanceability. This commit is a preparation to remove the change boot order specific implementation. The menu functions (display_statusline, item_data_print and item_choice) are added as argument of eficonfig_process_common(). The menu description string displayed at the bottom of the menu is also added as argument. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
32bab0ea |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Make use of CLI character processing Avoid duplicating some of the escape-sequence processing here and use the CLI function instead. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
d0ca98db |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Update bootmenu_loop() to return the code Use the return value to save having to pass around a pointer. This also resolves any ambiguity about what *key contains when the function is called. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
2da4a15e |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Rename KEY_... to BKEY_... This enum values conflict with linux/input.h so rename them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
64550274 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: avoid SetVariable between GetNextVariableName calls The current code calls efi_set_variable_int() to delete the invalid boot option between calls to efi_get_next_variable_name_int(), it may produce unpredictable results. This commit moves removal of the invalid boot option outside of the efi_get_next_variable_name_int() calls. EFI_NOT_FOUND returned from efi_get_next_variable_name_int() indicates we retrieved all EFI variables, it should be treated as EFI_SUCEESS. To address the checkpatch warning of too many leading tabs, combine two if statement into one. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
ce327084 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: carve out efi_get_next_variable_name_int calls To retrieve the EFI variable name by efi_get_next_variable_name_int(), the sequence of alloc -> efi_get_next_variable_name_int -> realloc -> efi_get_next_variable_name_int is required. In current code, this sequence repeatedly appears in the several functions. It should be curved out a common function. This commit also fixes the missing free() of var_name16 in eficonfig_delete_invalid_boot_option(). Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
140a8959 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use efi_get_next_variable_name_int() eficonfig command reads all possible UEFI load options from 0x0000 to 0xFFFF to construct the menu. This takes too much time in some environment. This commit uses efi_get_next_variable_name_int() to read all existing UEFI load options to significantlly reduce the count of efi_get_var() call. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
78b1ccc4 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use u16_strsize() to get u16 string buffer size Use u16_strsize() to simplify the u16 string buffer size calculation. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c67d3c9e |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix going one directory up issue The directory name in eficonfig menu entry contains the '\' separator. strcmp() argument ".." is wrong and one directory up handling does not work correctly. strcmp() argument must include '\' separator. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c3b5af63 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add UEFI Secure Boot Key enrollment interface This commit adds the menu-driven UEFI Secure Boot Key enrollment interface. User can enroll PK, KEK, db and dbx by selecting file. Only the signed EFI Signature List(s) with an authenticated header, typically '.auth' file, is accepted. To clear the PK, KEK, db and dbx, user needs to enroll the null key signed by PK or KEK. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
21faf4ef |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use protocol interface for file selection EFI_SIMPLE_FILE_SYSTEM_PROTOCOL is not always provided by U-Boot. Use protocol interface functions instead of U-Boot internal functions. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d6566113 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose eficonfig_create_device_path() Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use eficonfig_create_device_path() to construct the full device path from device path of the volume and file path, so move it out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d571f9b2 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation All the eficonfig menus other than "Change Boot Order" use 'eficonfig_entry' structure for each menu entry. This commit refactors change boot order implementation to use 'eficonfig_entry' structure same as other menus to have consistent menu handling. This commit also simplifies the data->active handling when KEY_SPACE is pressed, and sizeof() parameter. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
8961e93e |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose append entry function Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use append_entry() and append_quit_entry() to construct the menu, so move them out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
a84040ab |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor file selection handling eficonfig_select_file_handler() is commonly used to select the file. eficonfig_display_select_file_option() adds an additional menu to clear the selected file. eficonfig_display_select_file_option() is not always necessary for the file selection process, so it must be outside of eficonfig_select_file_handler(). This commit also renames the following functions to avoid confusion. eficonfig_select_file_handler() -> eficonfig_process_select_file() eficonfig_select_file() -> eficonfig_show_file_selection() eficonfig_display_select_file_option() -> eficonfig_process_show_file_option() Finally, test_eficonfig.py need to be updated to get aligned with the above modification. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
1167e88a |
|
14-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix missing variable initialization The 'ret' variable must be initialized before use in eficonfig_delete_invalid_boot_option(). Fixes: c416f1c0bc ("bootmenu: add removable media entries") Addresses-Coverity: 376207 ("Uninitialized variables") Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
3d595ac5 |
|
09-Nov-2022 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: remove superfluous if in eficonfig_edit_boot_option Goto for an immediately succeeding label is superfluous. Fixes: 87d791423ac6 ("eficonfig: menu-driven addition of UEFI boot option") Addresses-Coverity: 376202 ("Identical code for different branches") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
9945bc4f |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Fix incorrect return code of boot option update Correct the return code for out-of-memory and no boot option found Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
339b527b |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Move bootorder and bootoption apis to lib Rename and move bootorder and bootoption apis from cmd to lib for re-use between eficonfig and bootmgr Fix 'unexpected indentation' when 'make htmldocs' after functions are moved Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
2c0b0c31 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_SECURE_BOOT This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_SECURE_BOOT defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
83f3d121 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_MM_COMM_TEE This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_MM_COMM_TEE defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
88df3634 |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: CTRL+S to save the boot order 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>
|
#
45f5319f |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
menu: remove CTRL+C to quit On the sandbox called without "--terminal raw" CTRL+C leaves U-Boot, "ESC/CTRL+C to quit" is misleading. Let's remove CTRL+C to quit key handling from bootmenu and eficonfig menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
|
#
8dbd0a0f |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add vertical scroll support The current eficonfig menu does not support vertical scroll, so it can not display the menu entries greater than the console row size. This commit add the vertial scroll support. The console size is retrieved by SIMPLE_TEXT_OUTPUT_PROTOCOL.QueryMode() service, then calculates the row size for menu entry by subtracting menu header and description row size from the console row size. "start" and "end" are added in the efimenu structure. "start" keeps the menu entry index at the top, "end" keeps the bottom menu entry index. item_data_print() menu function only draws the menu entry between "start" and "end". This commit also fixes the issue that "Save" and "Quit" entries can be moved by BKEY_PLUS in change boot order menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
0d590852 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation This commit removes the change boot order specific menu implementation. The change boot order implementation calls eficonfig_process_common() same as other menus. The change boot order menu requires own item_data_print and item_choice implementation, but display_statusline function can be a same function as other menus. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
cd160b27 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor eficonfig_process_common function Current change boot order implementation does not call eficonfig_process_common() and call own menu functions for display_statusline, item_data_print and item_choice. Change boot order functionality should call eficonfig_process_common() to improve maintenanceability. This commit is a preparation to remove the change boot order specific implementation. The menu functions (display_statusline, item_data_print and item_choice) are added as argument of eficonfig_process_common(). The menu description string displayed at the bottom of the menu is also added as argument. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
32bab0ea |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Make use of CLI character processing Avoid duplicating some of the escape-sequence processing here and use the CLI function instead. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
d0ca98db |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Update bootmenu_loop() to return the code Use the return value to save having to pass around a pointer. This also resolves any ambiguity about what *key contains when the function is called. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
2da4a15e |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Rename KEY_... to BKEY_... This enum values conflict with linux/input.h so rename them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
64550274 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: avoid SetVariable between GetNextVariableName calls The current code calls efi_set_variable_int() to delete the invalid boot option between calls to efi_get_next_variable_name_int(), it may produce unpredictable results. This commit moves removal of the invalid boot option outside of the efi_get_next_variable_name_int() calls. EFI_NOT_FOUND returned from efi_get_next_variable_name_int() indicates we retrieved all EFI variables, it should be treated as EFI_SUCEESS. To address the checkpatch warning of too many leading tabs, combine two if statement into one. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
ce327084 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: carve out efi_get_next_variable_name_int calls To retrieve the EFI variable name by efi_get_next_variable_name_int(), the sequence of alloc -> efi_get_next_variable_name_int -> realloc -> efi_get_next_variable_name_int is required. In current code, this sequence repeatedly appears in the several functions. It should be curved out a common function. This commit also fixes the missing free() of var_name16 in eficonfig_delete_invalid_boot_option(). Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
140a8959 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use efi_get_next_variable_name_int() eficonfig command reads all possible UEFI load options from 0x0000 to 0xFFFF to construct the menu. This takes too much time in some environment. This commit uses efi_get_next_variable_name_int() to read all existing UEFI load options to significantlly reduce the count of efi_get_var() call. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
78b1ccc4 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use u16_strsize() to get u16 string buffer size Use u16_strsize() to simplify the u16 string buffer size calculation. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c67d3c9e |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix going one directory up issue The directory name in eficonfig menu entry contains the '\' separator. strcmp() argument ".." is wrong and one directory up handling does not work correctly. strcmp() argument must include '\' separator. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c3b5af63 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add UEFI Secure Boot Key enrollment interface This commit adds the menu-driven UEFI Secure Boot Key enrollment interface. User can enroll PK, KEK, db and dbx by selecting file. Only the signed EFI Signature List(s) with an authenticated header, typically '.auth' file, is accepted. To clear the PK, KEK, db and dbx, user needs to enroll the null key signed by PK or KEK. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
21faf4ef |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use protocol interface for file selection EFI_SIMPLE_FILE_SYSTEM_PROTOCOL is not always provided by U-Boot. Use protocol interface functions instead of U-Boot internal functions. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d6566113 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose eficonfig_create_device_path() Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use eficonfig_create_device_path() to construct the full device path from device path of the volume and file path, so move it out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d571f9b2 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation All the eficonfig menus other than "Change Boot Order" use 'eficonfig_entry' structure for each menu entry. This commit refactors change boot order implementation to use 'eficonfig_entry' structure same as other menus to have consistent menu handling. This commit also simplifies the data->active handling when KEY_SPACE is pressed, and sizeof() parameter. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
8961e93e |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose append entry function Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use append_entry() and append_quit_entry() to construct the menu, so move them out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
a84040ab |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor file selection handling eficonfig_select_file_handler() is commonly used to select the file. eficonfig_display_select_file_option() adds an additional menu to clear the selected file. eficonfig_display_select_file_option() is not always necessary for the file selection process, so it must be outside of eficonfig_select_file_handler(). This commit also renames the following functions to avoid confusion. eficonfig_select_file_handler() -> eficonfig_process_select_file() eficonfig_select_file() -> eficonfig_show_file_selection() eficonfig_display_select_file_option() -> eficonfig_process_show_file_option() Finally, test_eficonfig.py need to be updated to get aligned with the above modification. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
1167e88a |
|
14-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix missing variable initialization The 'ret' variable must be initialized before use in eficonfig_delete_invalid_boot_option(). Fixes: c416f1c0bc ("bootmenu: add removable media entries") Addresses-Coverity: 376207 ("Uninitialized variables") Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
3d595ac5 |
|
09-Nov-2022 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: remove superfluous if in eficonfig_edit_boot_option Goto for an immediately succeeding label is superfluous. Fixes: 87d791423ac6 ("eficonfig: menu-driven addition of UEFI boot option") Addresses-Coverity: 376202 ("Identical code for different branches") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
9945bc4f |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Fix incorrect return code of boot option update Correct the return code for out-of-memory and no boot option found Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
339b527b |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Move bootorder and bootoption apis to lib Rename and move bootorder and bootoption apis from cmd to lib for re-use between eficonfig and bootmgr Fix 'unexpected indentation' when 'make htmldocs' after functions are moved Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
2c0b0c31 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_SECURE_BOOT This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_SECURE_BOOT defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
83f3d121 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_MM_COMM_TEE This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_MM_COMM_TEE defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
88df3634 |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: CTRL+S to save the boot order 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>
|
#
45f5319f |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
menu: remove CTRL+C to quit On the sandbox called without "--terminal raw" CTRL+C leaves U-Boot, "ESC/CTRL+C to quit" is misleading. Let's remove CTRL+C to quit key handling from bootmenu and eficonfig menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
|
#
8dbd0a0f |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add vertical scroll support The current eficonfig menu does not support vertical scroll, so it can not display the menu entries greater than the console row size. This commit add the vertial scroll support. The console size is retrieved by SIMPLE_TEXT_OUTPUT_PROTOCOL.QueryMode() service, then calculates the row size for menu entry by subtracting menu header and description row size from the console row size. "start" and "end" are added in the efimenu structure. "start" keeps the menu entry index at the top, "end" keeps the bottom menu entry index. item_data_print() menu function only draws the menu entry between "start" and "end". This commit also fixes the issue that "Save" and "Quit" entries can be moved by BKEY_PLUS in change boot order menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
0d590852 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation This commit removes the change boot order specific menu implementation. The change boot order implementation calls eficonfig_process_common() same as other menus. The change boot order menu requires own item_data_print and item_choice implementation, but display_statusline function can be a same function as other menus. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
cd160b27 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor eficonfig_process_common function Current change boot order implementation does not call eficonfig_process_common() and call own menu functions for display_statusline, item_data_print and item_choice. Change boot order functionality should call eficonfig_process_common() to improve maintenanceability. This commit is a preparation to remove the change boot order specific implementation. The menu functions (display_statusline, item_data_print and item_choice) are added as argument of eficonfig_process_common(). The menu description string displayed at the bottom of the menu is also added as argument. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
32bab0ea |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Make use of CLI character processing Avoid duplicating some of the escape-sequence processing here and use the CLI function instead. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
d0ca98db |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Update bootmenu_loop() to return the code Use the return value to save having to pass around a pointer. This also resolves any ambiguity about what *key contains when the function is called. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
2da4a15e |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Rename KEY_... to BKEY_... This enum values conflict with linux/input.h so rename them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
64550274 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: avoid SetVariable between GetNextVariableName calls The current code calls efi_set_variable_int() to delete the invalid boot option between calls to efi_get_next_variable_name_int(), it may produce unpredictable results. This commit moves removal of the invalid boot option outside of the efi_get_next_variable_name_int() calls. EFI_NOT_FOUND returned from efi_get_next_variable_name_int() indicates we retrieved all EFI variables, it should be treated as EFI_SUCEESS. To address the checkpatch warning of too many leading tabs, combine two if statement into one. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
ce327084 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: carve out efi_get_next_variable_name_int calls To retrieve the EFI variable name by efi_get_next_variable_name_int(), the sequence of alloc -> efi_get_next_variable_name_int -> realloc -> efi_get_next_variable_name_int is required. In current code, this sequence repeatedly appears in the several functions. It should be curved out a common function. This commit also fixes the missing free() of var_name16 in eficonfig_delete_invalid_boot_option(). Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
140a8959 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use efi_get_next_variable_name_int() eficonfig command reads all possible UEFI load options from 0x0000 to 0xFFFF to construct the menu. This takes too much time in some environment. This commit uses efi_get_next_variable_name_int() to read all existing UEFI load options to significantlly reduce the count of efi_get_var() call. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
78b1ccc4 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use u16_strsize() to get u16 string buffer size Use u16_strsize() to simplify the u16 string buffer size calculation. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c67d3c9e |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix going one directory up issue The directory name in eficonfig menu entry contains the '\' separator. strcmp() argument ".." is wrong and one directory up handling does not work correctly. strcmp() argument must include '\' separator. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c3b5af63 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add UEFI Secure Boot Key enrollment interface This commit adds the menu-driven UEFI Secure Boot Key enrollment interface. User can enroll PK, KEK, db and dbx by selecting file. Only the signed EFI Signature List(s) with an authenticated header, typically '.auth' file, is accepted. To clear the PK, KEK, db and dbx, user needs to enroll the null key signed by PK or KEK. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
21faf4ef |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use protocol interface for file selection EFI_SIMPLE_FILE_SYSTEM_PROTOCOL is not always provided by U-Boot. Use protocol interface functions instead of U-Boot internal functions. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d6566113 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose eficonfig_create_device_path() Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use eficonfig_create_device_path() to construct the full device path from device path of the volume and file path, so move it out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d571f9b2 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation All the eficonfig menus other than "Change Boot Order" use 'eficonfig_entry' structure for each menu entry. This commit refactors change boot order implementation to use 'eficonfig_entry' structure same as other menus to have consistent menu handling. This commit also simplifies the data->active handling when KEY_SPACE is pressed, and sizeof() parameter. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
8961e93e |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose append entry function Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use append_entry() and append_quit_entry() to construct the menu, so move them out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
a84040ab |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor file selection handling eficonfig_select_file_handler() is commonly used to select the file. eficonfig_display_select_file_option() adds an additional menu to clear the selected file. eficonfig_display_select_file_option() is not always necessary for the file selection process, so it must be outside of eficonfig_select_file_handler(). This commit also renames the following functions to avoid confusion. eficonfig_select_file_handler() -> eficonfig_process_select_file() eficonfig_select_file() -> eficonfig_show_file_selection() eficonfig_display_select_file_option() -> eficonfig_process_show_file_option() Finally, test_eficonfig.py need to be updated to get aligned with the above modification. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
1167e88a |
|
14-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix missing variable initialization The 'ret' variable must be initialized before use in eficonfig_delete_invalid_boot_option(). Fixes: c416f1c0bc ("bootmenu: add removable media entries") Addresses-Coverity: 376207 ("Uninitialized variables") Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
3d595ac5 |
|
09-Nov-2022 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: remove superfluous if in eficonfig_edit_boot_option Goto for an immediately succeeding label is superfluous. Fixes: 87d791423ac6 ("eficonfig: menu-driven addition of UEFI boot option") Addresses-Coverity: 376202 ("Identical code for different branches") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
9945bc4f |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Fix incorrect return code of boot option update Correct the return code for out-of-memory and no boot option found Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
339b527b |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Move bootorder and bootoption apis to lib Rename and move bootorder and bootoption apis from cmd to lib for re-use between eficonfig and bootmgr Fix 'unexpected indentation' when 'make htmldocs' after functions are moved Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
2c0b0c31 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_SECURE_BOOT This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_SECURE_BOOT defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
83f3d121 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_MM_COMM_TEE This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_MM_COMM_TEE defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
88df3634 |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: CTRL+S to save the boot order 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>
|
#
45f5319f |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
menu: remove CTRL+C to quit On the sandbox called without "--terminal raw" CTRL+C leaves U-Boot, "ESC/CTRL+C to quit" is misleading. Let's remove CTRL+C to quit key handling from bootmenu and eficonfig menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
|
#
8dbd0a0f |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add vertical scroll support The current eficonfig menu does not support vertical scroll, so it can not display the menu entries greater than the console row size. This commit add the vertial scroll support. The console size is retrieved by SIMPLE_TEXT_OUTPUT_PROTOCOL.QueryMode() service, then calculates the row size for menu entry by subtracting menu header and description row size from the console row size. "start" and "end" are added in the efimenu structure. "start" keeps the menu entry index at the top, "end" keeps the bottom menu entry index. item_data_print() menu function only draws the menu entry between "start" and "end". This commit also fixes the issue that "Save" and "Quit" entries can be moved by BKEY_PLUS in change boot order menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
0d590852 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation This commit removes the change boot order specific menu implementation. The change boot order implementation calls eficonfig_process_common() same as other menus. The change boot order menu requires own item_data_print and item_choice implementation, but display_statusline function can be a same function as other menus. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
cd160b27 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor eficonfig_process_common function Current change boot order implementation does not call eficonfig_process_common() and call own menu functions for display_statusline, item_data_print and item_choice. Change boot order functionality should call eficonfig_process_common() to improve maintenanceability. This commit is a preparation to remove the change boot order specific implementation. The menu functions (display_statusline, item_data_print and item_choice) are added as argument of eficonfig_process_common(). The menu description string displayed at the bottom of the menu is also added as argument. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
32bab0ea |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Make use of CLI character processing Avoid duplicating some of the escape-sequence processing here and use the CLI function instead. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
d0ca98db |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Update bootmenu_loop() to return the code Use the return value to save having to pass around a pointer. This also resolves any ambiguity about what *key contains when the function is called. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
2da4a15e |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Rename KEY_... to BKEY_... This enum values conflict with linux/input.h so rename them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
64550274 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: avoid SetVariable between GetNextVariableName calls The current code calls efi_set_variable_int() to delete the invalid boot option between calls to efi_get_next_variable_name_int(), it may produce unpredictable results. This commit moves removal of the invalid boot option outside of the efi_get_next_variable_name_int() calls. EFI_NOT_FOUND returned from efi_get_next_variable_name_int() indicates we retrieved all EFI variables, it should be treated as EFI_SUCEESS. To address the checkpatch warning of too many leading tabs, combine two if statement into one. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
ce327084 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: carve out efi_get_next_variable_name_int calls To retrieve the EFI variable name by efi_get_next_variable_name_int(), the sequence of alloc -> efi_get_next_variable_name_int -> realloc -> efi_get_next_variable_name_int is required. In current code, this sequence repeatedly appears in the several functions. It should be curved out a common function. This commit also fixes the missing free() of var_name16 in eficonfig_delete_invalid_boot_option(). Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
140a8959 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use efi_get_next_variable_name_int() eficonfig command reads all possible UEFI load options from 0x0000 to 0xFFFF to construct the menu. This takes too much time in some environment. This commit uses efi_get_next_variable_name_int() to read all existing UEFI load options to significantlly reduce the count of efi_get_var() call. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
78b1ccc4 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use u16_strsize() to get u16 string buffer size Use u16_strsize() to simplify the u16 string buffer size calculation. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c67d3c9e |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix going one directory up issue The directory name in eficonfig menu entry contains the '\' separator. strcmp() argument ".." is wrong and one directory up handling does not work correctly. strcmp() argument must include '\' separator. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c3b5af63 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add UEFI Secure Boot Key enrollment interface This commit adds the menu-driven UEFI Secure Boot Key enrollment interface. User can enroll PK, KEK, db and dbx by selecting file. Only the signed EFI Signature List(s) with an authenticated header, typically '.auth' file, is accepted. To clear the PK, KEK, db and dbx, user needs to enroll the null key signed by PK or KEK. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
21faf4ef |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use protocol interface for file selection EFI_SIMPLE_FILE_SYSTEM_PROTOCOL is not always provided by U-Boot. Use protocol interface functions instead of U-Boot internal functions. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d6566113 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose eficonfig_create_device_path() Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use eficonfig_create_device_path() to construct the full device path from device path of the volume and file path, so move it out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d571f9b2 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation All the eficonfig menus other than "Change Boot Order" use 'eficonfig_entry' structure for each menu entry. This commit refactors change boot order implementation to use 'eficonfig_entry' structure same as other menus to have consistent menu handling. This commit also simplifies the data->active handling when KEY_SPACE is pressed, and sizeof() parameter. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
8961e93e |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose append entry function Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use append_entry() and append_quit_entry() to construct the menu, so move them out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
a84040ab |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor file selection handling eficonfig_select_file_handler() is commonly used to select the file. eficonfig_display_select_file_option() adds an additional menu to clear the selected file. eficonfig_display_select_file_option() is not always necessary for the file selection process, so it must be outside of eficonfig_select_file_handler(). This commit also renames the following functions to avoid confusion. eficonfig_select_file_handler() -> eficonfig_process_select_file() eficonfig_select_file() -> eficonfig_show_file_selection() eficonfig_display_select_file_option() -> eficonfig_process_show_file_option() Finally, test_eficonfig.py need to be updated to get aligned with the above modification. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
1167e88a |
|
14-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix missing variable initialization The 'ret' variable must be initialized before use in eficonfig_delete_invalid_boot_option(). Fixes: c416f1c0bc ("bootmenu: add removable media entries") Addresses-Coverity: 376207 ("Uninitialized variables") Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
3d595ac5 |
|
09-Nov-2022 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: remove superfluous if in eficonfig_edit_boot_option Goto for an immediately succeeding label is superfluous. Fixes: 87d791423ac6 ("eficonfig: menu-driven addition of UEFI boot option") Addresses-Coverity: 376202 ("Identical code for different branches") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
9945bc4f |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Fix incorrect return code of boot option update Correct the return code for out-of-memory and no boot option found Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
339b527b |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Move bootorder and bootoption apis to lib Rename and move bootorder and bootoption apis from cmd to lib for re-use between eficonfig and bootmgr Fix 'unexpected indentation' when 'make htmldocs' after functions are moved Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
2c0b0c31 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_SECURE_BOOT This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_SECURE_BOOT defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
83f3d121 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_MM_COMM_TEE This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_MM_COMM_TEE defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
88df3634 |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: CTRL+S to save the boot order 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>
|
#
45f5319f |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
menu: remove CTRL+C to quit On the sandbox called without "--terminal raw" CTRL+C leaves U-Boot, "ESC/CTRL+C to quit" is misleading. Let's remove CTRL+C to quit key handling from bootmenu and eficonfig menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
|
#
8dbd0a0f |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add vertical scroll support The current eficonfig menu does not support vertical scroll, so it can not display the menu entries greater than the console row size. This commit add the vertial scroll support. The console size is retrieved by SIMPLE_TEXT_OUTPUT_PROTOCOL.QueryMode() service, then calculates the row size for menu entry by subtracting menu header and description row size from the console row size. "start" and "end" are added in the efimenu structure. "start" keeps the menu entry index at the top, "end" keeps the bottom menu entry index. item_data_print() menu function only draws the menu entry between "start" and "end". This commit also fixes the issue that "Save" and "Quit" entries can be moved by BKEY_PLUS in change boot order menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
0d590852 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation This commit removes the change boot order specific menu implementation. The change boot order implementation calls eficonfig_process_common() same as other menus. The change boot order menu requires own item_data_print and item_choice implementation, but display_statusline function can be a same function as other menus. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
cd160b27 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor eficonfig_process_common function Current change boot order implementation does not call eficonfig_process_common() and call own menu functions for display_statusline, item_data_print and item_choice. Change boot order functionality should call eficonfig_process_common() to improve maintenanceability. This commit is a preparation to remove the change boot order specific implementation. The menu functions (display_statusline, item_data_print and item_choice) are added as argument of eficonfig_process_common(). The menu description string displayed at the bottom of the menu is also added as argument. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
32bab0ea |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Make use of CLI character processing Avoid duplicating some of the escape-sequence processing here and use the CLI function instead. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
d0ca98db |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Update bootmenu_loop() to return the code Use the return value to save having to pass around a pointer. This also resolves any ambiguity about what *key contains when the function is called. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
2da4a15e |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Rename KEY_... to BKEY_... This enum values conflict with linux/input.h so rename them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
64550274 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: avoid SetVariable between GetNextVariableName calls The current code calls efi_set_variable_int() to delete the invalid boot option between calls to efi_get_next_variable_name_int(), it may produce unpredictable results. This commit moves removal of the invalid boot option outside of the efi_get_next_variable_name_int() calls. EFI_NOT_FOUND returned from efi_get_next_variable_name_int() indicates we retrieved all EFI variables, it should be treated as EFI_SUCEESS. To address the checkpatch warning of too many leading tabs, combine two if statement into one. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
ce327084 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: carve out efi_get_next_variable_name_int calls To retrieve the EFI variable name by efi_get_next_variable_name_int(), the sequence of alloc -> efi_get_next_variable_name_int -> realloc -> efi_get_next_variable_name_int is required. In current code, this sequence repeatedly appears in the several functions. It should be curved out a common function. This commit also fixes the missing free() of var_name16 in eficonfig_delete_invalid_boot_option(). Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
140a8959 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use efi_get_next_variable_name_int() eficonfig command reads all possible UEFI load options from 0x0000 to 0xFFFF to construct the menu. This takes too much time in some environment. This commit uses efi_get_next_variable_name_int() to read all existing UEFI load options to significantlly reduce the count of efi_get_var() call. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
78b1ccc4 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use u16_strsize() to get u16 string buffer size Use u16_strsize() to simplify the u16 string buffer size calculation. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c67d3c9e |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix going one directory up issue The directory name in eficonfig menu entry contains the '\' separator. strcmp() argument ".." is wrong and one directory up handling does not work correctly. strcmp() argument must include '\' separator. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c3b5af63 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add UEFI Secure Boot Key enrollment interface This commit adds the menu-driven UEFI Secure Boot Key enrollment interface. User can enroll PK, KEK, db and dbx by selecting file. Only the signed EFI Signature List(s) with an authenticated header, typically '.auth' file, is accepted. To clear the PK, KEK, db and dbx, user needs to enroll the null key signed by PK or KEK. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
21faf4ef |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use protocol interface for file selection EFI_SIMPLE_FILE_SYSTEM_PROTOCOL is not always provided by U-Boot. Use protocol interface functions instead of U-Boot internal functions. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d6566113 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose eficonfig_create_device_path() Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use eficonfig_create_device_path() to construct the full device path from device path of the volume and file path, so move it out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d571f9b2 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation All the eficonfig menus other than "Change Boot Order" use 'eficonfig_entry' structure for each menu entry. This commit refactors change boot order implementation to use 'eficonfig_entry' structure same as other menus to have consistent menu handling. This commit also simplifies the data->active handling when KEY_SPACE is pressed, and sizeof() parameter. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
8961e93e |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose append entry function Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use append_entry() and append_quit_entry() to construct the menu, so move them out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
a84040ab |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor file selection handling eficonfig_select_file_handler() is commonly used to select the file. eficonfig_display_select_file_option() adds an additional menu to clear the selected file. eficonfig_display_select_file_option() is not always necessary for the file selection process, so it must be outside of eficonfig_select_file_handler(). This commit also renames the following functions to avoid confusion. eficonfig_select_file_handler() -> eficonfig_process_select_file() eficonfig_select_file() -> eficonfig_show_file_selection() eficonfig_display_select_file_option() -> eficonfig_process_show_file_option() Finally, test_eficonfig.py need to be updated to get aligned with the above modification. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
1167e88a |
|
14-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix missing variable initialization The 'ret' variable must be initialized before use in eficonfig_delete_invalid_boot_option(). Fixes: c416f1c0bc ("bootmenu: add removable media entries") Addresses-Coverity: 376207 ("Uninitialized variables") Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
3d595ac5 |
|
09-Nov-2022 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: remove superfluous if in eficonfig_edit_boot_option Goto for an immediately succeeding label is superfluous. Fixes: 87d791423ac6 ("eficonfig: menu-driven addition of UEFI boot option") Addresses-Coverity: 376202 ("Identical code for different branches") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
9945bc4f |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Fix incorrect return code of boot option update Correct the return code for out-of-memory and no boot option found Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
339b527b |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Move bootorder and bootoption apis to lib Rename and move bootorder and bootoption apis from cmd to lib for re-use between eficonfig and bootmgr Fix 'unexpected indentation' when 'make htmldocs' after functions are moved Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
2c0b0c31 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_SECURE_BOOT This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_SECURE_BOOT defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
83f3d121 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_MM_COMM_TEE This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_MM_COMM_TEE defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
88df3634 |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: CTRL+S to save the boot order 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>
|
#
45f5319f |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
menu: remove CTRL+C to quit On the sandbox called without "--terminal raw" CTRL+C leaves U-Boot, "ESC/CTRL+C to quit" is misleading. Let's remove CTRL+C to quit key handling from bootmenu and eficonfig menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
|
#
8dbd0a0f |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add vertical scroll support The current eficonfig menu does not support vertical scroll, so it can not display the menu entries greater than the console row size. This commit add the vertial scroll support. The console size is retrieved by SIMPLE_TEXT_OUTPUT_PROTOCOL.QueryMode() service, then calculates the row size for menu entry by subtracting menu header and description row size from the console row size. "start" and "end" are added in the efimenu structure. "start" keeps the menu entry index at the top, "end" keeps the bottom menu entry index. item_data_print() menu function only draws the menu entry between "start" and "end". This commit also fixes the issue that "Save" and "Quit" entries can be moved by BKEY_PLUS in change boot order menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
0d590852 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation This commit removes the change boot order specific menu implementation. The change boot order implementation calls eficonfig_process_common() same as other menus. The change boot order menu requires own item_data_print and item_choice implementation, but display_statusline function can be a same function as other menus. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
cd160b27 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor eficonfig_process_common function Current change boot order implementation does not call eficonfig_process_common() and call own menu functions for display_statusline, item_data_print and item_choice. Change boot order functionality should call eficonfig_process_common() to improve maintenanceability. This commit is a preparation to remove the change boot order specific implementation. The menu functions (display_statusline, item_data_print and item_choice) are added as argument of eficonfig_process_common(). The menu description string displayed at the bottom of the menu is also added as argument. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
32bab0ea |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Make use of CLI character processing Avoid duplicating some of the escape-sequence processing here and use the CLI function instead. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
d0ca98db |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Update bootmenu_loop() to return the code Use the return value to save having to pass around a pointer. This also resolves any ambiguity about what *key contains when the function is called. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
2da4a15e |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Rename KEY_... to BKEY_... This enum values conflict with linux/input.h so rename them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
64550274 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: avoid SetVariable between GetNextVariableName calls The current code calls efi_set_variable_int() to delete the invalid boot option between calls to efi_get_next_variable_name_int(), it may produce unpredictable results. This commit moves removal of the invalid boot option outside of the efi_get_next_variable_name_int() calls. EFI_NOT_FOUND returned from efi_get_next_variable_name_int() indicates we retrieved all EFI variables, it should be treated as EFI_SUCEESS. To address the checkpatch warning of too many leading tabs, combine two if statement into one. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
ce327084 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: carve out efi_get_next_variable_name_int calls To retrieve the EFI variable name by efi_get_next_variable_name_int(), the sequence of alloc -> efi_get_next_variable_name_int -> realloc -> efi_get_next_variable_name_int is required. In current code, this sequence repeatedly appears in the several functions. It should be curved out a common function. This commit also fixes the missing free() of var_name16 in eficonfig_delete_invalid_boot_option(). Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
140a8959 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use efi_get_next_variable_name_int() eficonfig command reads all possible UEFI load options from 0x0000 to 0xFFFF to construct the menu. This takes too much time in some environment. This commit uses efi_get_next_variable_name_int() to read all existing UEFI load options to significantlly reduce the count of efi_get_var() call. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
78b1ccc4 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use u16_strsize() to get u16 string buffer size Use u16_strsize() to simplify the u16 string buffer size calculation. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c67d3c9e |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix going one directory up issue The directory name in eficonfig menu entry contains the '\' separator. strcmp() argument ".." is wrong and one directory up handling does not work correctly. strcmp() argument must include '\' separator. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c3b5af63 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add UEFI Secure Boot Key enrollment interface This commit adds the menu-driven UEFI Secure Boot Key enrollment interface. User can enroll PK, KEK, db and dbx by selecting file. Only the signed EFI Signature List(s) with an authenticated header, typically '.auth' file, is accepted. To clear the PK, KEK, db and dbx, user needs to enroll the null key signed by PK or KEK. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
21faf4ef |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use protocol interface for file selection EFI_SIMPLE_FILE_SYSTEM_PROTOCOL is not always provided by U-Boot. Use protocol interface functions instead of U-Boot internal functions. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d6566113 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose eficonfig_create_device_path() Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use eficonfig_create_device_path() to construct the full device path from device path of the volume and file path, so move it out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d571f9b2 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation All the eficonfig menus other than "Change Boot Order" use 'eficonfig_entry' structure for each menu entry. This commit refactors change boot order implementation to use 'eficonfig_entry' structure same as other menus to have consistent menu handling. This commit also simplifies the data->active handling when KEY_SPACE is pressed, and sizeof() parameter. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
8961e93e |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose append entry function Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use append_entry() and append_quit_entry() to construct the menu, so move them out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
a84040ab |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor file selection handling eficonfig_select_file_handler() is commonly used to select the file. eficonfig_display_select_file_option() adds an additional menu to clear the selected file. eficonfig_display_select_file_option() is not always necessary for the file selection process, so it must be outside of eficonfig_select_file_handler(). This commit also renames the following functions to avoid confusion. eficonfig_select_file_handler() -> eficonfig_process_select_file() eficonfig_select_file() -> eficonfig_show_file_selection() eficonfig_display_select_file_option() -> eficonfig_process_show_file_option() Finally, test_eficonfig.py need to be updated to get aligned with the above modification. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
1167e88a |
|
14-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix missing variable initialization The 'ret' variable must be initialized before use in eficonfig_delete_invalid_boot_option(). Fixes: c416f1c0bc ("bootmenu: add removable media entries") Addresses-Coverity: 376207 ("Uninitialized variables") Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
3d595ac5 |
|
09-Nov-2022 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: remove superfluous if in eficonfig_edit_boot_option Goto for an immediately succeeding label is superfluous. Fixes: 87d791423ac6 ("eficonfig: menu-driven addition of UEFI boot option") Addresses-Coverity: 376202 ("Identical code for different branches") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
9945bc4f |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Fix incorrect return code of boot option update Correct the return code for out-of-memory and no boot option found Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
339b527b |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Move bootorder and bootoption apis to lib Rename and move bootorder and bootoption apis from cmd to lib for re-use between eficonfig and bootmgr Fix 'unexpected indentation' when 'make htmldocs' after functions are moved Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
2c0b0c31 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_SECURE_BOOT This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_SECURE_BOOT defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
83f3d121 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_MM_COMM_TEE This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_MM_COMM_TEE defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
88df3634 |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: CTRL+S to save the boot order 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>
|
#
45f5319f |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
menu: remove CTRL+C to quit On the sandbox called without "--terminal raw" CTRL+C leaves U-Boot, "ESC/CTRL+C to quit" is misleading. Let's remove CTRL+C to quit key handling from bootmenu and eficonfig menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
|
#
8dbd0a0f |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add vertical scroll support The current eficonfig menu does not support vertical scroll, so it can not display the menu entries greater than the console row size. This commit add the vertial scroll support. The console size is retrieved by SIMPLE_TEXT_OUTPUT_PROTOCOL.QueryMode() service, then calculates the row size for menu entry by subtracting menu header and description row size from the console row size. "start" and "end" are added in the efimenu structure. "start" keeps the menu entry index at the top, "end" keeps the bottom menu entry index. item_data_print() menu function only draws the menu entry between "start" and "end". This commit also fixes the issue that "Save" and "Quit" entries can be moved by BKEY_PLUS in change boot order menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
0d590852 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation This commit removes the change boot order specific menu implementation. The change boot order implementation calls eficonfig_process_common() same as other menus. The change boot order menu requires own item_data_print and item_choice implementation, but display_statusline function can be a same function as other menus. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
cd160b27 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor eficonfig_process_common function Current change boot order implementation does not call eficonfig_process_common() and call own menu functions for display_statusline, item_data_print and item_choice. Change boot order functionality should call eficonfig_process_common() to improve maintenanceability. This commit is a preparation to remove the change boot order specific implementation. The menu functions (display_statusline, item_data_print and item_choice) are added as argument of eficonfig_process_common(). The menu description string displayed at the bottom of the menu is also added as argument. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
32bab0ea |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Make use of CLI character processing Avoid duplicating some of the escape-sequence processing here and use the CLI function instead. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
d0ca98db |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Update bootmenu_loop() to return the code Use the return value to save having to pass around a pointer. This also resolves any ambiguity about what *key contains when the function is called. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
2da4a15e |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Rename KEY_... to BKEY_... This enum values conflict with linux/input.h so rename them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
64550274 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: avoid SetVariable between GetNextVariableName calls The current code calls efi_set_variable_int() to delete the invalid boot option between calls to efi_get_next_variable_name_int(), it may produce unpredictable results. This commit moves removal of the invalid boot option outside of the efi_get_next_variable_name_int() calls. EFI_NOT_FOUND returned from efi_get_next_variable_name_int() indicates we retrieved all EFI variables, it should be treated as EFI_SUCEESS. To address the checkpatch warning of too many leading tabs, combine two if statement into one. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
ce327084 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: carve out efi_get_next_variable_name_int calls To retrieve the EFI variable name by efi_get_next_variable_name_int(), the sequence of alloc -> efi_get_next_variable_name_int -> realloc -> efi_get_next_variable_name_int is required. In current code, this sequence repeatedly appears in the several functions. It should be curved out a common function. This commit also fixes the missing free() of var_name16 in eficonfig_delete_invalid_boot_option(). Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
140a8959 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use efi_get_next_variable_name_int() eficonfig command reads all possible UEFI load options from 0x0000 to 0xFFFF to construct the menu. This takes too much time in some environment. This commit uses efi_get_next_variable_name_int() to read all existing UEFI load options to significantlly reduce the count of efi_get_var() call. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
78b1ccc4 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use u16_strsize() to get u16 string buffer size Use u16_strsize() to simplify the u16 string buffer size calculation. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c67d3c9e |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix going one directory up issue The directory name in eficonfig menu entry contains the '\' separator. strcmp() argument ".." is wrong and one directory up handling does not work correctly. strcmp() argument must include '\' separator. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c3b5af63 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add UEFI Secure Boot Key enrollment interface This commit adds the menu-driven UEFI Secure Boot Key enrollment interface. User can enroll PK, KEK, db and dbx by selecting file. Only the signed EFI Signature List(s) with an authenticated header, typically '.auth' file, is accepted. To clear the PK, KEK, db and dbx, user needs to enroll the null key signed by PK or KEK. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
21faf4ef |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use protocol interface for file selection EFI_SIMPLE_FILE_SYSTEM_PROTOCOL is not always provided by U-Boot. Use protocol interface functions instead of U-Boot internal functions. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d6566113 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose eficonfig_create_device_path() Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use eficonfig_create_device_path() to construct the full device path from device path of the volume and file path, so move it out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d571f9b2 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation All the eficonfig menus other than "Change Boot Order" use 'eficonfig_entry' structure for each menu entry. This commit refactors change boot order implementation to use 'eficonfig_entry' structure same as other menus to have consistent menu handling. This commit also simplifies the data->active handling when KEY_SPACE is pressed, and sizeof() parameter. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
8961e93e |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose append entry function Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use append_entry() and append_quit_entry() to construct the menu, so move them out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
a84040ab |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor file selection handling eficonfig_select_file_handler() is commonly used to select the file. eficonfig_display_select_file_option() adds an additional menu to clear the selected file. eficonfig_display_select_file_option() is not always necessary for the file selection process, so it must be outside of eficonfig_select_file_handler(). This commit also renames the following functions to avoid confusion. eficonfig_select_file_handler() -> eficonfig_process_select_file() eficonfig_select_file() -> eficonfig_show_file_selection() eficonfig_display_select_file_option() -> eficonfig_process_show_file_option() Finally, test_eficonfig.py need to be updated to get aligned with the above modification. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
1167e88a |
|
14-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix missing variable initialization The 'ret' variable must be initialized before use in eficonfig_delete_invalid_boot_option(). Fixes: c416f1c0bc ("bootmenu: add removable media entries") Addresses-Coverity: 376207 ("Uninitialized variables") Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
3d595ac5 |
|
09-Nov-2022 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: remove superfluous if in eficonfig_edit_boot_option Goto for an immediately succeeding label is superfluous. Fixes: 87d791423ac6 ("eficonfig: menu-driven addition of UEFI boot option") Addresses-Coverity: 376202 ("Identical code for different branches") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
9945bc4f |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Fix incorrect return code of boot option update Correct the return code for out-of-memory and no boot option found Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
339b527b |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Move bootorder and bootoption apis to lib Rename and move bootorder and bootoption apis from cmd to lib for re-use between eficonfig and bootmgr Fix 'unexpected indentation' when 'make htmldocs' after functions are moved Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
2c0b0c31 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_SECURE_BOOT This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_SECURE_BOOT defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
83f3d121 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_MM_COMM_TEE This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_MM_COMM_TEE defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
88df3634 |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: CTRL+S to save the boot order 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>
|
#
45f5319f |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
menu: remove CTRL+C to quit On the sandbox called without "--terminal raw" CTRL+C leaves U-Boot, "ESC/CTRL+C to quit" is misleading. Let's remove CTRL+C to quit key handling from bootmenu and eficonfig menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
|
#
8dbd0a0f |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add vertical scroll support The current eficonfig menu does not support vertical scroll, so it can not display the menu entries greater than the console row size. This commit add the vertial scroll support. The console size is retrieved by SIMPLE_TEXT_OUTPUT_PROTOCOL.QueryMode() service, then calculates the row size for menu entry by subtracting menu header and description row size from the console row size. "start" and "end" are added in the efimenu structure. "start" keeps the menu entry index at the top, "end" keeps the bottom menu entry index. item_data_print() menu function only draws the menu entry between "start" and "end". This commit also fixes the issue that "Save" and "Quit" entries can be moved by BKEY_PLUS in change boot order menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
0d590852 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation This commit removes the change boot order specific menu implementation. The change boot order implementation calls eficonfig_process_common() same as other menus. The change boot order menu requires own item_data_print and item_choice implementation, but display_statusline function can be a same function as other menus. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
cd160b27 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor eficonfig_process_common function Current change boot order implementation does not call eficonfig_process_common() and call own menu functions for display_statusline, item_data_print and item_choice. Change boot order functionality should call eficonfig_process_common() to improve maintenanceability. This commit is a preparation to remove the change boot order specific implementation. The menu functions (display_statusline, item_data_print and item_choice) are added as argument of eficonfig_process_common(). The menu description string displayed at the bottom of the menu is also added as argument. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
32bab0ea |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Make use of CLI character processing Avoid duplicating some of the escape-sequence processing here and use the CLI function instead. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
d0ca98db |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Update bootmenu_loop() to return the code Use the return value to save having to pass around a pointer. This also resolves any ambiguity about what *key contains when the function is called. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
2da4a15e |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Rename KEY_... to BKEY_... This enum values conflict with linux/input.h so rename them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
64550274 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: avoid SetVariable between GetNextVariableName calls The current code calls efi_set_variable_int() to delete the invalid boot option between calls to efi_get_next_variable_name_int(), it may produce unpredictable results. This commit moves removal of the invalid boot option outside of the efi_get_next_variable_name_int() calls. EFI_NOT_FOUND returned from efi_get_next_variable_name_int() indicates we retrieved all EFI variables, it should be treated as EFI_SUCEESS. To address the checkpatch warning of too many leading tabs, combine two if statement into one. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
ce327084 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: carve out efi_get_next_variable_name_int calls To retrieve the EFI variable name by efi_get_next_variable_name_int(), the sequence of alloc -> efi_get_next_variable_name_int -> realloc -> efi_get_next_variable_name_int is required. In current code, this sequence repeatedly appears in the several functions. It should be curved out a common function. This commit also fixes the missing free() of var_name16 in eficonfig_delete_invalid_boot_option(). Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
140a8959 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use efi_get_next_variable_name_int() eficonfig command reads all possible UEFI load options from 0x0000 to 0xFFFF to construct the menu. This takes too much time in some environment. This commit uses efi_get_next_variable_name_int() to read all existing UEFI load options to significantlly reduce the count of efi_get_var() call. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
78b1ccc4 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use u16_strsize() to get u16 string buffer size Use u16_strsize() to simplify the u16 string buffer size calculation. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c67d3c9e |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix going one directory up issue The directory name in eficonfig menu entry contains the '\' separator. strcmp() argument ".." is wrong and one directory up handling does not work correctly. strcmp() argument must include '\' separator. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c3b5af63 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add UEFI Secure Boot Key enrollment interface This commit adds the menu-driven UEFI Secure Boot Key enrollment interface. User can enroll PK, KEK, db and dbx by selecting file. Only the signed EFI Signature List(s) with an authenticated header, typically '.auth' file, is accepted. To clear the PK, KEK, db and dbx, user needs to enroll the null key signed by PK or KEK. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
21faf4ef |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use protocol interface for file selection EFI_SIMPLE_FILE_SYSTEM_PROTOCOL is not always provided by U-Boot. Use protocol interface functions instead of U-Boot internal functions. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d6566113 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose eficonfig_create_device_path() Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use eficonfig_create_device_path() to construct the full device path from device path of the volume and file path, so move it out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d571f9b2 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation All the eficonfig menus other than "Change Boot Order" use 'eficonfig_entry' structure for each menu entry. This commit refactors change boot order implementation to use 'eficonfig_entry' structure same as other menus to have consistent menu handling. This commit also simplifies the data->active handling when KEY_SPACE is pressed, and sizeof() parameter. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
8961e93e |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose append entry function Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use append_entry() and append_quit_entry() to construct the menu, so move them out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
a84040ab |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor file selection handling eficonfig_select_file_handler() is commonly used to select the file. eficonfig_display_select_file_option() adds an additional menu to clear the selected file. eficonfig_display_select_file_option() is not always necessary for the file selection process, so it must be outside of eficonfig_select_file_handler(). This commit also renames the following functions to avoid confusion. eficonfig_select_file_handler() -> eficonfig_process_select_file() eficonfig_select_file() -> eficonfig_show_file_selection() eficonfig_display_select_file_option() -> eficonfig_process_show_file_option() Finally, test_eficonfig.py need to be updated to get aligned with the above modification. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
1167e88a |
|
14-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix missing variable initialization The 'ret' variable must be initialized before use in eficonfig_delete_invalid_boot_option(). Fixes: c416f1c0bc ("bootmenu: add removable media entries") Addresses-Coverity: 376207 ("Uninitialized variables") Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
3d595ac5 |
|
09-Nov-2022 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: remove superfluous if in eficonfig_edit_boot_option Goto for an immediately succeeding label is superfluous. Fixes: 87d791423ac6 ("eficonfig: menu-driven addition of UEFI boot option") Addresses-Coverity: 376202 ("Identical code for different branches") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
9945bc4f |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Fix incorrect return code of boot option update Correct the return code for out-of-memory and no boot option found Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
339b527b |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Move bootorder and bootoption apis to lib Rename and move bootorder and bootoption apis from cmd to lib for re-use between eficonfig and bootmgr Fix 'unexpected indentation' when 'make htmldocs' after functions are moved Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
2c0b0c31 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_SECURE_BOOT This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_SECURE_BOOT defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
83f3d121 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_MM_COMM_TEE This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_MM_COMM_TEE defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
88df3634 |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: CTRL+S to save the boot order 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>
|
#
45f5319f |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
menu: remove CTRL+C to quit On the sandbox called without "--terminal raw" CTRL+C leaves U-Boot, "ESC/CTRL+C to quit" is misleading. Let's remove CTRL+C to quit key handling from bootmenu and eficonfig menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
|
#
8dbd0a0f |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add vertical scroll support The current eficonfig menu does not support vertical scroll, so it can not display the menu entries greater than the console row size. This commit add the vertial scroll support. The console size is retrieved by SIMPLE_TEXT_OUTPUT_PROTOCOL.QueryMode() service, then calculates the row size for menu entry by subtracting menu header and description row size from the console row size. "start" and "end" are added in the efimenu structure. "start" keeps the menu entry index at the top, "end" keeps the bottom menu entry index. item_data_print() menu function only draws the menu entry between "start" and "end". This commit also fixes the issue that "Save" and "Quit" entries can be moved by BKEY_PLUS in change boot order menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
0d590852 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation This commit removes the change boot order specific menu implementation. The change boot order implementation calls eficonfig_process_common() same as other menus. The change boot order menu requires own item_data_print and item_choice implementation, but display_statusline function can be a same function as other menus. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
cd160b27 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor eficonfig_process_common function Current change boot order implementation does not call eficonfig_process_common() and call own menu functions for display_statusline, item_data_print and item_choice. Change boot order functionality should call eficonfig_process_common() to improve maintenanceability. This commit is a preparation to remove the change boot order specific implementation. The menu functions (display_statusline, item_data_print and item_choice) are added as argument of eficonfig_process_common(). The menu description string displayed at the bottom of the menu is also added as argument. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
32bab0ea |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Make use of CLI character processing Avoid duplicating some of the escape-sequence processing here and use the CLI function instead. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
d0ca98db |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Update bootmenu_loop() to return the code Use the return value to save having to pass around a pointer. This also resolves any ambiguity about what *key contains when the function is called. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
2da4a15e |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Rename KEY_... to BKEY_... This enum values conflict with linux/input.h so rename them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
64550274 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: avoid SetVariable between GetNextVariableName calls The current code calls efi_set_variable_int() to delete the invalid boot option between calls to efi_get_next_variable_name_int(), it may produce unpredictable results. This commit moves removal of the invalid boot option outside of the efi_get_next_variable_name_int() calls. EFI_NOT_FOUND returned from efi_get_next_variable_name_int() indicates we retrieved all EFI variables, it should be treated as EFI_SUCEESS. To address the checkpatch warning of too many leading tabs, combine two if statement into one. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
ce327084 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: carve out efi_get_next_variable_name_int calls To retrieve the EFI variable name by efi_get_next_variable_name_int(), the sequence of alloc -> efi_get_next_variable_name_int -> realloc -> efi_get_next_variable_name_int is required. In current code, this sequence repeatedly appears in the several functions. It should be curved out a common function. This commit also fixes the missing free() of var_name16 in eficonfig_delete_invalid_boot_option(). Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
140a8959 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use efi_get_next_variable_name_int() eficonfig command reads all possible UEFI load options from 0x0000 to 0xFFFF to construct the menu. This takes too much time in some environment. This commit uses efi_get_next_variable_name_int() to read all existing UEFI load options to significantlly reduce the count of efi_get_var() call. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
78b1ccc4 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use u16_strsize() to get u16 string buffer size Use u16_strsize() to simplify the u16 string buffer size calculation. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c67d3c9e |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix going one directory up issue The directory name in eficonfig menu entry contains the '\' separator. strcmp() argument ".." is wrong and one directory up handling does not work correctly. strcmp() argument must include '\' separator. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c3b5af63 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add UEFI Secure Boot Key enrollment interface This commit adds the menu-driven UEFI Secure Boot Key enrollment interface. User can enroll PK, KEK, db and dbx by selecting file. Only the signed EFI Signature List(s) with an authenticated header, typically '.auth' file, is accepted. To clear the PK, KEK, db and dbx, user needs to enroll the null key signed by PK or KEK. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
21faf4ef |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use protocol interface for file selection EFI_SIMPLE_FILE_SYSTEM_PROTOCOL is not always provided by U-Boot. Use protocol interface functions instead of U-Boot internal functions. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d6566113 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose eficonfig_create_device_path() Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use eficonfig_create_device_path() to construct the full device path from device path of the volume and file path, so move it out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d571f9b2 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation All the eficonfig menus other than "Change Boot Order" use 'eficonfig_entry' structure for each menu entry. This commit refactors change boot order implementation to use 'eficonfig_entry' structure same as other menus to have consistent menu handling. This commit also simplifies the data->active handling when KEY_SPACE is pressed, and sizeof() parameter. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
8961e93e |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose append entry function Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use append_entry() and append_quit_entry() to construct the menu, so move them out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
a84040ab |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor file selection handling eficonfig_select_file_handler() is commonly used to select the file. eficonfig_display_select_file_option() adds an additional menu to clear the selected file. eficonfig_display_select_file_option() is not always necessary for the file selection process, so it must be outside of eficonfig_select_file_handler(). This commit also renames the following functions to avoid confusion. eficonfig_select_file_handler() -> eficonfig_process_select_file() eficonfig_select_file() -> eficonfig_show_file_selection() eficonfig_display_select_file_option() -> eficonfig_process_show_file_option() Finally, test_eficonfig.py need to be updated to get aligned with the above modification. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
1167e88a |
|
14-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix missing variable initialization The 'ret' variable must be initialized before use in eficonfig_delete_invalid_boot_option(). Fixes: c416f1c0bc ("bootmenu: add removable media entries") Addresses-Coverity: 376207 ("Uninitialized variables") Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
3d595ac5 |
|
09-Nov-2022 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: remove superfluous if in eficonfig_edit_boot_option Goto for an immediately succeeding label is superfluous. Fixes: 87d791423ac6 ("eficonfig: menu-driven addition of UEFI boot option") Addresses-Coverity: 376202 ("Identical code for different branches") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
9945bc4f |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Fix incorrect return code of boot option update Correct the return code for out-of-memory and no boot option found Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
339b527b |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Move bootorder and bootoption apis to lib Rename and move bootorder and bootoption apis from cmd to lib for re-use between eficonfig and bootmgr Fix 'unexpected indentation' when 'make htmldocs' after functions are moved Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
2c0b0c31 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_SECURE_BOOT This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_SECURE_BOOT defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
83f3d121 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_MM_COMM_TEE This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_MM_COMM_TEE defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
88df3634 |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: CTRL+S to save the boot order 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>
|
#
45f5319f |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
menu: remove CTRL+C to quit On the sandbox called without "--terminal raw" CTRL+C leaves U-Boot, "ESC/CTRL+C to quit" is misleading. Let's remove CTRL+C to quit key handling from bootmenu and eficonfig menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
|
#
8dbd0a0f |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add vertical scroll support The current eficonfig menu does not support vertical scroll, so it can not display the menu entries greater than the console row size. This commit add the vertial scroll support. The console size is retrieved by SIMPLE_TEXT_OUTPUT_PROTOCOL.QueryMode() service, then calculates the row size for menu entry by subtracting menu header and description row size from the console row size. "start" and "end" are added in the efimenu structure. "start" keeps the menu entry index at the top, "end" keeps the bottom menu entry index. item_data_print() menu function only draws the menu entry between "start" and "end". This commit also fixes the issue that "Save" and "Quit" entries can be moved by BKEY_PLUS in change boot order menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
0d590852 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation This commit removes the change boot order specific menu implementation. The change boot order implementation calls eficonfig_process_common() same as other menus. The change boot order menu requires own item_data_print and item_choice implementation, but display_statusline function can be a same function as other menus. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
cd160b27 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor eficonfig_process_common function Current change boot order implementation does not call eficonfig_process_common() and call own menu functions for display_statusline, item_data_print and item_choice. Change boot order functionality should call eficonfig_process_common() to improve maintenanceability. This commit is a preparation to remove the change boot order specific implementation. The menu functions (display_statusline, item_data_print and item_choice) are added as argument of eficonfig_process_common(). The menu description string displayed at the bottom of the menu is also added as argument. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
32bab0ea |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Make use of CLI character processing Avoid duplicating some of the escape-sequence processing here and use the CLI function instead. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
d0ca98db |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Update bootmenu_loop() to return the code Use the return value to save having to pass around a pointer. This also resolves any ambiguity about what *key contains when the function is called. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
2da4a15e |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Rename KEY_... to BKEY_... This enum values conflict with linux/input.h so rename them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
64550274 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: avoid SetVariable between GetNextVariableName calls The current code calls efi_set_variable_int() to delete the invalid boot option between calls to efi_get_next_variable_name_int(), it may produce unpredictable results. This commit moves removal of the invalid boot option outside of the efi_get_next_variable_name_int() calls. EFI_NOT_FOUND returned from efi_get_next_variable_name_int() indicates we retrieved all EFI variables, it should be treated as EFI_SUCEESS. To address the checkpatch warning of too many leading tabs, combine two if statement into one. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
ce327084 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: carve out efi_get_next_variable_name_int calls To retrieve the EFI variable name by efi_get_next_variable_name_int(), the sequence of alloc -> efi_get_next_variable_name_int -> realloc -> efi_get_next_variable_name_int is required. In current code, this sequence repeatedly appears in the several functions. It should be curved out a common function. This commit also fixes the missing free() of var_name16 in eficonfig_delete_invalid_boot_option(). Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
140a8959 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use efi_get_next_variable_name_int() eficonfig command reads all possible UEFI load options from 0x0000 to 0xFFFF to construct the menu. This takes too much time in some environment. This commit uses efi_get_next_variable_name_int() to read all existing UEFI load options to significantlly reduce the count of efi_get_var() call. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
78b1ccc4 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use u16_strsize() to get u16 string buffer size Use u16_strsize() to simplify the u16 string buffer size calculation. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c67d3c9e |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix going one directory up issue The directory name in eficonfig menu entry contains the '\' separator. strcmp() argument ".." is wrong and one directory up handling does not work correctly. strcmp() argument must include '\' separator. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c3b5af63 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add UEFI Secure Boot Key enrollment interface This commit adds the menu-driven UEFI Secure Boot Key enrollment interface. User can enroll PK, KEK, db and dbx by selecting file. Only the signed EFI Signature List(s) with an authenticated header, typically '.auth' file, is accepted. To clear the PK, KEK, db and dbx, user needs to enroll the null key signed by PK or KEK. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
21faf4ef |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use protocol interface for file selection EFI_SIMPLE_FILE_SYSTEM_PROTOCOL is not always provided by U-Boot. Use protocol interface functions instead of U-Boot internal functions. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d6566113 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose eficonfig_create_device_path() Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use eficonfig_create_device_path() to construct the full device path from device path of the volume and file path, so move it out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d571f9b2 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation All the eficonfig menus other than "Change Boot Order" use 'eficonfig_entry' structure for each menu entry. This commit refactors change boot order implementation to use 'eficonfig_entry' structure same as other menus to have consistent menu handling. This commit also simplifies the data->active handling when KEY_SPACE is pressed, and sizeof() parameter. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
8961e93e |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose append entry function Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use append_entry() and append_quit_entry() to construct the menu, so move them out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
a84040ab |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor file selection handling eficonfig_select_file_handler() is commonly used to select the file. eficonfig_display_select_file_option() adds an additional menu to clear the selected file. eficonfig_display_select_file_option() is not always necessary for the file selection process, so it must be outside of eficonfig_select_file_handler(). This commit also renames the following functions to avoid confusion. eficonfig_select_file_handler() -> eficonfig_process_select_file() eficonfig_select_file() -> eficonfig_show_file_selection() eficonfig_display_select_file_option() -> eficonfig_process_show_file_option() Finally, test_eficonfig.py need to be updated to get aligned with the above modification. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
1167e88a |
|
14-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix missing variable initialization The 'ret' variable must be initialized before use in eficonfig_delete_invalid_boot_option(). Fixes: c416f1c0bc ("bootmenu: add removable media entries") Addresses-Coverity: 376207 ("Uninitialized variables") Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
3d595ac5 |
|
09-Nov-2022 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: remove superfluous if in eficonfig_edit_boot_option Goto for an immediately succeeding label is superfluous. Fixes: 87d791423ac6 ("eficonfig: menu-driven addition of UEFI boot option") Addresses-Coverity: 376202 ("Identical code for different branches") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
9945bc4f |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Fix incorrect return code of boot option update Correct the return code for out-of-memory and no boot option found Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
339b527b |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Move bootorder and bootoption apis to lib Rename and move bootorder and bootoption apis from cmd to lib for re-use between eficonfig and bootmgr Fix 'unexpected indentation' when 'make htmldocs' after functions are moved Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
2c0b0c31 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_SECURE_BOOT This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_SECURE_BOOT defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
83f3d121 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_MM_COMM_TEE This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_MM_COMM_TEE defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
88df3634 |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: CTRL+S to save the boot order 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>
|
#
45f5319f |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
menu: remove CTRL+C to quit On the sandbox called without "--terminal raw" CTRL+C leaves U-Boot, "ESC/CTRL+C to quit" is misleading. Let's remove CTRL+C to quit key handling from bootmenu and eficonfig menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
|
#
8dbd0a0f |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add vertical scroll support The current eficonfig menu does not support vertical scroll, so it can not display the menu entries greater than the console row size. This commit add the vertial scroll support. The console size is retrieved by SIMPLE_TEXT_OUTPUT_PROTOCOL.QueryMode() service, then calculates the row size for menu entry by subtracting menu header and description row size from the console row size. "start" and "end" are added in the efimenu structure. "start" keeps the menu entry index at the top, "end" keeps the bottom menu entry index. item_data_print() menu function only draws the menu entry between "start" and "end". This commit also fixes the issue that "Save" and "Quit" entries can be moved by BKEY_PLUS in change boot order menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
0d590852 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation This commit removes the change boot order specific menu implementation. The change boot order implementation calls eficonfig_process_common() same as other menus. The change boot order menu requires own item_data_print and item_choice implementation, but display_statusline function can be a same function as other menus. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
cd160b27 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor eficonfig_process_common function Current change boot order implementation does not call eficonfig_process_common() and call own menu functions for display_statusline, item_data_print and item_choice. Change boot order functionality should call eficonfig_process_common() to improve maintenanceability. This commit is a preparation to remove the change boot order specific implementation. The menu functions (display_statusline, item_data_print and item_choice) are added as argument of eficonfig_process_common(). The menu description string displayed at the bottom of the menu is also added as argument. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
32bab0ea |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Make use of CLI character processing Avoid duplicating some of the escape-sequence processing here and use the CLI function instead. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
d0ca98db |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Update bootmenu_loop() to return the code Use the return value to save having to pass around a pointer. This also resolves any ambiguity about what *key contains when the function is called. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
2da4a15e |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Rename KEY_... to BKEY_... This enum values conflict with linux/input.h so rename them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
64550274 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: avoid SetVariable between GetNextVariableName calls The current code calls efi_set_variable_int() to delete the invalid boot option between calls to efi_get_next_variable_name_int(), it may produce unpredictable results. This commit moves removal of the invalid boot option outside of the efi_get_next_variable_name_int() calls. EFI_NOT_FOUND returned from efi_get_next_variable_name_int() indicates we retrieved all EFI variables, it should be treated as EFI_SUCEESS. To address the checkpatch warning of too many leading tabs, combine two if statement into one. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
ce327084 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: carve out efi_get_next_variable_name_int calls To retrieve the EFI variable name by efi_get_next_variable_name_int(), the sequence of alloc -> efi_get_next_variable_name_int -> realloc -> efi_get_next_variable_name_int is required. In current code, this sequence repeatedly appears in the several functions. It should be curved out a common function. This commit also fixes the missing free() of var_name16 in eficonfig_delete_invalid_boot_option(). Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
140a8959 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use efi_get_next_variable_name_int() eficonfig command reads all possible UEFI load options from 0x0000 to 0xFFFF to construct the menu. This takes too much time in some environment. This commit uses efi_get_next_variable_name_int() to read all existing UEFI load options to significantlly reduce the count of efi_get_var() call. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
78b1ccc4 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use u16_strsize() to get u16 string buffer size Use u16_strsize() to simplify the u16 string buffer size calculation. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c67d3c9e |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix going one directory up issue The directory name in eficonfig menu entry contains the '\' separator. strcmp() argument ".." is wrong and one directory up handling does not work correctly. strcmp() argument must include '\' separator. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c3b5af63 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add UEFI Secure Boot Key enrollment interface This commit adds the menu-driven UEFI Secure Boot Key enrollment interface. User can enroll PK, KEK, db and dbx by selecting file. Only the signed EFI Signature List(s) with an authenticated header, typically '.auth' file, is accepted. To clear the PK, KEK, db and dbx, user needs to enroll the null key signed by PK or KEK. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
21faf4ef |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use protocol interface for file selection EFI_SIMPLE_FILE_SYSTEM_PROTOCOL is not always provided by U-Boot. Use protocol interface functions instead of U-Boot internal functions. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d6566113 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose eficonfig_create_device_path() Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use eficonfig_create_device_path() to construct the full device path from device path of the volume and file path, so move it out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d571f9b2 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation All the eficonfig menus other than "Change Boot Order" use 'eficonfig_entry' structure for each menu entry. This commit refactors change boot order implementation to use 'eficonfig_entry' structure same as other menus to have consistent menu handling. This commit also simplifies the data->active handling when KEY_SPACE is pressed, and sizeof() parameter. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
8961e93e |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose append entry function Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use append_entry() and append_quit_entry() to construct the menu, so move them out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
a84040ab |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor file selection handling eficonfig_select_file_handler() is commonly used to select the file. eficonfig_display_select_file_option() adds an additional menu to clear the selected file. eficonfig_display_select_file_option() is not always necessary for the file selection process, so it must be outside of eficonfig_select_file_handler(). This commit also renames the following functions to avoid confusion. eficonfig_select_file_handler() -> eficonfig_process_select_file() eficonfig_select_file() -> eficonfig_show_file_selection() eficonfig_display_select_file_option() -> eficonfig_process_show_file_option() Finally, test_eficonfig.py need to be updated to get aligned with the above modification. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
1167e88a |
|
14-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix missing variable initialization The 'ret' variable must be initialized before use in eficonfig_delete_invalid_boot_option(). Fixes: c416f1c0bc ("bootmenu: add removable media entries") Addresses-Coverity: 376207 ("Uninitialized variables") Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
3d595ac5 |
|
09-Nov-2022 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: remove superfluous if in eficonfig_edit_boot_option Goto for an immediately succeeding label is superfluous. Fixes: 87d791423ac6 ("eficonfig: menu-driven addition of UEFI boot option") Addresses-Coverity: 376202 ("Identical code for different branches") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
9945bc4f |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Fix incorrect return code of boot option update Correct the return code for out-of-memory and no boot option found Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
339b527b |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Move bootorder and bootoption apis to lib Rename and move bootorder and bootoption apis from cmd to lib for re-use between eficonfig and bootmgr Fix 'unexpected indentation' when 'make htmldocs' after functions are moved Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
2c0b0c31 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_SECURE_BOOT This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_SECURE_BOOT defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
83f3d121 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_MM_COMM_TEE This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_MM_COMM_TEE defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
88df3634 |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: CTRL+S to save the boot order 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>
|
#
45f5319f |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
menu: remove CTRL+C to quit On the sandbox called without "--terminal raw" CTRL+C leaves U-Boot, "ESC/CTRL+C to quit" is misleading. Let's remove CTRL+C to quit key handling from bootmenu and eficonfig menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
|
#
8dbd0a0f |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add vertical scroll support The current eficonfig menu does not support vertical scroll, so it can not display the menu entries greater than the console row size. This commit add the vertial scroll support. The console size is retrieved by SIMPLE_TEXT_OUTPUT_PROTOCOL.QueryMode() service, then calculates the row size for menu entry by subtracting menu header and description row size from the console row size. "start" and "end" are added in the efimenu structure. "start" keeps the menu entry index at the top, "end" keeps the bottom menu entry index. item_data_print() menu function only draws the menu entry between "start" and "end". This commit also fixes the issue that "Save" and "Quit" entries can be moved by BKEY_PLUS in change boot order menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
0d590852 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation This commit removes the change boot order specific menu implementation. The change boot order implementation calls eficonfig_process_common() same as other menus. The change boot order menu requires own item_data_print and item_choice implementation, but display_statusline function can be a same function as other menus. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
cd160b27 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor eficonfig_process_common function Current change boot order implementation does not call eficonfig_process_common() and call own menu functions for display_statusline, item_data_print and item_choice. Change boot order functionality should call eficonfig_process_common() to improve maintenanceability. This commit is a preparation to remove the change boot order specific implementation. The menu functions (display_statusline, item_data_print and item_choice) are added as argument of eficonfig_process_common(). The menu description string displayed at the bottom of the menu is also added as argument. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
32bab0ea |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Make use of CLI character processing Avoid duplicating some of the escape-sequence processing here and use the CLI function instead. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
d0ca98db |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Update bootmenu_loop() to return the code Use the return value to save having to pass around a pointer. This also resolves any ambiguity about what *key contains when the function is called. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
2da4a15e |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Rename KEY_... to BKEY_... This enum values conflict with linux/input.h so rename them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
64550274 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: avoid SetVariable between GetNextVariableName calls The current code calls efi_set_variable_int() to delete the invalid boot option between calls to efi_get_next_variable_name_int(), it may produce unpredictable results. This commit moves removal of the invalid boot option outside of the efi_get_next_variable_name_int() calls. EFI_NOT_FOUND returned from efi_get_next_variable_name_int() indicates we retrieved all EFI variables, it should be treated as EFI_SUCEESS. To address the checkpatch warning of too many leading tabs, combine two if statement into one. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
ce327084 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: carve out efi_get_next_variable_name_int calls To retrieve the EFI variable name by efi_get_next_variable_name_int(), the sequence of alloc -> efi_get_next_variable_name_int -> realloc -> efi_get_next_variable_name_int is required. In current code, this sequence repeatedly appears in the several functions. It should be curved out a common function. This commit also fixes the missing free() of var_name16 in eficonfig_delete_invalid_boot_option(). Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
140a8959 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use efi_get_next_variable_name_int() eficonfig command reads all possible UEFI load options from 0x0000 to 0xFFFF to construct the menu. This takes too much time in some environment. This commit uses efi_get_next_variable_name_int() to read all existing UEFI load options to significantlly reduce the count of efi_get_var() call. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
78b1ccc4 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use u16_strsize() to get u16 string buffer size Use u16_strsize() to simplify the u16 string buffer size calculation. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c67d3c9e |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix going one directory up issue The directory name in eficonfig menu entry contains the '\' separator. strcmp() argument ".." is wrong and one directory up handling does not work correctly. strcmp() argument must include '\' separator. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c3b5af63 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add UEFI Secure Boot Key enrollment interface This commit adds the menu-driven UEFI Secure Boot Key enrollment interface. User can enroll PK, KEK, db and dbx by selecting file. Only the signed EFI Signature List(s) with an authenticated header, typically '.auth' file, is accepted. To clear the PK, KEK, db and dbx, user needs to enroll the null key signed by PK or KEK. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
21faf4ef |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use protocol interface for file selection EFI_SIMPLE_FILE_SYSTEM_PROTOCOL is not always provided by U-Boot. Use protocol interface functions instead of U-Boot internal functions. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d6566113 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose eficonfig_create_device_path() Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use eficonfig_create_device_path() to construct the full device path from device path of the volume and file path, so move it out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d571f9b2 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation All the eficonfig menus other than "Change Boot Order" use 'eficonfig_entry' structure for each menu entry. This commit refactors change boot order implementation to use 'eficonfig_entry' structure same as other menus to have consistent menu handling. This commit also simplifies the data->active handling when KEY_SPACE is pressed, and sizeof() parameter. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
8961e93e |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose append entry function Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use append_entry() and append_quit_entry() to construct the menu, so move them out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
a84040ab |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor file selection handling eficonfig_select_file_handler() is commonly used to select the file. eficonfig_display_select_file_option() adds an additional menu to clear the selected file. eficonfig_display_select_file_option() is not always necessary for the file selection process, so it must be outside of eficonfig_select_file_handler(). This commit also renames the following functions to avoid confusion. eficonfig_select_file_handler() -> eficonfig_process_select_file() eficonfig_select_file() -> eficonfig_show_file_selection() eficonfig_display_select_file_option() -> eficonfig_process_show_file_option() Finally, test_eficonfig.py need to be updated to get aligned with the above modification. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
1167e88a |
|
14-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix missing variable initialization The 'ret' variable must be initialized before use in eficonfig_delete_invalid_boot_option(). Fixes: c416f1c0bc ("bootmenu: add removable media entries") Addresses-Coverity: 376207 ("Uninitialized variables") Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
3d595ac5 |
|
09-Nov-2022 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: remove superfluous if in eficonfig_edit_boot_option Goto for an immediately succeeding label is superfluous. Fixes: 87d791423ac6 ("eficonfig: menu-driven addition of UEFI boot option") Addresses-Coverity: 376202 ("Identical code for different branches") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
9945bc4f |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Fix incorrect return code of boot option update Correct the return code for out-of-memory and no boot option found Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
339b527b |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Move bootorder and bootoption apis to lib Rename and move bootorder and bootoption apis from cmd to lib for re-use between eficonfig and bootmgr Fix 'unexpected indentation' when 'make htmldocs' after functions are moved Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
2c0b0c31 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_SECURE_BOOT This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_SECURE_BOOT defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
83f3d121 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_MM_COMM_TEE This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_MM_COMM_TEE defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
88df3634 |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: CTRL+S to save the boot order 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>
|
#
45f5319f |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
menu: remove CTRL+C to quit On the sandbox called without "--terminal raw" CTRL+C leaves U-Boot, "ESC/CTRL+C to quit" is misleading. Let's remove CTRL+C to quit key handling from bootmenu and eficonfig menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
|
#
8dbd0a0f |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add vertical scroll support The current eficonfig menu does not support vertical scroll, so it can not display the menu entries greater than the console row size. This commit add the vertial scroll support. The console size is retrieved by SIMPLE_TEXT_OUTPUT_PROTOCOL.QueryMode() service, then calculates the row size for menu entry by subtracting menu header and description row size from the console row size. "start" and "end" are added in the efimenu structure. "start" keeps the menu entry index at the top, "end" keeps the bottom menu entry index. item_data_print() menu function only draws the menu entry between "start" and "end". This commit also fixes the issue that "Save" and "Quit" entries can be moved by BKEY_PLUS in change boot order menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
0d590852 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation This commit removes the change boot order specific menu implementation. The change boot order implementation calls eficonfig_process_common() same as other menus. The change boot order menu requires own item_data_print and item_choice implementation, but display_statusline function can be a same function as other menus. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
cd160b27 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor eficonfig_process_common function Current change boot order implementation does not call eficonfig_process_common() and call own menu functions for display_statusline, item_data_print and item_choice. Change boot order functionality should call eficonfig_process_common() to improve maintenanceability. This commit is a preparation to remove the change boot order specific implementation. The menu functions (display_statusline, item_data_print and item_choice) are added as argument of eficonfig_process_common(). The menu description string displayed at the bottom of the menu is also added as argument. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
32bab0ea |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Make use of CLI character processing Avoid duplicating some of the escape-sequence processing here and use the CLI function instead. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
d0ca98db |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Update bootmenu_loop() to return the code Use the return value to save having to pass around a pointer. This also resolves any ambiguity about what *key contains when the function is called. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
2da4a15e |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Rename KEY_... to BKEY_... This enum values conflict with linux/input.h so rename them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
64550274 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: avoid SetVariable between GetNextVariableName calls The current code calls efi_set_variable_int() to delete the invalid boot option between calls to efi_get_next_variable_name_int(), it may produce unpredictable results. This commit moves removal of the invalid boot option outside of the efi_get_next_variable_name_int() calls. EFI_NOT_FOUND returned from efi_get_next_variable_name_int() indicates we retrieved all EFI variables, it should be treated as EFI_SUCEESS. To address the checkpatch warning of too many leading tabs, combine two if statement into one. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
ce327084 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: carve out efi_get_next_variable_name_int calls To retrieve the EFI variable name by efi_get_next_variable_name_int(), the sequence of alloc -> efi_get_next_variable_name_int -> realloc -> efi_get_next_variable_name_int is required. In current code, this sequence repeatedly appears in the several functions. It should be curved out a common function. This commit also fixes the missing free() of var_name16 in eficonfig_delete_invalid_boot_option(). Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
140a8959 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use efi_get_next_variable_name_int() eficonfig command reads all possible UEFI load options from 0x0000 to 0xFFFF to construct the menu. This takes too much time in some environment. This commit uses efi_get_next_variable_name_int() to read all existing UEFI load options to significantlly reduce the count of efi_get_var() call. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
78b1ccc4 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use u16_strsize() to get u16 string buffer size Use u16_strsize() to simplify the u16 string buffer size calculation. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c67d3c9e |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix going one directory up issue The directory name in eficonfig menu entry contains the '\' separator. strcmp() argument ".." is wrong and one directory up handling does not work correctly. strcmp() argument must include '\' separator. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c3b5af63 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add UEFI Secure Boot Key enrollment interface This commit adds the menu-driven UEFI Secure Boot Key enrollment interface. User can enroll PK, KEK, db and dbx by selecting file. Only the signed EFI Signature List(s) with an authenticated header, typically '.auth' file, is accepted. To clear the PK, KEK, db and dbx, user needs to enroll the null key signed by PK or KEK. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
21faf4ef |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use protocol interface for file selection EFI_SIMPLE_FILE_SYSTEM_PROTOCOL is not always provided by U-Boot. Use protocol interface functions instead of U-Boot internal functions. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d6566113 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose eficonfig_create_device_path() Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use eficonfig_create_device_path() to construct the full device path from device path of the volume and file path, so move it out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d571f9b2 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation All the eficonfig menus other than "Change Boot Order" use 'eficonfig_entry' structure for each menu entry. This commit refactors change boot order implementation to use 'eficonfig_entry' structure same as other menus to have consistent menu handling. This commit also simplifies the data->active handling when KEY_SPACE is pressed, and sizeof() parameter. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
8961e93e |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose append entry function Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use append_entry() and append_quit_entry() to construct the menu, so move them out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
a84040ab |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor file selection handling eficonfig_select_file_handler() is commonly used to select the file. eficonfig_display_select_file_option() adds an additional menu to clear the selected file. eficonfig_display_select_file_option() is not always necessary for the file selection process, so it must be outside of eficonfig_select_file_handler(). This commit also renames the following functions to avoid confusion. eficonfig_select_file_handler() -> eficonfig_process_select_file() eficonfig_select_file() -> eficonfig_show_file_selection() eficonfig_display_select_file_option() -> eficonfig_process_show_file_option() Finally, test_eficonfig.py need to be updated to get aligned with the above modification. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
1167e88a |
|
14-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix missing variable initialization The 'ret' variable must be initialized before use in eficonfig_delete_invalid_boot_option(). Fixes: c416f1c0bc ("bootmenu: add removable media entries") Addresses-Coverity: 376207 ("Uninitialized variables") Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
3d595ac5 |
|
09-Nov-2022 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: remove superfluous if in eficonfig_edit_boot_option Goto for an immediately succeeding label is superfluous. Fixes: 87d791423ac6 ("eficonfig: menu-driven addition of UEFI boot option") Addresses-Coverity: 376202 ("Identical code for different branches") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
9945bc4f |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Fix incorrect return code of boot option update Correct the return code for out-of-memory and no boot option found Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
339b527b |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Move bootorder and bootoption apis to lib Rename and move bootorder and bootoption apis from cmd to lib for re-use between eficonfig and bootmgr Fix 'unexpected indentation' when 'make htmldocs' after functions are moved Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
2c0b0c31 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_SECURE_BOOT This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_SECURE_BOOT defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
83f3d121 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_MM_COMM_TEE This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_MM_COMM_TEE defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
88df3634 |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: CTRL+S to save the boot order 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>
|
#
45f5319f |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
menu: remove CTRL+C to quit On the sandbox called without "--terminal raw" CTRL+C leaves U-Boot, "ESC/CTRL+C to quit" is misleading. Let's remove CTRL+C to quit key handling from bootmenu and eficonfig menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
|
#
8dbd0a0f |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add vertical scroll support The current eficonfig menu does not support vertical scroll, so it can not display the menu entries greater than the console row size. This commit add the vertial scroll support. The console size is retrieved by SIMPLE_TEXT_OUTPUT_PROTOCOL.QueryMode() service, then calculates the row size for menu entry by subtracting menu header and description row size from the console row size. "start" and "end" are added in the efimenu structure. "start" keeps the menu entry index at the top, "end" keeps the bottom menu entry index. item_data_print() menu function only draws the menu entry between "start" and "end". This commit also fixes the issue that "Save" and "Quit" entries can be moved by BKEY_PLUS in change boot order menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
0d590852 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation This commit removes the change boot order specific menu implementation. The change boot order implementation calls eficonfig_process_common() same as other menus. The change boot order menu requires own item_data_print and item_choice implementation, but display_statusline function can be a same function as other menus. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
cd160b27 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor eficonfig_process_common function Current change boot order implementation does not call eficonfig_process_common() and call own menu functions for display_statusline, item_data_print and item_choice. Change boot order functionality should call eficonfig_process_common() to improve maintenanceability. This commit is a preparation to remove the change boot order specific implementation. The menu functions (display_statusline, item_data_print and item_choice) are added as argument of eficonfig_process_common(). The menu description string displayed at the bottom of the menu is also added as argument. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
32bab0ea |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Make use of CLI character processing Avoid duplicating some of the escape-sequence processing here and use the CLI function instead. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
d0ca98db |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Update bootmenu_loop() to return the code Use the return value to save having to pass around a pointer. This also resolves any ambiguity about what *key contains when the function is called. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
2da4a15e |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Rename KEY_... to BKEY_... This enum values conflict with linux/input.h so rename them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
64550274 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: avoid SetVariable between GetNextVariableName calls The current code calls efi_set_variable_int() to delete the invalid boot option between calls to efi_get_next_variable_name_int(), it may produce unpredictable results. This commit moves removal of the invalid boot option outside of the efi_get_next_variable_name_int() calls. EFI_NOT_FOUND returned from efi_get_next_variable_name_int() indicates we retrieved all EFI variables, it should be treated as EFI_SUCEESS. To address the checkpatch warning of too many leading tabs, combine two if statement into one. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
ce327084 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: carve out efi_get_next_variable_name_int calls To retrieve the EFI variable name by efi_get_next_variable_name_int(), the sequence of alloc -> efi_get_next_variable_name_int -> realloc -> efi_get_next_variable_name_int is required. In current code, this sequence repeatedly appears in the several functions. It should be curved out a common function. This commit also fixes the missing free() of var_name16 in eficonfig_delete_invalid_boot_option(). Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
140a8959 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use efi_get_next_variable_name_int() eficonfig command reads all possible UEFI load options from 0x0000 to 0xFFFF to construct the menu. This takes too much time in some environment. This commit uses efi_get_next_variable_name_int() to read all existing UEFI load options to significantlly reduce the count of efi_get_var() call. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
78b1ccc4 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use u16_strsize() to get u16 string buffer size Use u16_strsize() to simplify the u16 string buffer size calculation. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c67d3c9e |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix going one directory up issue The directory name in eficonfig menu entry contains the '\' separator. strcmp() argument ".." is wrong and one directory up handling does not work correctly. strcmp() argument must include '\' separator. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c3b5af63 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add UEFI Secure Boot Key enrollment interface This commit adds the menu-driven UEFI Secure Boot Key enrollment interface. User can enroll PK, KEK, db and dbx by selecting file. Only the signed EFI Signature List(s) with an authenticated header, typically '.auth' file, is accepted. To clear the PK, KEK, db and dbx, user needs to enroll the null key signed by PK or KEK. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
21faf4ef |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use protocol interface for file selection EFI_SIMPLE_FILE_SYSTEM_PROTOCOL is not always provided by U-Boot. Use protocol interface functions instead of U-Boot internal functions. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d6566113 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose eficonfig_create_device_path() Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use eficonfig_create_device_path() to construct the full device path from device path of the volume and file path, so move it out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d571f9b2 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation All the eficonfig menus other than "Change Boot Order" use 'eficonfig_entry' structure for each menu entry. This commit refactors change boot order implementation to use 'eficonfig_entry' structure same as other menus to have consistent menu handling. This commit also simplifies the data->active handling when KEY_SPACE is pressed, and sizeof() parameter. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
8961e93e |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose append entry function Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use append_entry() and append_quit_entry() to construct the menu, so move them out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
a84040ab |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor file selection handling eficonfig_select_file_handler() is commonly used to select the file. eficonfig_display_select_file_option() adds an additional menu to clear the selected file. eficonfig_display_select_file_option() is not always necessary for the file selection process, so it must be outside of eficonfig_select_file_handler(). This commit also renames the following functions to avoid confusion. eficonfig_select_file_handler() -> eficonfig_process_select_file() eficonfig_select_file() -> eficonfig_show_file_selection() eficonfig_display_select_file_option() -> eficonfig_process_show_file_option() Finally, test_eficonfig.py need to be updated to get aligned with the above modification. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
1167e88a |
|
14-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix missing variable initialization The 'ret' variable must be initialized before use in eficonfig_delete_invalid_boot_option(). Fixes: c416f1c0bc ("bootmenu: add removable media entries") Addresses-Coverity: 376207 ("Uninitialized variables") Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
3d595ac5 |
|
09-Nov-2022 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: remove superfluous if in eficonfig_edit_boot_option Goto for an immediately succeeding label is superfluous. Fixes: 87d791423ac6 ("eficonfig: menu-driven addition of UEFI boot option") Addresses-Coverity: 376202 ("Identical code for different branches") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
9945bc4f |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Fix incorrect return code of boot option update Correct the return code for out-of-memory and no boot option found Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
339b527b |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Move bootorder and bootoption apis to lib Rename and move bootorder and bootoption apis from cmd to lib for re-use between eficonfig and bootmgr Fix 'unexpected indentation' when 'make htmldocs' after functions are moved Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
2c0b0c31 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_SECURE_BOOT This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_SECURE_BOOT defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
83f3d121 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_MM_COMM_TEE This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_MM_COMM_TEE defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
88df3634 |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: CTRL+S to save the boot order 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>
|
#
45f5319f |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
menu: remove CTRL+C to quit On the sandbox called without "--terminal raw" CTRL+C leaves U-Boot, "ESC/CTRL+C to quit" is misleading. Let's remove CTRL+C to quit key handling from bootmenu and eficonfig menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
|
#
8dbd0a0f |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add vertical scroll support The current eficonfig menu does not support vertical scroll, so it can not display the menu entries greater than the console row size. This commit add the vertial scroll support. The console size is retrieved by SIMPLE_TEXT_OUTPUT_PROTOCOL.QueryMode() service, then calculates the row size for menu entry by subtracting menu header and description row size from the console row size. "start" and "end" are added in the efimenu structure. "start" keeps the menu entry index at the top, "end" keeps the bottom menu entry index. item_data_print() menu function only draws the menu entry between "start" and "end". This commit also fixes the issue that "Save" and "Quit" entries can be moved by BKEY_PLUS in change boot order menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
0d590852 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation This commit removes the change boot order specific menu implementation. The change boot order implementation calls eficonfig_process_common() same as other menus. The change boot order menu requires own item_data_print and item_choice implementation, but display_statusline function can be a same function as other menus. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
cd160b27 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor eficonfig_process_common function Current change boot order implementation does not call eficonfig_process_common() and call own menu functions for display_statusline, item_data_print and item_choice. Change boot order functionality should call eficonfig_process_common() to improve maintenanceability. This commit is a preparation to remove the change boot order specific implementation. The menu functions (display_statusline, item_data_print and item_choice) are added as argument of eficonfig_process_common(). The menu description string displayed at the bottom of the menu is also added as argument. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
32bab0ea |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Make use of CLI character processing Avoid duplicating some of the escape-sequence processing here and use the CLI function instead. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
d0ca98db |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Update bootmenu_loop() to return the code Use the return value to save having to pass around a pointer. This also resolves any ambiguity about what *key contains when the function is called. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
2da4a15e |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Rename KEY_... to BKEY_... This enum values conflict with linux/input.h so rename them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
64550274 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: avoid SetVariable between GetNextVariableName calls The current code calls efi_set_variable_int() to delete the invalid boot option between calls to efi_get_next_variable_name_int(), it may produce unpredictable results. This commit moves removal of the invalid boot option outside of the efi_get_next_variable_name_int() calls. EFI_NOT_FOUND returned from efi_get_next_variable_name_int() indicates we retrieved all EFI variables, it should be treated as EFI_SUCEESS. To address the checkpatch warning of too many leading tabs, combine two if statement into one. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
ce327084 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: carve out efi_get_next_variable_name_int calls To retrieve the EFI variable name by efi_get_next_variable_name_int(), the sequence of alloc -> efi_get_next_variable_name_int -> realloc -> efi_get_next_variable_name_int is required. In current code, this sequence repeatedly appears in the several functions. It should be curved out a common function. This commit also fixes the missing free() of var_name16 in eficonfig_delete_invalid_boot_option(). Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
140a8959 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use efi_get_next_variable_name_int() eficonfig command reads all possible UEFI load options from 0x0000 to 0xFFFF to construct the menu. This takes too much time in some environment. This commit uses efi_get_next_variable_name_int() to read all existing UEFI load options to significantlly reduce the count of efi_get_var() call. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
78b1ccc4 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use u16_strsize() to get u16 string buffer size Use u16_strsize() to simplify the u16 string buffer size calculation. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c67d3c9e |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix going one directory up issue The directory name in eficonfig menu entry contains the '\' separator. strcmp() argument ".." is wrong and one directory up handling does not work correctly. strcmp() argument must include '\' separator. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c3b5af63 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add UEFI Secure Boot Key enrollment interface This commit adds the menu-driven UEFI Secure Boot Key enrollment interface. User can enroll PK, KEK, db and dbx by selecting file. Only the signed EFI Signature List(s) with an authenticated header, typically '.auth' file, is accepted. To clear the PK, KEK, db and dbx, user needs to enroll the null key signed by PK or KEK. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
21faf4ef |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use protocol interface for file selection EFI_SIMPLE_FILE_SYSTEM_PROTOCOL is not always provided by U-Boot. Use protocol interface functions instead of U-Boot internal functions. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d6566113 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose eficonfig_create_device_path() Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use eficonfig_create_device_path() to construct the full device path from device path of the volume and file path, so move it out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d571f9b2 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation All the eficonfig menus other than "Change Boot Order" use 'eficonfig_entry' structure for each menu entry. This commit refactors change boot order implementation to use 'eficonfig_entry' structure same as other menus to have consistent menu handling. This commit also simplifies the data->active handling when KEY_SPACE is pressed, and sizeof() parameter. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
8961e93e |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose append entry function Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use append_entry() and append_quit_entry() to construct the menu, so move them out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
a84040ab |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor file selection handling eficonfig_select_file_handler() is commonly used to select the file. eficonfig_display_select_file_option() adds an additional menu to clear the selected file. eficonfig_display_select_file_option() is not always necessary for the file selection process, so it must be outside of eficonfig_select_file_handler(). This commit also renames the following functions to avoid confusion. eficonfig_select_file_handler() -> eficonfig_process_select_file() eficonfig_select_file() -> eficonfig_show_file_selection() eficonfig_display_select_file_option() -> eficonfig_process_show_file_option() Finally, test_eficonfig.py need to be updated to get aligned with the above modification. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
1167e88a |
|
14-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix missing variable initialization The 'ret' variable must be initialized before use in eficonfig_delete_invalid_boot_option(). Fixes: c416f1c0bc ("bootmenu: add removable media entries") Addresses-Coverity: 376207 ("Uninitialized variables") Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
3d595ac5 |
|
09-Nov-2022 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: remove superfluous if in eficonfig_edit_boot_option Goto for an immediately succeeding label is superfluous. Fixes: 87d791423ac6 ("eficonfig: menu-driven addition of UEFI boot option") Addresses-Coverity: 376202 ("Identical code for different branches") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
9945bc4f |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Fix incorrect return code of boot option update Correct the return code for out-of-memory and no boot option found Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
339b527b |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Move bootorder and bootoption apis to lib Rename and move bootorder and bootoption apis from cmd to lib for re-use between eficonfig and bootmgr Fix 'unexpected indentation' when 'make htmldocs' after functions are moved Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
2c0b0c31 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_SECURE_BOOT This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_SECURE_BOOT defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
83f3d121 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_MM_COMM_TEE This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_MM_COMM_TEE defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
88df3634 |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: CTRL+S to save the boot order 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>
|
#
45f5319f |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
menu: remove CTRL+C to quit On the sandbox called without "--terminal raw" CTRL+C leaves U-Boot, "ESC/CTRL+C to quit" is misleading. Let's remove CTRL+C to quit key handling from bootmenu and eficonfig menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
|
#
8dbd0a0f |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add vertical scroll support The current eficonfig menu does not support vertical scroll, so it can not display the menu entries greater than the console row size. This commit add the vertial scroll support. The console size is retrieved by SIMPLE_TEXT_OUTPUT_PROTOCOL.QueryMode() service, then calculates the row size for menu entry by subtracting menu header and description row size from the console row size. "start" and "end" are added in the efimenu structure. "start" keeps the menu entry index at the top, "end" keeps the bottom menu entry index. item_data_print() menu function only draws the menu entry between "start" and "end". This commit also fixes the issue that "Save" and "Quit" entries can be moved by BKEY_PLUS in change boot order menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
0d590852 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation This commit removes the change boot order specific menu implementation. The change boot order implementation calls eficonfig_process_common() same as other menus. The change boot order menu requires own item_data_print and item_choice implementation, but display_statusline function can be a same function as other menus. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
cd160b27 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor eficonfig_process_common function Current change boot order implementation does not call eficonfig_process_common() and call own menu functions for display_statusline, item_data_print and item_choice. Change boot order functionality should call eficonfig_process_common() to improve maintenanceability. This commit is a preparation to remove the change boot order specific implementation. The menu functions (display_statusline, item_data_print and item_choice) are added as argument of eficonfig_process_common(). The menu description string displayed at the bottom of the menu is also added as argument. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
32bab0ea |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Make use of CLI character processing Avoid duplicating some of the escape-sequence processing here and use the CLI function instead. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
d0ca98db |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Update bootmenu_loop() to return the code Use the return value to save having to pass around a pointer. This also resolves any ambiguity about what *key contains when the function is called. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
2da4a15e |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Rename KEY_... to BKEY_... This enum values conflict with linux/input.h so rename them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
64550274 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: avoid SetVariable between GetNextVariableName calls The current code calls efi_set_variable_int() to delete the invalid boot option between calls to efi_get_next_variable_name_int(), it may produce unpredictable results. This commit moves removal of the invalid boot option outside of the efi_get_next_variable_name_int() calls. EFI_NOT_FOUND returned from efi_get_next_variable_name_int() indicates we retrieved all EFI variables, it should be treated as EFI_SUCEESS. To address the checkpatch warning of too many leading tabs, combine two if statement into one. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
ce327084 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: carve out efi_get_next_variable_name_int calls To retrieve the EFI variable name by efi_get_next_variable_name_int(), the sequence of alloc -> efi_get_next_variable_name_int -> realloc -> efi_get_next_variable_name_int is required. In current code, this sequence repeatedly appears in the several functions. It should be curved out a common function. This commit also fixes the missing free() of var_name16 in eficonfig_delete_invalid_boot_option(). Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
140a8959 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use efi_get_next_variable_name_int() eficonfig command reads all possible UEFI load options from 0x0000 to 0xFFFF to construct the menu. This takes too much time in some environment. This commit uses efi_get_next_variable_name_int() to read all existing UEFI load options to significantlly reduce the count of efi_get_var() call. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
78b1ccc4 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use u16_strsize() to get u16 string buffer size Use u16_strsize() to simplify the u16 string buffer size calculation. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c67d3c9e |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix going one directory up issue The directory name in eficonfig menu entry contains the '\' separator. strcmp() argument ".." is wrong and one directory up handling does not work correctly. strcmp() argument must include '\' separator. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c3b5af63 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add UEFI Secure Boot Key enrollment interface This commit adds the menu-driven UEFI Secure Boot Key enrollment interface. User can enroll PK, KEK, db and dbx by selecting file. Only the signed EFI Signature List(s) with an authenticated header, typically '.auth' file, is accepted. To clear the PK, KEK, db and dbx, user needs to enroll the null key signed by PK or KEK. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
21faf4ef |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use protocol interface for file selection EFI_SIMPLE_FILE_SYSTEM_PROTOCOL is not always provided by U-Boot. Use protocol interface functions instead of U-Boot internal functions. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d6566113 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose eficonfig_create_device_path() Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use eficonfig_create_device_path() to construct the full device path from device path of the volume and file path, so move it out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d571f9b2 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation All the eficonfig menus other than "Change Boot Order" use 'eficonfig_entry' structure for each menu entry. This commit refactors change boot order implementation to use 'eficonfig_entry' structure same as other menus to have consistent menu handling. This commit also simplifies the data->active handling when KEY_SPACE is pressed, and sizeof() parameter. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
8961e93e |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose append entry function Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use append_entry() and append_quit_entry() to construct the menu, so move them out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
a84040ab |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor file selection handling eficonfig_select_file_handler() is commonly used to select the file. eficonfig_display_select_file_option() adds an additional menu to clear the selected file. eficonfig_display_select_file_option() is not always necessary for the file selection process, so it must be outside of eficonfig_select_file_handler(). This commit also renames the following functions to avoid confusion. eficonfig_select_file_handler() -> eficonfig_process_select_file() eficonfig_select_file() -> eficonfig_show_file_selection() eficonfig_display_select_file_option() -> eficonfig_process_show_file_option() Finally, test_eficonfig.py need to be updated to get aligned with the above modification. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
1167e88a |
|
14-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix missing variable initialization The 'ret' variable must be initialized before use in eficonfig_delete_invalid_boot_option(). Fixes: c416f1c0bc ("bootmenu: add removable media entries") Addresses-Coverity: 376207 ("Uninitialized variables") Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
3d595ac5 |
|
09-Nov-2022 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: remove superfluous if in eficonfig_edit_boot_option Goto for an immediately succeeding label is superfluous. Fixes: 87d791423ac6 ("eficonfig: menu-driven addition of UEFI boot option") Addresses-Coverity: 376202 ("Identical code for different branches") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
9945bc4f |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Fix incorrect return code of boot option update Correct the return code for out-of-memory and no boot option found Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
339b527b |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Move bootorder and bootoption apis to lib Rename and move bootorder and bootoption apis from cmd to lib for re-use between eficonfig and bootmgr Fix 'unexpected indentation' when 'make htmldocs' after functions are moved Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
2c0b0c31 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_SECURE_BOOT This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_SECURE_BOOT defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
83f3d121 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_MM_COMM_TEE This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_MM_COMM_TEE defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
88df3634 |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: CTRL+S to save the boot order 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>
|
#
45f5319f |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
menu: remove CTRL+C to quit On the sandbox called without "--terminal raw" CTRL+C leaves U-Boot, "ESC/CTRL+C to quit" is misleading. Let's remove CTRL+C to quit key handling from bootmenu and eficonfig menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
|
#
8dbd0a0f |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add vertical scroll support The current eficonfig menu does not support vertical scroll, so it can not display the menu entries greater than the console row size. This commit add the vertial scroll support. The console size is retrieved by SIMPLE_TEXT_OUTPUT_PROTOCOL.QueryMode() service, then calculates the row size for menu entry by subtracting menu header and description row size from the console row size. "start" and "end" are added in the efimenu structure. "start" keeps the menu entry index at the top, "end" keeps the bottom menu entry index. item_data_print() menu function only draws the menu entry between "start" and "end". This commit also fixes the issue that "Save" and "Quit" entries can be moved by BKEY_PLUS in change boot order menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
0d590852 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation This commit removes the change boot order specific menu implementation. The change boot order implementation calls eficonfig_process_common() same as other menus. The change boot order menu requires own item_data_print and item_choice implementation, but display_statusline function can be a same function as other menus. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
cd160b27 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor eficonfig_process_common function Current change boot order implementation does not call eficonfig_process_common() and call own menu functions for display_statusline, item_data_print and item_choice. Change boot order functionality should call eficonfig_process_common() to improve maintenanceability. This commit is a preparation to remove the change boot order specific implementation. The menu functions (display_statusline, item_data_print and item_choice) are added as argument of eficonfig_process_common(). The menu description string displayed at the bottom of the menu is also added as argument. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
32bab0ea |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Make use of CLI character processing Avoid duplicating some of the escape-sequence processing here and use the CLI function instead. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
d0ca98db |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Update bootmenu_loop() to return the code Use the return value to save having to pass around a pointer. This also resolves any ambiguity about what *key contains when the function is called. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
2da4a15e |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Rename KEY_... to BKEY_... This enum values conflict with linux/input.h so rename them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
64550274 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: avoid SetVariable between GetNextVariableName calls The current code calls efi_set_variable_int() to delete the invalid boot option between calls to efi_get_next_variable_name_int(), it may produce unpredictable results. This commit moves removal of the invalid boot option outside of the efi_get_next_variable_name_int() calls. EFI_NOT_FOUND returned from efi_get_next_variable_name_int() indicates we retrieved all EFI variables, it should be treated as EFI_SUCEESS. To address the checkpatch warning of too many leading tabs, combine two if statement into one. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
ce327084 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: carve out efi_get_next_variable_name_int calls To retrieve the EFI variable name by efi_get_next_variable_name_int(), the sequence of alloc -> efi_get_next_variable_name_int -> realloc -> efi_get_next_variable_name_int is required. In current code, this sequence repeatedly appears in the several functions. It should be curved out a common function. This commit also fixes the missing free() of var_name16 in eficonfig_delete_invalid_boot_option(). Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
140a8959 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use efi_get_next_variable_name_int() eficonfig command reads all possible UEFI load options from 0x0000 to 0xFFFF to construct the menu. This takes too much time in some environment. This commit uses efi_get_next_variable_name_int() to read all existing UEFI load options to significantlly reduce the count of efi_get_var() call. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
78b1ccc4 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use u16_strsize() to get u16 string buffer size Use u16_strsize() to simplify the u16 string buffer size calculation. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c67d3c9e |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix going one directory up issue The directory name in eficonfig menu entry contains the '\' separator. strcmp() argument ".." is wrong and one directory up handling does not work correctly. strcmp() argument must include '\' separator. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c3b5af63 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add UEFI Secure Boot Key enrollment interface This commit adds the menu-driven UEFI Secure Boot Key enrollment interface. User can enroll PK, KEK, db and dbx by selecting file. Only the signed EFI Signature List(s) with an authenticated header, typically '.auth' file, is accepted. To clear the PK, KEK, db and dbx, user needs to enroll the null key signed by PK or KEK. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
21faf4ef |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use protocol interface for file selection EFI_SIMPLE_FILE_SYSTEM_PROTOCOL is not always provided by U-Boot. Use protocol interface functions instead of U-Boot internal functions. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d6566113 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose eficonfig_create_device_path() Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use eficonfig_create_device_path() to construct the full device path from device path of the volume and file path, so move it out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d571f9b2 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation All the eficonfig menus other than "Change Boot Order" use 'eficonfig_entry' structure for each menu entry. This commit refactors change boot order implementation to use 'eficonfig_entry' structure same as other menus to have consistent menu handling. This commit also simplifies the data->active handling when KEY_SPACE is pressed, and sizeof() parameter. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
8961e93e |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose append entry function Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use append_entry() and append_quit_entry() to construct the menu, so move them out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
a84040ab |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor file selection handling eficonfig_select_file_handler() is commonly used to select the file. eficonfig_display_select_file_option() adds an additional menu to clear the selected file. eficonfig_display_select_file_option() is not always necessary for the file selection process, so it must be outside of eficonfig_select_file_handler(). This commit also renames the following functions to avoid confusion. eficonfig_select_file_handler() -> eficonfig_process_select_file() eficonfig_select_file() -> eficonfig_show_file_selection() eficonfig_display_select_file_option() -> eficonfig_process_show_file_option() Finally, test_eficonfig.py need to be updated to get aligned with the above modification. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
1167e88a |
|
14-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix missing variable initialization The 'ret' variable must be initialized before use in eficonfig_delete_invalid_boot_option(). Fixes: c416f1c0bc ("bootmenu: add removable media entries") Addresses-Coverity: 376207 ("Uninitialized variables") Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
3d595ac5 |
|
09-Nov-2022 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: remove superfluous if in eficonfig_edit_boot_option Goto for an immediately succeeding label is superfluous. Fixes: 87d791423ac6 ("eficonfig: menu-driven addition of UEFI boot option") Addresses-Coverity: 376202 ("Identical code for different branches") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
9945bc4f |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Fix incorrect return code of boot option update Correct the return code for out-of-memory and no boot option found Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
339b527b |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Move bootorder and bootoption apis to lib Rename and move bootorder and bootoption apis from cmd to lib for re-use between eficonfig and bootmgr Fix 'unexpected indentation' when 'make htmldocs' after functions are moved Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
2c0b0c31 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_SECURE_BOOT This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_SECURE_BOOT defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
83f3d121 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_MM_COMM_TEE This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_MM_COMM_TEE defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
88df3634 |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: CTRL+S to save the boot order 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>
|
#
45f5319f |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
menu: remove CTRL+C to quit On the sandbox called without "--terminal raw" CTRL+C leaves U-Boot, "ESC/CTRL+C to quit" is misleading. Let's remove CTRL+C to quit key handling from bootmenu and eficonfig menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
|
#
8dbd0a0f |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add vertical scroll support The current eficonfig menu does not support vertical scroll, so it can not display the menu entries greater than the console row size. This commit add the vertial scroll support. The console size is retrieved by SIMPLE_TEXT_OUTPUT_PROTOCOL.QueryMode() service, then calculates the row size for menu entry by subtracting menu header and description row size from the console row size. "start" and "end" are added in the efimenu structure. "start" keeps the menu entry index at the top, "end" keeps the bottom menu entry index. item_data_print() menu function only draws the menu entry between "start" and "end". This commit also fixes the issue that "Save" and "Quit" entries can be moved by BKEY_PLUS in change boot order menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
0d590852 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation This commit removes the change boot order specific menu implementation. The change boot order implementation calls eficonfig_process_common() same as other menus. The change boot order menu requires own item_data_print and item_choice implementation, but display_statusline function can be a same function as other menus. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
cd160b27 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor eficonfig_process_common function Current change boot order implementation does not call eficonfig_process_common() and call own menu functions for display_statusline, item_data_print and item_choice. Change boot order functionality should call eficonfig_process_common() to improve maintenanceability. This commit is a preparation to remove the change boot order specific implementation. The menu functions (display_statusline, item_data_print and item_choice) are added as argument of eficonfig_process_common(). The menu description string displayed at the bottom of the menu is also added as argument. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
32bab0ea |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Make use of CLI character processing Avoid duplicating some of the escape-sequence processing here and use the CLI function instead. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
d0ca98db |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Update bootmenu_loop() to return the code Use the return value to save having to pass around a pointer. This also resolves any ambiguity about what *key contains when the function is called. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
2da4a15e |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Rename KEY_... to BKEY_... This enum values conflict with linux/input.h so rename them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
64550274 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: avoid SetVariable between GetNextVariableName calls The current code calls efi_set_variable_int() to delete the invalid boot option between calls to efi_get_next_variable_name_int(), it may produce unpredictable results. This commit moves removal of the invalid boot option outside of the efi_get_next_variable_name_int() calls. EFI_NOT_FOUND returned from efi_get_next_variable_name_int() indicates we retrieved all EFI variables, it should be treated as EFI_SUCEESS. To address the checkpatch warning of too many leading tabs, combine two if statement into one. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
ce327084 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: carve out efi_get_next_variable_name_int calls To retrieve the EFI variable name by efi_get_next_variable_name_int(), the sequence of alloc -> efi_get_next_variable_name_int -> realloc -> efi_get_next_variable_name_int is required. In current code, this sequence repeatedly appears in the several functions. It should be curved out a common function. This commit also fixes the missing free() of var_name16 in eficonfig_delete_invalid_boot_option(). Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
140a8959 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use efi_get_next_variable_name_int() eficonfig command reads all possible UEFI load options from 0x0000 to 0xFFFF to construct the menu. This takes too much time in some environment. This commit uses efi_get_next_variable_name_int() to read all existing UEFI load options to significantlly reduce the count of efi_get_var() call. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
78b1ccc4 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use u16_strsize() to get u16 string buffer size Use u16_strsize() to simplify the u16 string buffer size calculation. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c67d3c9e |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix going one directory up issue The directory name in eficonfig menu entry contains the '\' separator. strcmp() argument ".." is wrong and one directory up handling does not work correctly. strcmp() argument must include '\' separator. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c3b5af63 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add UEFI Secure Boot Key enrollment interface This commit adds the menu-driven UEFI Secure Boot Key enrollment interface. User can enroll PK, KEK, db and dbx by selecting file. Only the signed EFI Signature List(s) with an authenticated header, typically '.auth' file, is accepted. To clear the PK, KEK, db and dbx, user needs to enroll the null key signed by PK or KEK. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
21faf4ef |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use protocol interface for file selection EFI_SIMPLE_FILE_SYSTEM_PROTOCOL is not always provided by U-Boot. Use protocol interface functions instead of U-Boot internal functions. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d6566113 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose eficonfig_create_device_path() Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use eficonfig_create_device_path() to construct the full device path from device path of the volume and file path, so move it out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d571f9b2 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation All the eficonfig menus other than "Change Boot Order" use 'eficonfig_entry' structure for each menu entry. This commit refactors change boot order implementation to use 'eficonfig_entry' structure same as other menus to have consistent menu handling. This commit also simplifies the data->active handling when KEY_SPACE is pressed, and sizeof() parameter. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
8961e93e |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose append entry function Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use append_entry() and append_quit_entry() to construct the menu, so move them out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
a84040ab |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor file selection handling eficonfig_select_file_handler() is commonly used to select the file. eficonfig_display_select_file_option() adds an additional menu to clear the selected file. eficonfig_display_select_file_option() is not always necessary for the file selection process, so it must be outside of eficonfig_select_file_handler(). This commit also renames the following functions to avoid confusion. eficonfig_select_file_handler() -> eficonfig_process_select_file() eficonfig_select_file() -> eficonfig_show_file_selection() eficonfig_display_select_file_option() -> eficonfig_process_show_file_option() Finally, test_eficonfig.py need to be updated to get aligned with the above modification. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
1167e88a |
|
14-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix missing variable initialization The 'ret' variable must be initialized before use in eficonfig_delete_invalid_boot_option(). Fixes: c416f1c0bc ("bootmenu: add removable media entries") Addresses-Coverity: 376207 ("Uninitialized variables") Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
3d595ac5 |
|
09-Nov-2022 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: remove superfluous if in eficonfig_edit_boot_option Goto for an immediately succeeding label is superfluous. Fixes: 87d791423ac6 ("eficonfig: menu-driven addition of UEFI boot option") Addresses-Coverity: 376202 ("Identical code for different branches") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
9945bc4f |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Fix incorrect return code of boot option update Correct the return code for out-of-memory and no boot option found Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
339b527b |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Move bootorder and bootoption apis to lib Rename and move bootorder and bootoption apis from cmd to lib for re-use between eficonfig and bootmgr Fix 'unexpected indentation' when 'make htmldocs' after functions are moved Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
2c0b0c31 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_SECURE_BOOT This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_SECURE_BOOT defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
83f3d121 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_MM_COMM_TEE This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_MM_COMM_TEE defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
88df3634 |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: CTRL+S to save the boot order 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>
|
#
45f5319f |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
menu: remove CTRL+C to quit On the sandbox called without "--terminal raw" CTRL+C leaves U-Boot, "ESC/CTRL+C to quit" is misleading. Let's remove CTRL+C to quit key handling from bootmenu and eficonfig menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
|
#
8dbd0a0f |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add vertical scroll support The current eficonfig menu does not support vertical scroll, so it can not display the menu entries greater than the console row size. This commit add the vertial scroll support. The console size is retrieved by SIMPLE_TEXT_OUTPUT_PROTOCOL.QueryMode() service, then calculates the row size for menu entry by subtracting menu header and description row size from the console row size. "start" and "end" are added in the efimenu structure. "start" keeps the menu entry index at the top, "end" keeps the bottom menu entry index. item_data_print() menu function only draws the menu entry between "start" and "end". This commit also fixes the issue that "Save" and "Quit" entries can be moved by BKEY_PLUS in change boot order menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
0d590852 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation This commit removes the change boot order specific menu implementation. The change boot order implementation calls eficonfig_process_common() same as other menus. The change boot order menu requires own item_data_print and item_choice implementation, but display_statusline function can be a same function as other menus. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
cd160b27 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor eficonfig_process_common function Current change boot order implementation does not call eficonfig_process_common() and call own menu functions for display_statusline, item_data_print and item_choice. Change boot order functionality should call eficonfig_process_common() to improve maintenanceability. This commit is a preparation to remove the change boot order specific implementation. The menu functions (display_statusline, item_data_print and item_choice) are added as argument of eficonfig_process_common(). The menu description string displayed at the bottom of the menu is also added as argument. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
32bab0ea |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Make use of CLI character processing Avoid duplicating some of the escape-sequence processing here and use the CLI function instead. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
d0ca98db |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Update bootmenu_loop() to return the code Use the return value to save having to pass around a pointer. This also resolves any ambiguity about what *key contains when the function is called. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
2da4a15e |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Rename KEY_... to BKEY_... This enum values conflict with linux/input.h so rename them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
64550274 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: avoid SetVariable between GetNextVariableName calls The current code calls efi_set_variable_int() to delete the invalid boot option between calls to efi_get_next_variable_name_int(), it may produce unpredictable results. This commit moves removal of the invalid boot option outside of the efi_get_next_variable_name_int() calls. EFI_NOT_FOUND returned from efi_get_next_variable_name_int() indicates we retrieved all EFI variables, it should be treated as EFI_SUCEESS. To address the checkpatch warning of too many leading tabs, combine two if statement into one. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
ce327084 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: carve out efi_get_next_variable_name_int calls To retrieve the EFI variable name by efi_get_next_variable_name_int(), the sequence of alloc -> efi_get_next_variable_name_int -> realloc -> efi_get_next_variable_name_int is required. In current code, this sequence repeatedly appears in the several functions. It should be curved out a common function. This commit also fixes the missing free() of var_name16 in eficonfig_delete_invalid_boot_option(). Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
140a8959 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use efi_get_next_variable_name_int() eficonfig command reads all possible UEFI load options from 0x0000 to 0xFFFF to construct the menu. This takes too much time in some environment. This commit uses efi_get_next_variable_name_int() to read all existing UEFI load options to significantlly reduce the count of efi_get_var() call. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
78b1ccc4 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use u16_strsize() to get u16 string buffer size Use u16_strsize() to simplify the u16 string buffer size calculation. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c67d3c9e |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix going one directory up issue The directory name in eficonfig menu entry contains the '\' separator. strcmp() argument ".." is wrong and one directory up handling does not work correctly. strcmp() argument must include '\' separator. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c3b5af63 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add UEFI Secure Boot Key enrollment interface This commit adds the menu-driven UEFI Secure Boot Key enrollment interface. User can enroll PK, KEK, db and dbx by selecting file. Only the signed EFI Signature List(s) with an authenticated header, typically '.auth' file, is accepted. To clear the PK, KEK, db and dbx, user needs to enroll the null key signed by PK or KEK. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
21faf4ef |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use protocol interface for file selection EFI_SIMPLE_FILE_SYSTEM_PROTOCOL is not always provided by U-Boot. Use protocol interface functions instead of U-Boot internal functions. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d6566113 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose eficonfig_create_device_path() Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use eficonfig_create_device_path() to construct the full device path from device path of the volume and file path, so move it out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d571f9b2 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation All the eficonfig menus other than "Change Boot Order" use 'eficonfig_entry' structure for each menu entry. This commit refactors change boot order implementation to use 'eficonfig_entry' structure same as other menus to have consistent menu handling. This commit also simplifies the data->active handling when KEY_SPACE is pressed, and sizeof() parameter. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
8961e93e |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose append entry function Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use append_entry() and append_quit_entry() to construct the menu, so move them out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
a84040ab |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor file selection handling eficonfig_select_file_handler() is commonly used to select the file. eficonfig_display_select_file_option() adds an additional menu to clear the selected file. eficonfig_display_select_file_option() is not always necessary for the file selection process, so it must be outside of eficonfig_select_file_handler(). This commit also renames the following functions to avoid confusion. eficonfig_select_file_handler() -> eficonfig_process_select_file() eficonfig_select_file() -> eficonfig_show_file_selection() eficonfig_display_select_file_option() -> eficonfig_process_show_file_option() Finally, test_eficonfig.py need to be updated to get aligned with the above modification. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
1167e88a |
|
14-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix missing variable initialization The 'ret' variable must be initialized before use in eficonfig_delete_invalid_boot_option(). Fixes: c416f1c0bc ("bootmenu: add removable media entries") Addresses-Coverity: 376207 ("Uninitialized variables") Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
3d595ac5 |
|
09-Nov-2022 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: remove superfluous if in eficonfig_edit_boot_option Goto for an immediately succeeding label is superfluous. Fixes: 87d791423ac6 ("eficonfig: menu-driven addition of UEFI boot option") Addresses-Coverity: 376202 ("Identical code for different branches") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
9945bc4f |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Fix incorrect return code of boot option update Correct the return code for out-of-memory and no boot option found Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
339b527b |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Move bootorder and bootoption apis to lib Rename and move bootorder and bootoption apis from cmd to lib for re-use between eficonfig and bootmgr Fix 'unexpected indentation' when 'make htmldocs' after functions are moved Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
2c0b0c31 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_SECURE_BOOT This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_SECURE_BOOT defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
83f3d121 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_MM_COMM_TEE This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_MM_COMM_TEE defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
88df3634 |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: CTRL+S to save the boot order 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>
|
#
45f5319f |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
menu: remove CTRL+C to quit On the sandbox called without "--terminal raw" CTRL+C leaves U-Boot, "ESC/CTRL+C to quit" is misleading. Let's remove CTRL+C to quit key handling from bootmenu and eficonfig menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
|
#
8dbd0a0f |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add vertical scroll support The current eficonfig menu does not support vertical scroll, so it can not display the menu entries greater than the console row size. This commit add the vertial scroll support. The console size is retrieved by SIMPLE_TEXT_OUTPUT_PROTOCOL.QueryMode() service, then calculates the row size for menu entry by subtracting menu header and description row size from the console row size. "start" and "end" are added in the efimenu structure. "start" keeps the menu entry index at the top, "end" keeps the bottom menu entry index. item_data_print() menu function only draws the menu entry between "start" and "end". This commit also fixes the issue that "Save" and "Quit" entries can be moved by BKEY_PLUS in change boot order menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
0d590852 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation This commit removes the change boot order specific menu implementation. The change boot order implementation calls eficonfig_process_common() same as other menus. The change boot order menu requires own item_data_print and item_choice implementation, but display_statusline function can be a same function as other menus. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
cd160b27 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor eficonfig_process_common function Current change boot order implementation does not call eficonfig_process_common() and call own menu functions for display_statusline, item_data_print and item_choice. Change boot order functionality should call eficonfig_process_common() to improve maintenanceability. This commit is a preparation to remove the change boot order specific implementation. The menu functions (display_statusline, item_data_print and item_choice) are added as argument of eficonfig_process_common(). The menu description string displayed at the bottom of the menu is also added as argument. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
32bab0ea |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Make use of CLI character processing Avoid duplicating some of the escape-sequence processing here and use the CLI function instead. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
d0ca98db |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Update bootmenu_loop() to return the code Use the return value to save having to pass around a pointer. This also resolves any ambiguity about what *key contains when the function is called. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
2da4a15e |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Rename KEY_... to BKEY_... This enum values conflict with linux/input.h so rename them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
64550274 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: avoid SetVariable between GetNextVariableName calls The current code calls efi_set_variable_int() to delete the invalid boot option between calls to efi_get_next_variable_name_int(), it may produce unpredictable results. This commit moves removal of the invalid boot option outside of the efi_get_next_variable_name_int() calls. EFI_NOT_FOUND returned from efi_get_next_variable_name_int() indicates we retrieved all EFI variables, it should be treated as EFI_SUCEESS. To address the checkpatch warning of too many leading tabs, combine two if statement into one. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
ce327084 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: carve out efi_get_next_variable_name_int calls To retrieve the EFI variable name by efi_get_next_variable_name_int(), the sequence of alloc -> efi_get_next_variable_name_int -> realloc -> efi_get_next_variable_name_int is required. In current code, this sequence repeatedly appears in the several functions. It should be curved out a common function. This commit also fixes the missing free() of var_name16 in eficonfig_delete_invalid_boot_option(). Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
140a8959 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use efi_get_next_variable_name_int() eficonfig command reads all possible UEFI load options from 0x0000 to 0xFFFF to construct the menu. This takes too much time in some environment. This commit uses efi_get_next_variable_name_int() to read all existing UEFI load options to significantlly reduce the count of efi_get_var() call. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
78b1ccc4 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use u16_strsize() to get u16 string buffer size Use u16_strsize() to simplify the u16 string buffer size calculation. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c67d3c9e |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix going one directory up issue The directory name in eficonfig menu entry contains the '\' separator. strcmp() argument ".." is wrong and one directory up handling does not work correctly. strcmp() argument must include '\' separator. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c3b5af63 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add UEFI Secure Boot Key enrollment interface This commit adds the menu-driven UEFI Secure Boot Key enrollment interface. User can enroll PK, KEK, db and dbx by selecting file. Only the signed EFI Signature List(s) with an authenticated header, typically '.auth' file, is accepted. To clear the PK, KEK, db and dbx, user needs to enroll the null key signed by PK or KEK. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
21faf4ef |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use protocol interface for file selection EFI_SIMPLE_FILE_SYSTEM_PROTOCOL is not always provided by U-Boot. Use protocol interface functions instead of U-Boot internal functions. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d6566113 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose eficonfig_create_device_path() Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use eficonfig_create_device_path() to construct the full device path from device path of the volume and file path, so move it out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d571f9b2 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation All the eficonfig menus other than "Change Boot Order" use 'eficonfig_entry' structure for each menu entry. This commit refactors change boot order implementation to use 'eficonfig_entry' structure same as other menus to have consistent menu handling. This commit also simplifies the data->active handling when KEY_SPACE is pressed, and sizeof() parameter. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
8961e93e |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose append entry function Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use append_entry() and append_quit_entry() to construct the menu, so move them out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
a84040ab |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor file selection handling eficonfig_select_file_handler() is commonly used to select the file. eficonfig_display_select_file_option() adds an additional menu to clear the selected file. eficonfig_display_select_file_option() is not always necessary for the file selection process, so it must be outside of eficonfig_select_file_handler(). This commit also renames the following functions to avoid confusion. eficonfig_select_file_handler() -> eficonfig_process_select_file() eficonfig_select_file() -> eficonfig_show_file_selection() eficonfig_display_select_file_option() -> eficonfig_process_show_file_option() Finally, test_eficonfig.py need to be updated to get aligned with the above modification. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
1167e88a |
|
14-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix missing variable initialization The 'ret' variable must be initialized before use in eficonfig_delete_invalid_boot_option(). Fixes: c416f1c0bc ("bootmenu: add removable media entries") Addresses-Coverity: 376207 ("Uninitialized variables") Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
3d595ac5 |
|
09-Nov-2022 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: remove superfluous if in eficonfig_edit_boot_option Goto for an immediately succeeding label is superfluous. Fixes: 87d791423ac6 ("eficonfig: menu-driven addition of UEFI boot option") Addresses-Coverity: 376202 ("Identical code for different branches") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
9945bc4f |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Fix incorrect return code of boot option update Correct the return code for out-of-memory and no boot option found Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
339b527b |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Move bootorder and bootoption apis to lib Rename and move bootorder and bootoption apis from cmd to lib for re-use between eficonfig and bootmgr Fix 'unexpected indentation' when 'make htmldocs' after functions are moved Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
2c0b0c31 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_SECURE_BOOT This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_SECURE_BOOT defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
83f3d121 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_MM_COMM_TEE This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_MM_COMM_TEE defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
88df3634 |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: CTRL+S to save the boot order 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>
|
#
45f5319f |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
menu: remove CTRL+C to quit On the sandbox called without "--terminal raw" CTRL+C leaves U-Boot, "ESC/CTRL+C to quit" is misleading. Let's remove CTRL+C to quit key handling from bootmenu and eficonfig menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
|
#
8dbd0a0f |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add vertical scroll support The current eficonfig menu does not support vertical scroll, so it can not display the menu entries greater than the console row size. This commit add the vertial scroll support. The console size is retrieved by SIMPLE_TEXT_OUTPUT_PROTOCOL.QueryMode() service, then calculates the row size for menu entry by subtracting menu header and description row size from the console row size. "start" and "end" are added in the efimenu structure. "start" keeps the menu entry index at the top, "end" keeps the bottom menu entry index. item_data_print() menu function only draws the menu entry between "start" and "end". This commit also fixes the issue that "Save" and "Quit" entries can be moved by BKEY_PLUS in change boot order menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
0d590852 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation This commit removes the change boot order specific menu implementation. The change boot order implementation calls eficonfig_process_common() same as other menus. The change boot order menu requires own item_data_print and item_choice implementation, but display_statusline function can be a same function as other menus. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
cd160b27 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor eficonfig_process_common function Current change boot order implementation does not call eficonfig_process_common() and call own menu functions for display_statusline, item_data_print and item_choice. Change boot order functionality should call eficonfig_process_common() to improve maintenanceability. This commit is a preparation to remove the change boot order specific implementation. The menu functions (display_statusline, item_data_print and item_choice) are added as argument of eficonfig_process_common(). The menu description string displayed at the bottom of the menu is also added as argument. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
32bab0ea |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Make use of CLI character processing Avoid duplicating some of the escape-sequence processing here and use the CLI function instead. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
d0ca98db |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Update bootmenu_loop() to return the code Use the return value to save having to pass around a pointer. This also resolves any ambiguity about what *key contains when the function is called. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
2da4a15e |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Rename KEY_... to BKEY_... This enum values conflict with linux/input.h so rename them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
64550274 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: avoid SetVariable between GetNextVariableName calls The current code calls efi_set_variable_int() to delete the invalid boot option between calls to efi_get_next_variable_name_int(), it may produce unpredictable results. This commit moves removal of the invalid boot option outside of the efi_get_next_variable_name_int() calls. EFI_NOT_FOUND returned from efi_get_next_variable_name_int() indicates we retrieved all EFI variables, it should be treated as EFI_SUCEESS. To address the checkpatch warning of too many leading tabs, combine two if statement into one. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
ce327084 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: carve out efi_get_next_variable_name_int calls To retrieve the EFI variable name by efi_get_next_variable_name_int(), the sequence of alloc -> efi_get_next_variable_name_int -> realloc -> efi_get_next_variable_name_int is required. In current code, this sequence repeatedly appears in the several functions. It should be curved out a common function. This commit also fixes the missing free() of var_name16 in eficonfig_delete_invalid_boot_option(). Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
140a8959 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use efi_get_next_variable_name_int() eficonfig command reads all possible UEFI load options from 0x0000 to 0xFFFF to construct the menu. This takes too much time in some environment. This commit uses efi_get_next_variable_name_int() to read all existing UEFI load options to significantlly reduce the count of efi_get_var() call. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
78b1ccc4 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use u16_strsize() to get u16 string buffer size Use u16_strsize() to simplify the u16 string buffer size calculation. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c67d3c9e |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix going one directory up issue The directory name in eficonfig menu entry contains the '\' separator. strcmp() argument ".." is wrong and one directory up handling does not work correctly. strcmp() argument must include '\' separator. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c3b5af63 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add UEFI Secure Boot Key enrollment interface This commit adds the menu-driven UEFI Secure Boot Key enrollment interface. User can enroll PK, KEK, db and dbx by selecting file. Only the signed EFI Signature List(s) with an authenticated header, typically '.auth' file, is accepted. To clear the PK, KEK, db and dbx, user needs to enroll the null key signed by PK or KEK. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
21faf4ef |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use protocol interface for file selection EFI_SIMPLE_FILE_SYSTEM_PROTOCOL is not always provided by U-Boot. Use protocol interface functions instead of U-Boot internal functions. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d6566113 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose eficonfig_create_device_path() Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use eficonfig_create_device_path() to construct the full device path from device path of the volume and file path, so move it out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d571f9b2 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation All the eficonfig menus other than "Change Boot Order" use 'eficonfig_entry' structure for each menu entry. This commit refactors change boot order implementation to use 'eficonfig_entry' structure same as other menus to have consistent menu handling. This commit also simplifies the data->active handling when KEY_SPACE is pressed, and sizeof() parameter. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
8961e93e |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose append entry function Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use append_entry() and append_quit_entry() to construct the menu, so move them out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
a84040ab |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor file selection handling eficonfig_select_file_handler() is commonly used to select the file. eficonfig_display_select_file_option() adds an additional menu to clear the selected file. eficonfig_display_select_file_option() is not always necessary for the file selection process, so it must be outside of eficonfig_select_file_handler(). This commit also renames the following functions to avoid confusion. eficonfig_select_file_handler() -> eficonfig_process_select_file() eficonfig_select_file() -> eficonfig_show_file_selection() eficonfig_display_select_file_option() -> eficonfig_process_show_file_option() Finally, test_eficonfig.py need to be updated to get aligned with the above modification. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
1167e88a |
|
14-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix missing variable initialization The 'ret' variable must be initialized before use in eficonfig_delete_invalid_boot_option(). Fixes: c416f1c0bc ("bootmenu: add removable media entries") Addresses-Coverity: 376207 ("Uninitialized variables") Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
3d595ac5 |
|
09-Nov-2022 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: remove superfluous if in eficonfig_edit_boot_option Goto for an immediately succeeding label is superfluous. Fixes: 87d791423ac6 ("eficonfig: menu-driven addition of UEFI boot option") Addresses-Coverity: 376202 ("Identical code for different branches") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
9945bc4f |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Fix incorrect return code of boot option update Correct the return code for out-of-memory and no boot option found Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
339b527b |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Move bootorder and bootoption apis to lib Rename and move bootorder and bootoption apis from cmd to lib for re-use between eficonfig and bootmgr Fix 'unexpected indentation' when 'make htmldocs' after functions are moved Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
2c0b0c31 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_SECURE_BOOT This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_SECURE_BOOT defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
83f3d121 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_MM_COMM_TEE This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_MM_COMM_TEE defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
88df3634 |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: CTRL+S to save the boot order 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>
|
#
45f5319f |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
menu: remove CTRL+C to quit On the sandbox called without "--terminal raw" CTRL+C leaves U-Boot, "ESC/CTRL+C to quit" is misleading. Let's remove CTRL+C to quit key handling from bootmenu and eficonfig menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
|
#
8dbd0a0f |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add vertical scroll support The current eficonfig menu does not support vertical scroll, so it can not display the menu entries greater than the console row size. This commit add the vertial scroll support. The console size is retrieved by SIMPLE_TEXT_OUTPUT_PROTOCOL.QueryMode() service, then calculates the row size for menu entry by subtracting menu header and description row size from the console row size. "start" and "end" are added in the efimenu structure. "start" keeps the menu entry index at the top, "end" keeps the bottom menu entry index. item_data_print() menu function only draws the menu entry between "start" and "end". This commit also fixes the issue that "Save" and "Quit" entries can be moved by BKEY_PLUS in change boot order menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
0d590852 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation This commit removes the change boot order specific menu implementation. The change boot order implementation calls eficonfig_process_common() same as other menus. The change boot order menu requires own item_data_print and item_choice implementation, but display_statusline function can be a same function as other menus. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
cd160b27 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor eficonfig_process_common function Current change boot order implementation does not call eficonfig_process_common() and call own menu functions for display_statusline, item_data_print and item_choice. Change boot order functionality should call eficonfig_process_common() to improve maintenanceability. This commit is a preparation to remove the change boot order specific implementation. The menu functions (display_statusline, item_data_print and item_choice) are added as argument of eficonfig_process_common(). The menu description string displayed at the bottom of the menu is also added as argument. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
32bab0ea |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Make use of CLI character processing Avoid duplicating some of the escape-sequence processing here and use the CLI function instead. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
d0ca98db |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Update bootmenu_loop() to return the code Use the return value to save having to pass around a pointer. This also resolves any ambiguity about what *key contains when the function is called. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
2da4a15e |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Rename KEY_... to BKEY_... This enum values conflict with linux/input.h so rename them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
64550274 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: avoid SetVariable between GetNextVariableName calls The current code calls efi_set_variable_int() to delete the invalid boot option between calls to efi_get_next_variable_name_int(), it may produce unpredictable results. This commit moves removal of the invalid boot option outside of the efi_get_next_variable_name_int() calls. EFI_NOT_FOUND returned from efi_get_next_variable_name_int() indicates we retrieved all EFI variables, it should be treated as EFI_SUCEESS. To address the checkpatch warning of too many leading tabs, combine two if statement into one. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
ce327084 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: carve out efi_get_next_variable_name_int calls To retrieve the EFI variable name by efi_get_next_variable_name_int(), the sequence of alloc -> efi_get_next_variable_name_int -> realloc -> efi_get_next_variable_name_int is required. In current code, this sequence repeatedly appears in the several functions. It should be curved out a common function. This commit also fixes the missing free() of var_name16 in eficonfig_delete_invalid_boot_option(). Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
140a8959 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use efi_get_next_variable_name_int() eficonfig command reads all possible UEFI load options from 0x0000 to 0xFFFF to construct the menu. This takes too much time in some environment. This commit uses efi_get_next_variable_name_int() to read all existing UEFI load options to significantlly reduce the count of efi_get_var() call. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
78b1ccc4 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use u16_strsize() to get u16 string buffer size Use u16_strsize() to simplify the u16 string buffer size calculation. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c67d3c9e |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix going one directory up issue The directory name in eficonfig menu entry contains the '\' separator. strcmp() argument ".." is wrong and one directory up handling does not work correctly. strcmp() argument must include '\' separator. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c3b5af63 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add UEFI Secure Boot Key enrollment interface This commit adds the menu-driven UEFI Secure Boot Key enrollment interface. User can enroll PK, KEK, db and dbx by selecting file. Only the signed EFI Signature List(s) with an authenticated header, typically '.auth' file, is accepted. To clear the PK, KEK, db and dbx, user needs to enroll the null key signed by PK or KEK. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
21faf4ef |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use protocol interface for file selection EFI_SIMPLE_FILE_SYSTEM_PROTOCOL is not always provided by U-Boot. Use protocol interface functions instead of U-Boot internal functions. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d6566113 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose eficonfig_create_device_path() Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use eficonfig_create_device_path() to construct the full device path from device path of the volume and file path, so move it out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d571f9b2 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation All the eficonfig menus other than "Change Boot Order" use 'eficonfig_entry' structure for each menu entry. This commit refactors change boot order implementation to use 'eficonfig_entry' structure same as other menus to have consistent menu handling. This commit also simplifies the data->active handling when KEY_SPACE is pressed, and sizeof() parameter. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
8961e93e |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose append entry function Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use append_entry() and append_quit_entry() to construct the menu, so move them out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
a84040ab |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor file selection handling eficonfig_select_file_handler() is commonly used to select the file. eficonfig_display_select_file_option() adds an additional menu to clear the selected file. eficonfig_display_select_file_option() is not always necessary for the file selection process, so it must be outside of eficonfig_select_file_handler(). This commit also renames the following functions to avoid confusion. eficonfig_select_file_handler() -> eficonfig_process_select_file() eficonfig_select_file() -> eficonfig_show_file_selection() eficonfig_display_select_file_option() -> eficonfig_process_show_file_option() Finally, test_eficonfig.py need to be updated to get aligned with the above modification. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
1167e88a |
|
14-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix missing variable initialization The 'ret' variable must be initialized before use in eficonfig_delete_invalid_boot_option(). Fixes: c416f1c0bc ("bootmenu: add removable media entries") Addresses-Coverity: 376207 ("Uninitialized variables") Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
3d595ac5 |
|
09-Nov-2022 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: remove superfluous if in eficonfig_edit_boot_option Goto for an immediately succeeding label is superfluous. Fixes: 87d791423ac6 ("eficonfig: menu-driven addition of UEFI boot option") Addresses-Coverity: 376202 ("Identical code for different branches") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
9945bc4f |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Fix incorrect return code of boot option update Correct the return code for out-of-memory and no boot option found Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
339b527b |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Move bootorder and bootoption apis to lib Rename and move bootorder and bootoption apis from cmd to lib for re-use between eficonfig and bootmgr Fix 'unexpected indentation' when 'make htmldocs' after functions are moved Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
2c0b0c31 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_SECURE_BOOT This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_SECURE_BOOT defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
83f3d121 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_MM_COMM_TEE This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_MM_COMM_TEE defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
88df3634 |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: CTRL+S to save the boot order 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>
|
#
45f5319f |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
menu: remove CTRL+C to quit On the sandbox called without "--terminal raw" CTRL+C leaves U-Boot, "ESC/CTRL+C to quit" is misleading. Let's remove CTRL+C to quit key handling from bootmenu and eficonfig menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
|
#
8dbd0a0f |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add vertical scroll support The current eficonfig menu does not support vertical scroll, so it can not display the menu entries greater than the console row size. This commit add the vertial scroll support. The console size is retrieved by SIMPLE_TEXT_OUTPUT_PROTOCOL.QueryMode() service, then calculates the row size for menu entry by subtracting menu header and description row size from the console row size. "start" and "end" are added in the efimenu structure. "start" keeps the menu entry index at the top, "end" keeps the bottom menu entry index. item_data_print() menu function only draws the menu entry between "start" and "end". This commit also fixes the issue that "Save" and "Quit" entries can be moved by BKEY_PLUS in change boot order menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
0d590852 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation This commit removes the change boot order specific menu implementation. The change boot order implementation calls eficonfig_process_common() same as other menus. The change boot order menu requires own item_data_print and item_choice implementation, but display_statusline function can be a same function as other menus. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
cd160b27 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor eficonfig_process_common function Current change boot order implementation does not call eficonfig_process_common() and call own menu functions for display_statusline, item_data_print and item_choice. Change boot order functionality should call eficonfig_process_common() to improve maintenanceability. This commit is a preparation to remove the change boot order specific implementation. The menu functions (display_statusline, item_data_print and item_choice) are added as argument of eficonfig_process_common(). The menu description string displayed at the bottom of the menu is also added as argument. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
32bab0ea |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Make use of CLI character processing Avoid duplicating some of the escape-sequence processing here and use the CLI function instead. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
d0ca98db |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Update bootmenu_loop() to return the code Use the return value to save having to pass around a pointer. This also resolves any ambiguity about what *key contains when the function is called. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
2da4a15e |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Rename KEY_... to BKEY_... This enum values conflict with linux/input.h so rename them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
64550274 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: avoid SetVariable between GetNextVariableName calls The current code calls efi_set_variable_int() to delete the invalid boot option between calls to efi_get_next_variable_name_int(), it may produce unpredictable results. This commit moves removal of the invalid boot option outside of the efi_get_next_variable_name_int() calls. EFI_NOT_FOUND returned from efi_get_next_variable_name_int() indicates we retrieved all EFI variables, it should be treated as EFI_SUCEESS. To address the checkpatch warning of too many leading tabs, combine two if statement into one. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
ce327084 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: carve out efi_get_next_variable_name_int calls To retrieve the EFI variable name by efi_get_next_variable_name_int(), the sequence of alloc -> efi_get_next_variable_name_int -> realloc -> efi_get_next_variable_name_int is required. In current code, this sequence repeatedly appears in the several functions. It should be curved out a common function. This commit also fixes the missing free() of var_name16 in eficonfig_delete_invalid_boot_option(). Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
140a8959 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use efi_get_next_variable_name_int() eficonfig command reads all possible UEFI load options from 0x0000 to 0xFFFF to construct the menu. This takes too much time in some environment. This commit uses efi_get_next_variable_name_int() to read all existing UEFI load options to significantlly reduce the count of efi_get_var() call. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
78b1ccc4 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use u16_strsize() to get u16 string buffer size Use u16_strsize() to simplify the u16 string buffer size calculation. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c67d3c9e |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix going one directory up issue The directory name in eficonfig menu entry contains the '\' separator. strcmp() argument ".." is wrong and one directory up handling does not work correctly. strcmp() argument must include '\' separator. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c3b5af63 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add UEFI Secure Boot Key enrollment interface This commit adds the menu-driven UEFI Secure Boot Key enrollment interface. User can enroll PK, KEK, db and dbx by selecting file. Only the signed EFI Signature List(s) with an authenticated header, typically '.auth' file, is accepted. To clear the PK, KEK, db and dbx, user needs to enroll the null key signed by PK or KEK. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
21faf4ef |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use protocol interface for file selection EFI_SIMPLE_FILE_SYSTEM_PROTOCOL is not always provided by U-Boot. Use protocol interface functions instead of U-Boot internal functions. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d6566113 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose eficonfig_create_device_path() Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use eficonfig_create_device_path() to construct the full device path from device path of the volume and file path, so move it out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d571f9b2 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation All the eficonfig menus other than "Change Boot Order" use 'eficonfig_entry' structure for each menu entry. This commit refactors change boot order implementation to use 'eficonfig_entry' structure same as other menus to have consistent menu handling. This commit also simplifies the data->active handling when KEY_SPACE is pressed, and sizeof() parameter. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
8961e93e |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose append entry function Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use append_entry() and append_quit_entry() to construct the menu, so move them out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
a84040ab |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor file selection handling eficonfig_select_file_handler() is commonly used to select the file. eficonfig_display_select_file_option() adds an additional menu to clear the selected file. eficonfig_display_select_file_option() is not always necessary for the file selection process, so it must be outside of eficonfig_select_file_handler(). This commit also renames the following functions to avoid confusion. eficonfig_select_file_handler() -> eficonfig_process_select_file() eficonfig_select_file() -> eficonfig_show_file_selection() eficonfig_display_select_file_option() -> eficonfig_process_show_file_option() Finally, test_eficonfig.py need to be updated to get aligned with the above modification. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
1167e88a |
|
14-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix missing variable initialization The 'ret' variable must be initialized before use in eficonfig_delete_invalid_boot_option(). Fixes: c416f1c0bc ("bootmenu: add removable media entries") Addresses-Coverity: 376207 ("Uninitialized variables") Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
3d595ac5 |
|
09-Nov-2022 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: remove superfluous if in eficonfig_edit_boot_option Goto for an immediately succeeding label is superfluous. Fixes: 87d791423ac6 ("eficonfig: menu-driven addition of UEFI boot option") Addresses-Coverity: 376202 ("Identical code for different branches") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
9945bc4f |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Fix incorrect return code of boot option update Correct the return code for out-of-memory and no boot option found Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
339b527b |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Move bootorder and bootoption apis to lib Rename and move bootorder and bootoption apis from cmd to lib for re-use between eficonfig and bootmgr Fix 'unexpected indentation' when 'make htmldocs' after functions are moved Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
2c0b0c31 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_SECURE_BOOT This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_SECURE_BOOT defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
83f3d121 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_MM_COMM_TEE This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_MM_COMM_TEE defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
88df3634 |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: CTRL+S to save the boot order 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>
|
#
45f5319f |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
menu: remove CTRL+C to quit On the sandbox called without "--terminal raw" CTRL+C leaves U-Boot, "ESC/CTRL+C to quit" is misleading. Let's remove CTRL+C to quit key handling from bootmenu and eficonfig menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
|
#
8dbd0a0f |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add vertical scroll support The current eficonfig menu does not support vertical scroll, so it can not display the menu entries greater than the console row size. This commit add the vertial scroll support. The console size is retrieved by SIMPLE_TEXT_OUTPUT_PROTOCOL.QueryMode() service, then calculates the row size for menu entry by subtracting menu header and description row size from the console row size. "start" and "end" are added in the efimenu structure. "start" keeps the menu entry index at the top, "end" keeps the bottom menu entry index. item_data_print() menu function only draws the menu entry between "start" and "end". This commit also fixes the issue that "Save" and "Quit" entries can be moved by BKEY_PLUS in change boot order menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
0d590852 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation This commit removes the change boot order specific menu implementation. The change boot order implementation calls eficonfig_process_common() same as other menus. The change boot order menu requires own item_data_print and item_choice implementation, but display_statusline function can be a same function as other menus. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
cd160b27 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor eficonfig_process_common function Current change boot order implementation does not call eficonfig_process_common() and call own menu functions for display_statusline, item_data_print and item_choice. Change boot order functionality should call eficonfig_process_common() to improve maintenanceability. This commit is a preparation to remove the change boot order specific implementation. The menu functions (display_statusline, item_data_print and item_choice) are added as argument of eficonfig_process_common(). The menu description string displayed at the bottom of the menu is also added as argument. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
32bab0ea |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Make use of CLI character processing Avoid duplicating some of the escape-sequence processing here and use the CLI function instead. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
d0ca98db |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Update bootmenu_loop() to return the code Use the return value to save having to pass around a pointer. This also resolves any ambiguity about what *key contains when the function is called. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
2da4a15e |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Rename KEY_... to BKEY_... This enum values conflict with linux/input.h so rename them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
64550274 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: avoid SetVariable between GetNextVariableName calls The current code calls efi_set_variable_int() to delete the invalid boot option between calls to efi_get_next_variable_name_int(), it may produce unpredictable results. This commit moves removal of the invalid boot option outside of the efi_get_next_variable_name_int() calls. EFI_NOT_FOUND returned from efi_get_next_variable_name_int() indicates we retrieved all EFI variables, it should be treated as EFI_SUCEESS. To address the checkpatch warning of too many leading tabs, combine two if statement into one. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
ce327084 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: carve out efi_get_next_variable_name_int calls To retrieve the EFI variable name by efi_get_next_variable_name_int(), the sequence of alloc -> efi_get_next_variable_name_int -> realloc -> efi_get_next_variable_name_int is required. In current code, this sequence repeatedly appears in the several functions. It should be curved out a common function. This commit also fixes the missing free() of var_name16 in eficonfig_delete_invalid_boot_option(). Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
140a8959 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use efi_get_next_variable_name_int() eficonfig command reads all possible UEFI load options from 0x0000 to 0xFFFF to construct the menu. This takes too much time in some environment. This commit uses efi_get_next_variable_name_int() to read all existing UEFI load options to significantlly reduce the count of efi_get_var() call. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
78b1ccc4 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use u16_strsize() to get u16 string buffer size Use u16_strsize() to simplify the u16 string buffer size calculation. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c67d3c9e |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix going one directory up issue The directory name in eficonfig menu entry contains the '\' separator. strcmp() argument ".." is wrong and one directory up handling does not work correctly. strcmp() argument must include '\' separator. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c3b5af63 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add UEFI Secure Boot Key enrollment interface This commit adds the menu-driven UEFI Secure Boot Key enrollment interface. User can enroll PK, KEK, db and dbx by selecting file. Only the signed EFI Signature List(s) with an authenticated header, typically '.auth' file, is accepted. To clear the PK, KEK, db and dbx, user needs to enroll the null key signed by PK or KEK. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
21faf4ef |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use protocol interface for file selection EFI_SIMPLE_FILE_SYSTEM_PROTOCOL is not always provided by U-Boot. Use protocol interface functions instead of U-Boot internal functions. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d6566113 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose eficonfig_create_device_path() Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use eficonfig_create_device_path() to construct the full device path from device path of the volume and file path, so move it out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d571f9b2 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation All the eficonfig menus other than "Change Boot Order" use 'eficonfig_entry' structure for each menu entry. This commit refactors change boot order implementation to use 'eficonfig_entry' structure same as other menus to have consistent menu handling. This commit also simplifies the data->active handling when KEY_SPACE is pressed, and sizeof() parameter. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
8961e93e |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose append entry function Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use append_entry() and append_quit_entry() to construct the menu, so move them out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
a84040ab |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor file selection handling eficonfig_select_file_handler() is commonly used to select the file. eficonfig_display_select_file_option() adds an additional menu to clear the selected file. eficonfig_display_select_file_option() is not always necessary for the file selection process, so it must be outside of eficonfig_select_file_handler(). This commit also renames the following functions to avoid confusion. eficonfig_select_file_handler() -> eficonfig_process_select_file() eficonfig_select_file() -> eficonfig_show_file_selection() eficonfig_display_select_file_option() -> eficonfig_process_show_file_option() Finally, test_eficonfig.py need to be updated to get aligned with the above modification. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
1167e88a |
|
14-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix missing variable initialization The 'ret' variable must be initialized before use in eficonfig_delete_invalid_boot_option(). Fixes: c416f1c0bc ("bootmenu: add removable media entries") Addresses-Coverity: 376207 ("Uninitialized variables") Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
3d595ac5 |
|
09-Nov-2022 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: remove superfluous if in eficonfig_edit_boot_option Goto for an immediately succeeding label is superfluous. Fixes: 87d791423ac6 ("eficonfig: menu-driven addition of UEFI boot option") Addresses-Coverity: 376202 ("Identical code for different branches") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
9945bc4f |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Fix incorrect return code of boot option update Correct the return code for out-of-memory and no boot option found Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
339b527b |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Move bootorder and bootoption apis to lib Rename and move bootorder and bootoption apis from cmd to lib for re-use between eficonfig and bootmgr Fix 'unexpected indentation' when 'make htmldocs' after functions are moved Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
2c0b0c31 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_SECURE_BOOT This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_SECURE_BOOT defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
83f3d121 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_MM_COMM_TEE This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_MM_COMM_TEE defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
88df3634 |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: CTRL+S to save the boot order 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>
|
#
45f5319f |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
menu: remove CTRL+C to quit On the sandbox called without "--terminal raw" CTRL+C leaves U-Boot, "ESC/CTRL+C to quit" is misleading. Let's remove CTRL+C to quit key handling from bootmenu and eficonfig menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
|
#
8dbd0a0f |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add vertical scroll support The current eficonfig menu does not support vertical scroll, so it can not display the menu entries greater than the console row size. This commit add the vertial scroll support. The console size is retrieved by SIMPLE_TEXT_OUTPUT_PROTOCOL.QueryMode() service, then calculates the row size for menu entry by subtracting menu header and description row size from the console row size. "start" and "end" are added in the efimenu structure. "start" keeps the menu entry index at the top, "end" keeps the bottom menu entry index. item_data_print() menu function only draws the menu entry between "start" and "end". This commit also fixes the issue that "Save" and "Quit" entries can be moved by BKEY_PLUS in change boot order menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
0d590852 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation This commit removes the change boot order specific menu implementation. The change boot order implementation calls eficonfig_process_common() same as other menus. The change boot order menu requires own item_data_print and item_choice implementation, but display_statusline function can be a same function as other menus. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
cd160b27 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor eficonfig_process_common function Current change boot order implementation does not call eficonfig_process_common() and call own menu functions for display_statusline, item_data_print and item_choice. Change boot order functionality should call eficonfig_process_common() to improve maintenanceability. This commit is a preparation to remove the change boot order specific implementation. The menu functions (display_statusline, item_data_print and item_choice) are added as argument of eficonfig_process_common(). The menu description string displayed at the bottom of the menu is also added as argument. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
32bab0ea |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Make use of CLI character processing Avoid duplicating some of the escape-sequence processing here and use the CLI function instead. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
d0ca98db |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Update bootmenu_loop() to return the code Use the return value to save having to pass around a pointer. This also resolves any ambiguity about what *key contains when the function is called. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
2da4a15e |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Rename KEY_... to BKEY_... This enum values conflict with linux/input.h so rename them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
64550274 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: avoid SetVariable between GetNextVariableName calls The current code calls efi_set_variable_int() to delete the invalid boot option between calls to efi_get_next_variable_name_int(), it may produce unpredictable results. This commit moves removal of the invalid boot option outside of the efi_get_next_variable_name_int() calls. EFI_NOT_FOUND returned from efi_get_next_variable_name_int() indicates we retrieved all EFI variables, it should be treated as EFI_SUCEESS. To address the checkpatch warning of too many leading tabs, combine two if statement into one. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
ce327084 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: carve out efi_get_next_variable_name_int calls To retrieve the EFI variable name by efi_get_next_variable_name_int(), the sequence of alloc -> efi_get_next_variable_name_int -> realloc -> efi_get_next_variable_name_int is required. In current code, this sequence repeatedly appears in the several functions. It should be curved out a common function. This commit also fixes the missing free() of var_name16 in eficonfig_delete_invalid_boot_option(). Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
140a8959 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use efi_get_next_variable_name_int() eficonfig command reads all possible UEFI load options from 0x0000 to 0xFFFF to construct the menu. This takes too much time in some environment. This commit uses efi_get_next_variable_name_int() to read all existing UEFI load options to significantlly reduce the count of efi_get_var() call. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
78b1ccc4 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use u16_strsize() to get u16 string buffer size Use u16_strsize() to simplify the u16 string buffer size calculation. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c67d3c9e |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix going one directory up issue The directory name in eficonfig menu entry contains the '\' separator. strcmp() argument ".." is wrong and one directory up handling does not work correctly. strcmp() argument must include '\' separator. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c3b5af63 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add UEFI Secure Boot Key enrollment interface This commit adds the menu-driven UEFI Secure Boot Key enrollment interface. User can enroll PK, KEK, db and dbx by selecting file. Only the signed EFI Signature List(s) with an authenticated header, typically '.auth' file, is accepted. To clear the PK, KEK, db and dbx, user needs to enroll the null key signed by PK or KEK. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
21faf4ef |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use protocol interface for file selection EFI_SIMPLE_FILE_SYSTEM_PROTOCOL is not always provided by U-Boot. Use protocol interface functions instead of U-Boot internal functions. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d6566113 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose eficonfig_create_device_path() Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use eficonfig_create_device_path() to construct the full device path from device path of the volume and file path, so move it out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d571f9b2 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation All the eficonfig menus other than "Change Boot Order" use 'eficonfig_entry' structure for each menu entry. This commit refactors change boot order implementation to use 'eficonfig_entry' structure same as other menus to have consistent menu handling. This commit also simplifies the data->active handling when KEY_SPACE is pressed, and sizeof() parameter. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
8961e93e |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose append entry function Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use append_entry() and append_quit_entry() to construct the menu, so move them out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
a84040ab |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor file selection handling eficonfig_select_file_handler() is commonly used to select the file. eficonfig_display_select_file_option() adds an additional menu to clear the selected file. eficonfig_display_select_file_option() is not always necessary for the file selection process, so it must be outside of eficonfig_select_file_handler(). This commit also renames the following functions to avoid confusion. eficonfig_select_file_handler() -> eficonfig_process_select_file() eficonfig_select_file() -> eficonfig_show_file_selection() eficonfig_display_select_file_option() -> eficonfig_process_show_file_option() Finally, test_eficonfig.py need to be updated to get aligned with the above modification. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
1167e88a |
|
14-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix missing variable initialization The 'ret' variable must be initialized before use in eficonfig_delete_invalid_boot_option(). Fixes: c416f1c0bc ("bootmenu: add removable media entries") Addresses-Coverity: 376207 ("Uninitialized variables") Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
3d595ac5 |
|
09-Nov-2022 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: remove superfluous if in eficonfig_edit_boot_option Goto for an immediately succeeding label is superfluous. Fixes: 87d791423ac6 ("eficonfig: menu-driven addition of UEFI boot option") Addresses-Coverity: 376202 ("Identical code for different branches") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
9945bc4f |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Fix incorrect return code of boot option update Correct the return code for out-of-memory and no boot option found Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
339b527b |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Move bootorder and bootoption apis to lib Rename and move bootorder and bootoption apis from cmd to lib for re-use between eficonfig and bootmgr Fix 'unexpected indentation' when 'make htmldocs' after functions are moved Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
2c0b0c31 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_SECURE_BOOT This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_SECURE_BOOT defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
83f3d121 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_MM_COMM_TEE This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_MM_COMM_TEE defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
88df3634 |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: CTRL+S to save the boot order 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>
|
#
45f5319f |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
menu: remove CTRL+C to quit On the sandbox called without "--terminal raw" CTRL+C leaves U-Boot, "ESC/CTRL+C to quit" is misleading. Let's remove CTRL+C to quit key handling from bootmenu and eficonfig menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
|
#
8dbd0a0f |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add vertical scroll support The current eficonfig menu does not support vertical scroll, so it can not display the menu entries greater than the console row size. This commit add the vertial scroll support. The console size is retrieved by SIMPLE_TEXT_OUTPUT_PROTOCOL.QueryMode() service, then calculates the row size for menu entry by subtracting menu header and description row size from the console row size. "start" and "end" are added in the efimenu structure. "start" keeps the menu entry index at the top, "end" keeps the bottom menu entry index. item_data_print() menu function only draws the menu entry between "start" and "end". This commit also fixes the issue that "Save" and "Quit" entries can be moved by BKEY_PLUS in change boot order menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
0d590852 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation This commit removes the change boot order specific menu implementation. The change boot order implementation calls eficonfig_process_common() same as other menus. The change boot order menu requires own item_data_print and item_choice implementation, but display_statusline function can be a same function as other menus. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
cd160b27 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor eficonfig_process_common function Current change boot order implementation does not call eficonfig_process_common() and call own menu functions for display_statusline, item_data_print and item_choice. Change boot order functionality should call eficonfig_process_common() to improve maintenanceability. This commit is a preparation to remove the change boot order specific implementation. The menu functions (display_statusline, item_data_print and item_choice) are added as argument of eficonfig_process_common(). The menu description string displayed at the bottom of the menu is also added as argument. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
32bab0ea |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Make use of CLI character processing Avoid duplicating some of the escape-sequence processing here and use the CLI function instead. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
d0ca98db |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Update bootmenu_loop() to return the code Use the return value to save having to pass around a pointer. This also resolves any ambiguity about what *key contains when the function is called. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
2da4a15e |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Rename KEY_... to BKEY_... This enum values conflict with linux/input.h so rename them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
64550274 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: avoid SetVariable between GetNextVariableName calls The current code calls efi_set_variable_int() to delete the invalid boot option between calls to efi_get_next_variable_name_int(), it may produce unpredictable results. This commit moves removal of the invalid boot option outside of the efi_get_next_variable_name_int() calls. EFI_NOT_FOUND returned from efi_get_next_variable_name_int() indicates we retrieved all EFI variables, it should be treated as EFI_SUCEESS. To address the checkpatch warning of too many leading tabs, combine two if statement into one. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
ce327084 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: carve out efi_get_next_variable_name_int calls To retrieve the EFI variable name by efi_get_next_variable_name_int(), the sequence of alloc -> efi_get_next_variable_name_int -> realloc -> efi_get_next_variable_name_int is required. In current code, this sequence repeatedly appears in the several functions. It should be curved out a common function. This commit also fixes the missing free() of var_name16 in eficonfig_delete_invalid_boot_option(). Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
140a8959 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use efi_get_next_variable_name_int() eficonfig command reads all possible UEFI load options from 0x0000 to 0xFFFF to construct the menu. This takes too much time in some environment. This commit uses efi_get_next_variable_name_int() to read all existing UEFI load options to significantlly reduce the count of efi_get_var() call. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
78b1ccc4 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use u16_strsize() to get u16 string buffer size Use u16_strsize() to simplify the u16 string buffer size calculation. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c67d3c9e |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix going one directory up issue The directory name in eficonfig menu entry contains the '\' separator. strcmp() argument ".." is wrong and one directory up handling does not work correctly. strcmp() argument must include '\' separator. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c3b5af63 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add UEFI Secure Boot Key enrollment interface This commit adds the menu-driven UEFI Secure Boot Key enrollment interface. User can enroll PK, KEK, db and dbx by selecting file. Only the signed EFI Signature List(s) with an authenticated header, typically '.auth' file, is accepted. To clear the PK, KEK, db and dbx, user needs to enroll the null key signed by PK or KEK. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
21faf4ef |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use protocol interface for file selection EFI_SIMPLE_FILE_SYSTEM_PROTOCOL is not always provided by U-Boot. Use protocol interface functions instead of U-Boot internal functions. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d6566113 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose eficonfig_create_device_path() Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use eficonfig_create_device_path() to construct the full device path from device path of the volume and file path, so move it out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d571f9b2 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation All the eficonfig menus other than "Change Boot Order" use 'eficonfig_entry' structure for each menu entry. This commit refactors change boot order implementation to use 'eficonfig_entry' structure same as other menus to have consistent menu handling. This commit also simplifies the data->active handling when KEY_SPACE is pressed, and sizeof() parameter. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
8961e93e |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose append entry function Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use append_entry() and append_quit_entry() to construct the menu, so move them out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
a84040ab |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor file selection handling eficonfig_select_file_handler() is commonly used to select the file. eficonfig_display_select_file_option() adds an additional menu to clear the selected file. eficonfig_display_select_file_option() is not always necessary for the file selection process, so it must be outside of eficonfig_select_file_handler(). This commit also renames the following functions to avoid confusion. eficonfig_select_file_handler() -> eficonfig_process_select_file() eficonfig_select_file() -> eficonfig_show_file_selection() eficonfig_display_select_file_option() -> eficonfig_process_show_file_option() Finally, test_eficonfig.py need to be updated to get aligned with the above modification. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
1167e88a |
|
14-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix missing variable initialization The 'ret' variable must be initialized before use in eficonfig_delete_invalid_boot_option(). Fixes: c416f1c0bc ("bootmenu: add removable media entries") Addresses-Coverity: 376207 ("Uninitialized variables") Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
3d595ac5 |
|
09-Nov-2022 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: remove superfluous if in eficonfig_edit_boot_option Goto for an immediately succeeding label is superfluous. Fixes: 87d791423ac6 ("eficonfig: menu-driven addition of UEFI boot option") Addresses-Coverity: 376202 ("Identical code for different branches") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
9945bc4f |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Fix incorrect return code of boot option update Correct the return code for out-of-memory and no boot option found Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
339b527b |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Move bootorder and bootoption apis to lib Rename and move bootorder and bootoption apis from cmd to lib for re-use between eficonfig and bootmgr Fix 'unexpected indentation' when 'make htmldocs' after functions are moved Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
2c0b0c31 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_SECURE_BOOT This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_SECURE_BOOT defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
83f3d121 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_MM_COMM_TEE This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_MM_COMM_TEE defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
88df3634 |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: CTRL+S to save the boot order 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>
|
#
45f5319f |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
menu: remove CTRL+C to quit On the sandbox called without "--terminal raw" CTRL+C leaves U-Boot, "ESC/CTRL+C to quit" is misleading. Let's remove CTRL+C to quit key handling from bootmenu and eficonfig menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
|
#
8dbd0a0f |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add vertical scroll support The current eficonfig menu does not support vertical scroll, so it can not display the menu entries greater than the console row size. This commit add the vertial scroll support. The console size is retrieved by SIMPLE_TEXT_OUTPUT_PROTOCOL.QueryMode() service, then calculates the row size for menu entry by subtracting menu header and description row size from the console row size. "start" and "end" are added in the efimenu structure. "start" keeps the menu entry index at the top, "end" keeps the bottom menu entry index. item_data_print() menu function only draws the menu entry between "start" and "end". This commit also fixes the issue that "Save" and "Quit" entries can be moved by BKEY_PLUS in change boot order menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
0d590852 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation This commit removes the change boot order specific menu implementation. The change boot order implementation calls eficonfig_process_common() same as other menus. The change boot order menu requires own item_data_print and item_choice implementation, but display_statusline function can be a same function as other menus. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
cd160b27 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor eficonfig_process_common function Current change boot order implementation does not call eficonfig_process_common() and call own menu functions for display_statusline, item_data_print and item_choice. Change boot order functionality should call eficonfig_process_common() to improve maintenanceability. This commit is a preparation to remove the change boot order specific implementation. The menu functions (display_statusline, item_data_print and item_choice) are added as argument of eficonfig_process_common(). The menu description string displayed at the bottom of the menu is also added as argument. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
32bab0ea |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Make use of CLI character processing Avoid duplicating some of the escape-sequence processing here and use the CLI function instead. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
d0ca98db |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Update bootmenu_loop() to return the code Use the return value to save having to pass around a pointer. This also resolves any ambiguity about what *key contains when the function is called. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
2da4a15e |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Rename KEY_... to BKEY_... This enum values conflict with linux/input.h so rename them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
64550274 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: avoid SetVariable between GetNextVariableName calls The current code calls efi_set_variable_int() to delete the invalid boot option between calls to efi_get_next_variable_name_int(), it may produce unpredictable results. This commit moves removal of the invalid boot option outside of the efi_get_next_variable_name_int() calls. EFI_NOT_FOUND returned from efi_get_next_variable_name_int() indicates we retrieved all EFI variables, it should be treated as EFI_SUCEESS. To address the checkpatch warning of too many leading tabs, combine two if statement into one. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
ce327084 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: carve out efi_get_next_variable_name_int calls To retrieve the EFI variable name by efi_get_next_variable_name_int(), the sequence of alloc -> efi_get_next_variable_name_int -> realloc -> efi_get_next_variable_name_int is required. In current code, this sequence repeatedly appears in the several functions. It should be curved out a common function. This commit also fixes the missing free() of var_name16 in eficonfig_delete_invalid_boot_option(). Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
140a8959 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use efi_get_next_variable_name_int() eficonfig command reads all possible UEFI load options from 0x0000 to 0xFFFF to construct the menu. This takes too much time in some environment. This commit uses efi_get_next_variable_name_int() to read all existing UEFI load options to significantlly reduce the count of efi_get_var() call. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
78b1ccc4 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use u16_strsize() to get u16 string buffer size Use u16_strsize() to simplify the u16 string buffer size calculation. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c67d3c9e |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix going one directory up issue The directory name in eficonfig menu entry contains the '\' separator. strcmp() argument ".." is wrong and one directory up handling does not work correctly. strcmp() argument must include '\' separator. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c3b5af63 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add UEFI Secure Boot Key enrollment interface This commit adds the menu-driven UEFI Secure Boot Key enrollment interface. User can enroll PK, KEK, db and dbx by selecting file. Only the signed EFI Signature List(s) with an authenticated header, typically '.auth' file, is accepted. To clear the PK, KEK, db and dbx, user needs to enroll the null key signed by PK or KEK. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
21faf4ef |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use protocol interface for file selection EFI_SIMPLE_FILE_SYSTEM_PROTOCOL is not always provided by U-Boot. Use protocol interface functions instead of U-Boot internal functions. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d6566113 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose eficonfig_create_device_path() Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use eficonfig_create_device_path() to construct the full device path from device path of the volume and file path, so move it out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d571f9b2 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation All the eficonfig menus other than "Change Boot Order" use 'eficonfig_entry' structure for each menu entry. This commit refactors change boot order implementation to use 'eficonfig_entry' structure same as other menus to have consistent menu handling. This commit also simplifies the data->active handling when KEY_SPACE is pressed, and sizeof() parameter. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
8961e93e |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose append entry function Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use append_entry() and append_quit_entry() to construct the menu, so move them out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
a84040ab |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor file selection handling eficonfig_select_file_handler() is commonly used to select the file. eficonfig_display_select_file_option() adds an additional menu to clear the selected file. eficonfig_display_select_file_option() is not always necessary for the file selection process, so it must be outside of eficonfig_select_file_handler(). This commit also renames the following functions to avoid confusion. eficonfig_select_file_handler() -> eficonfig_process_select_file() eficonfig_select_file() -> eficonfig_show_file_selection() eficonfig_display_select_file_option() -> eficonfig_process_show_file_option() Finally, test_eficonfig.py need to be updated to get aligned with the above modification. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
1167e88a |
|
14-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix missing variable initialization The 'ret' variable must be initialized before use in eficonfig_delete_invalid_boot_option(). Fixes: c416f1c0bc ("bootmenu: add removable media entries") Addresses-Coverity: 376207 ("Uninitialized variables") Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
3d595ac5 |
|
09-Nov-2022 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: remove superfluous if in eficonfig_edit_boot_option Goto for an immediately succeeding label is superfluous. Fixes: 87d791423ac6 ("eficonfig: menu-driven addition of UEFI boot option") Addresses-Coverity: 376202 ("Identical code for different branches") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
9945bc4f |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Fix incorrect return code of boot option update Correct the return code for out-of-memory and no boot option found Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
339b527b |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Move bootorder and bootoption apis to lib Rename and move bootorder and bootoption apis from cmd to lib for re-use between eficonfig and bootmgr Fix 'unexpected indentation' when 'make htmldocs' after functions are moved Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
2c0b0c31 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_SECURE_BOOT This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_SECURE_BOOT defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
83f3d121 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_MM_COMM_TEE This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_MM_COMM_TEE defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
88df3634 |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: CTRL+S to save the boot order 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>
|
#
45f5319f |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
menu: remove CTRL+C to quit On the sandbox called without "--terminal raw" CTRL+C leaves U-Boot, "ESC/CTRL+C to quit" is misleading. Let's remove CTRL+C to quit key handling from bootmenu and eficonfig menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
|
#
8dbd0a0f |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add vertical scroll support The current eficonfig menu does not support vertical scroll, so it can not display the menu entries greater than the console row size. This commit add the vertial scroll support. The console size is retrieved by SIMPLE_TEXT_OUTPUT_PROTOCOL.QueryMode() service, then calculates the row size for menu entry by subtracting menu header and description row size from the console row size. "start" and "end" are added in the efimenu structure. "start" keeps the menu entry index at the top, "end" keeps the bottom menu entry index. item_data_print() menu function only draws the menu entry between "start" and "end". This commit also fixes the issue that "Save" and "Quit" entries can be moved by BKEY_PLUS in change boot order menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
0d590852 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation This commit removes the change boot order specific menu implementation. The change boot order implementation calls eficonfig_process_common() same as other menus. The change boot order menu requires own item_data_print and item_choice implementation, but display_statusline function can be a same function as other menus. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
cd160b27 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor eficonfig_process_common function Current change boot order implementation does not call eficonfig_process_common() and call own menu functions for display_statusline, item_data_print and item_choice. Change boot order functionality should call eficonfig_process_common() to improve maintenanceability. This commit is a preparation to remove the change boot order specific implementation. The menu functions (display_statusline, item_data_print and item_choice) are added as argument of eficonfig_process_common(). The menu description string displayed at the bottom of the menu is also added as argument. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
32bab0ea |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Make use of CLI character processing Avoid duplicating some of the escape-sequence processing here and use the CLI function instead. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
d0ca98db |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Update bootmenu_loop() to return the code Use the return value to save having to pass around a pointer. This also resolves any ambiguity about what *key contains when the function is called. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
2da4a15e |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Rename KEY_... to BKEY_... This enum values conflict with linux/input.h so rename them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
64550274 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: avoid SetVariable between GetNextVariableName calls The current code calls efi_set_variable_int() to delete the invalid boot option between calls to efi_get_next_variable_name_int(), it may produce unpredictable results. This commit moves removal of the invalid boot option outside of the efi_get_next_variable_name_int() calls. EFI_NOT_FOUND returned from efi_get_next_variable_name_int() indicates we retrieved all EFI variables, it should be treated as EFI_SUCEESS. To address the checkpatch warning of too many leading tabs, combine two if statement into one. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
ce327084 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: carve out efi_get_next_variable_name_int calls To retrieve the EFI variable name by efi_get_next_variable_name_int(), the sequence of alloc -> efi_get_next_variable_name_int -> realloc -> efi_get_next_variable_name_int is required. In current code, this sequence repeatedly appears in the several functions. It should be curved out a common function. This commit also fixes the missing free() of var_name16 in eficonfig_delete_invalid_boot_option(). Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
140a8959 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use efi_get_next_variable_name_int() eficonfig command reads all possible UEFI load options from 0x0000 to 0xFFFF to construct the menu. This takes too much time in some environment. This commit uses efi_get_next_variable_name_int() to read all existing UEFI load options to significantlly reduce the count of efi_get_var() call. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
78b1ccc4 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use u16_strsize() to get u16 string buffer size Use u16_strsize() to simplify the u16 string buffer size calculation. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c67d3c9e |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix going one directory up issue The directory name in eficonfig menu entry contains the '\' separator. strcmp() argument ".." is wrong and one directory up handling does not work correctly. strcmp() argument must include '\' separator. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c3b5af63 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add UEFI Secure Boot Key enrollment interface This commit adds the menu-driven UEFI Secure Boot Key enrollment interface. User can enroll PK, KEK, db and dbx by selecting file. Only the signed EFI Signature List(s) with an authenticated header, typically '.auth' file, is accepted. To clear the PK, KEK, db and dbx, user needs to enroll the null key signed by PK or KEK. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
21faf4ef |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use protocol interface for file selection EFI_SIMPLE_FILE_SYSTEM_PROTOCOL is not always provided by U-Boot. Use protocol interface functions instead of U-Boot internal functions. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d6566113 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose eficonfig_create_device_path() Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use eficonfig_create_device_path() to construct the full device path from device path of the volume and file path, so move it out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d571f9b2 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation All the eficonfig menus other than "Change Boot Order" use 'eficonfig_entry' structure for each menu entry. This commit refactors change boot order implementation to use 'eficonfig_entry' structure same as other menus to have consistent menu handling. This commit also simplifies the data->active handling when KEY_SPACE is pressed, and sizeof() parameter. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
8961e93e |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose append entry function Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use append_entry() and append_quit_entry() to construct the menu, so move them out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
a84040ab |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor file selection handling eficonfig_select_file_handler() is commonly used to select the file. eficonfig_display_select_file_option() adds an additional menu to clear the selected file. eficonfig_display_select_file_option() is not always necessary for the file selection process, so it must be outside of eficonfig_select_file_handler(). This commit also renames the following functions to avoid confusion. eficonfig_select_file_handler() -> eficonfig_process_select_file() eficonfig_select_file() -> eficonfig_show_file_selection() eficonfig_display_select_file_option() -> eficonfig_process_show_file_option() Finally, test_eficonfig.py need to be updated to get aligned with the above modification. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
1167e88a |
|
14-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix missing variable initialization The 'ret' variable must be initialized before use in eficonfig_delete_invalid_boot_option(). Fixes: c416f1c0bc ("bootmenu: add removable media entries") Addresses-Coverity: 376207 ("Uninitialized variables") Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
3d595ac5 |
|
09-Nov-2022 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: remove superfluous if in eficonfig_edit_boot_option Goto for an immediately succeeding label is superfluous. Fixes: 87d791423ac6 ("eficonfig: menu-driven addition of UEFI boot option") Addresses-Coverity: 376202 ("Identical code for different branches") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
9945bc4f |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Fix incorrect return code of boot option update Correct the return code for out-of-memory and no boot option found Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
339b527b |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Move bootorder and bootoption apis to lib Rename and move bootorder and bootoption apis from cmd to lib for re-use between eficonfig and bootmgr Fix 'unexpected indentation' when 'make htmldocs' after functions are moved Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
2c0b0c31 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_SECURE_BOOT This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_SECURE_BOOT defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
83f3d121 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_MM_COMM_TEE This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_MM_COMM_TEE defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
88df3634 |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: CTRL+S to save the boot order 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>
|
#
45f5319f |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
menu: remove CTRL+C to quit On the sandbox called without "--terminal raw" CTRL+C leaves U-Boot, "ESC/CTRL+C to quit" is misleading. Let's remove CTRL+C to quit key handling from bootmenu and eficonfig menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
|
#
8dbd0a0f |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add vertical scroll support The current eficonfig menu does not support vertical scroll, so it can not display the menu entries greater than the console row size. This commit add the vertial scroll support. The console size is retrieved by SIMPLE_TEXT_OUTPUT_PROTOCOL.QueryMode() service, then calculates the row size for menu entry by subtracting menu header and description row size from the console row size. "start" and "end" are added in the efimenu structure. "start" keeps the menu entry index at the top, "end" keeps the bottom menu entry index. item_data_print() menu function only draws the menu entry between "start" and "end". This commit also fixes the issue that "Save" and "Quit" entries can be moved by BKEY_PLUS in change boot order menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
0d590852 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation This commit removes the change boot order specific menu implementation. The change boot order implementation calls eficonfig_process_common() same as other menus. The change boot order menu requires own item_data_print and item_choice implementation, but display_statusline function can be a same function as other menus. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
cd160b27 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor eficonfig_process_common function Current change boot order implementation does not call eficonfig_process_common() and call own menu functions for display_statusline, item_data_print and item_choice. Change boot order functionality should call eficonfig_process_common() to improve maintenanceability. This commit is a preparation to remove the change boot order specific implementation. The menu functions (display_statusline, item_data_print and item_choice) are added as argument of eficonfig_process_common(). The menu description string displayed at the bottom of the menu is also added as argument. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
32bab0ea |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Make use of CLI character processing Avoid duplicating some of the escape-sequence processing here and use the CLI function instead. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
d0ca98db |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Update bootmenu_loop() to return the code Use the return value to save having to pass around a pointer. This also resolves any ambiguity about what *key contains when the function is called. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
2da4a15e |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Rename KEY_... to BKEY_... This enum values conflict with linux/input.h so rename them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
64550274 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: avoid SetVariable between GetNextVariableName calls The current code calls efi_set_variable_int() to delete the invalid boot option between calls to efi_get_next_variable_name_int(), it may produce unpredictable results. This commit moves removal of the invalid boot option outside of the efi_get_next_variable_name_int() calls. EFI_NOT_FOUND returned from efi_get_next_variable_name_int() indicates we retrieved all EFI variables, it should be treated as EFI_SUCEESS. To address the checkpatch warning of too many leading tabs, combine two if statement into one. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
ce327084 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: carve out efi_get_next_variable_name_int calls To retrieve the EFI variable name by efi_get_next_variable_name_int(), the sequence of alloc -> efi_get_next_variable_name_int -> realloc -> efi_get_next_variable_name_int is required. In current code, this sequence repeatedly appears in the several functions. It should be curved out a common function. This commit also fixes the missing free() of var_name16 in eficonfig_delete_invalid_boot_option(). Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
140a8959 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use efi_get_next_variable_name_int() eficonfig command reads all possible UEFI load options from 0x0000 to 0xFFFF to construct the menu. This takes too much time in some environment. This commit uses efi_get_next_variable_name_int() to read all existing UEFI load options to significantlly reduce the count of efi_get_var() call. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
78b1ccc4 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use u16_strsize() to get u16 string buffer size Use u16_strsize() to simplify the u16 string buffer size calculation. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c67d3c9e |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix going one directory up issue The directory name in eficonfig menu entry contains the '\' separator. strcmp() argument ".." is wrong and one directory up handling does not work correctly. strcmp() argument must include '\' separator. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c3b5af63 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add UEFI Secure Boot Key enrollment interface This commit adds the menu-driven UEFI Secure Boot Key enrollment interface. User can enroll PK, KEK, db and dbx by selecting file. Only the signed EFI Signature List(s) with an authenticated header, typically '.auth' file, is accepted. To clear the PK, KEK, db and dbx, user needs to enroll the null key signed by PK or KEK. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
21faf4ef |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use protocol interface for file selection EFI_SIMPLE_FILE_SYSTEM_PROTOCOL is not always provided by U-Boot. Use protocol interface functions instead of U-Boot internal functions. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d6566113 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose eficonfig_create_device_path() Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use eficonfig_create_device_path() to construct the full device path from device path of the volume and file path, so move it out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d571f9b2 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation All the eficonfig menus other than "Change Boot Order" use 'eficonfig_entry' structure for each menu entry. This commit refactors change boot order implementation to use 'eficonfig_entry' structure same as other menus to have consistent menu handling. This commit also simplifies the data->active handling when KEY_SPACE is pressed, and sizeof() parameter. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
8961e93e |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose append entry function Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use append_entry() and append_quit_entry() to construct the menu, so move them out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
a84040ab |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor file selection handling eficonfig_select_file_handler() is commonly used to select the file. eficonfig_display_select_file_option() adds an additional menu to clear the selected file. eficonfig_display_select_file_option() is not always necessary for the file selection process, so it must be outside of eficonfig_select_file_handler(). This commit also renames the following functions to avoid confusion. eficonfig_select_file_handler() -> eficonfig_process_select_file() eficonfig_select_file() -> eficonfig_show_file_selection() eficonfig_display_select_file_option() -> eficonfig_process_show_file_option() Finally, test_eficonfig.py need to be updated to get aligned with the above modification. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
1167e88a |
|
14-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix missing variable initialization The 'ret' variable must be initialized before use in eficonfig_delete_invalid_boot_option(). Fixes: c416f1c0bc ("bootmenu: add removable media entries") Addresses-Coverity: 376207 ("Uninitialized variables") Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
3d595ac5 |
|
09-Nov-2022 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: remove superfluous if in eficonfig_edit_boot_option Goto for an immediately succeeding label is superfluous. Fixes: 87d791423ac6 ("eficonfig: menu-driven addition of UEFI boot option") Addresses-Coverity: 376202 ("Identical code for different branches") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
9945bc4f |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Fix incorrect return code of boot option update Correct the return code for out-of-memory and no boot option found Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
339b527b |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Move bootorder and bootoption apis to lib Rename and move bootorder and bootoption apis from cmd to lib for re-use between eficonfig and bootmgr Fix 'unexpected indentation' when 'make htmldocs' after functions are moved Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
2c0b0c31 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_SECURE_BOOT This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_SECURE_BOOT defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
83f3d121 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_MM_COMM_TEE This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_MM_COMM_TEE defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
88df3634 |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: CTRL+S to save the boot order 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>
|
#
45f5319f |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
menu: remove CTRL+C to quit On the sandbox called without "--terminal raw" CTRL+C leaves U-Boot, "ESC/CTRL+C to quit" is misleading. Let's remove CTRL+C to quit key handling from bootmenu and eficonfig menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
|
#
8dbd0a0f |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add vertical scroll support The current eficonfig menu does not support vertical scroll, so it can not display the menu entries greater than the console row size. This commit add the vertial scroll support. The console size is retrieved by SIMPLE_TEXT_OUTPUT_PROTOCOL.QueryMode() service, then calculates the row size for menu entry by subtracting menu header and description row size from the console row size. "start" and "end" are added in the efimenu structure. "start" keeps the menu entry index at the top, "end" keeps the bottom menu entry index. item_data_print() menu function only draws the menu entry between "start" and "end". This commit also fixes the issue that "Save" and "Quit" entries can be moved by BKEY_PLUS in change boot order menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
0d590852 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation This commit removes the change boot order specific menu implementation. The change boot order implementation calls eficonfig_process_common() same as other menus. The change boot order menu requires own item_data_print and item_choice implementation, but display_statusline function can be a same function as other menus. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
cd160b27 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor eficonfig_process_common function Current change boot order implementation does not call eficonfig_process_common() and call own menu functions for display_statusline, item_data_print and item_choice. Change boot order functionality should call eficonfig_process_common() to improve maintenanceability. This commit is a preparation to remove the change boot order specific implementation. The menu functions (display_statusline, item_data_print and item_choice) are added as argument of eficonfig_process_common(). The menu description string displayed at the bottom of the menu is also added as argument. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
32bab0ea |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Make use of CLI character processing Avoid duplicating some of the escape-sequence processing here and use the CLI function instead. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
d0ca98db |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Update bootmenu_loop() to return the code Use the return value to save having to pass around a pointer. This also resolves any ambiguity about what *key contains when the function is called. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
2da4a15e |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Rename KEY_... to BKEY_... This enum values conflict with linux/input.h so rename them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
64550274 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: avoid SetVariable between GetNextVariableName calls The current code calls efi_set_variable_int() to delete the invalid boot option between calls to efi_get_next_variable_name_int(), it may produce unpredictable results. This commit moves removal of the invalid boot option outside of the efi_get_next_variable_name_int() calls. EFI_NOT_FOUND returned from efi_get_next_variable_name_int() indicates we retrieved all EFI variables, it should be treated as EFI_SUCEESS. To address the checkpatch warning of too many leading tabs, combine two if statement into one. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
ce327084 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: carve out efi_get_next_variable_name_int calls To retrieve the EFI variable name by efi_get_next_variable_name_int(), the sequence of alloc -> efi_get_next_variable_name_int -> realloc -> efi_get_next_variable_name_int is required. In current code, this sequence repeatedly appears in the several functions. It should be curved out a common function. This commit also fixes the missing free() of var_name16 in eficonfig_delete_invalid_boot_option(). Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
140a8959 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use efi_get_next_variable_name_int() eficonfig command reads all possible UEFI load options from 0x0000 to 0xFFFF to construct the menu. This takes too much time in some environment. This commit uses efi_get_next_variable_name_int() to read all existing UEFI load options to significantlly reduce the count of efi_get_var() call. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
78b1ccc4 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use u16_strsize() to get u16 string buffer size Use u16_strsize() to simplify the u16 string buffer size calculation. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c67d3c9e |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix going one directory up issue The directory name in eficonfig menu entry contains the '\' separator. strcmp() argument ".." is wrong and one directory up handling does not work correctly. strcmp() argument must include '\' separator. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c3b5af63 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add UEFI Secure Boot Key enrollment interface This commit adds the menu-driven UEFI Secure Boot Key enrollment interface. User can enroll PK, KEK, db and dbx by selecting file. Only the signed EFI Signature List(s) with an authenticated header, typically '.auth' file, is accepted. To clear the PK, KEK, db and dbx, user needs to enroll the null key signed by PK or KEK. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
21faf4ef |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use protocol interface for file selection EFI_SIMPLE_FILE_SYSTEM_PROTOCOL is not always provided by U-Boot. Use protocol interface functions instead of U-Boot internal functions. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d6566113 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose eficonfig_create_device_path() Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use eficonfig_create_device_path() to construct the full device path from device path of the volume and file path, so move it out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d571f9b2 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation All the eficonfig menus other than "Change Boot Order" use 'eficonfig_entry' structure for each menu entry. This commit refactors change boot order implementation to use 'eficonfig_entry' structure same as other menus to have consistent menu handling. This commit also simplifies the data->active handling when KEY_SPACE is pressed, and sizeof() parameter. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
8961e93e |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose append entry function Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use append_entry() and append_quit_entry() to construct the menu, so move them out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
a84040ab |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor file selection handling eficonfig_select_file_handler() is commonly used to select the file. eficonfig_display_select_file_option() adds an additional menu to clear the selected file. eficonfig_display_select_file_option() is not always necessary for the file selection process, so it must be outside of eficonfig_select_file_handler(). This commit also renames the following functions to avoid confusion. eficonfig_select_file_handler() -> eficonfig_process_select_file() eficonfig_select_file() -> eficonfig_show_file_selection() eficonfig_display_select_file_option() -> eficonfig_process_show_file_option() Finally, test_eficonfig.py need to be updated to get aligned with the above modification. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
1167e88a |
|
14-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix missing variable initialization The 'ret' variable must be initialized before use in eficonfig_delete_invalid_boot_option(). Fixes: c416f1c0bc ("bootmenu: add removable media entries") Addresses-Coverity: 376207 ("Uninitialized variables") Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
3d595ac5 |
|
09-Nov-2022 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: remove superfluous if in eficonfig_edit_boot_option Goto for an immediately succeeding label is superfluous. Fixes: 87d791423ac6 ("eficonfig: menu-driven addition of UEFI boot option") Addresses-Coverity: 376202 ("Identical code for different branches") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
9945bc4f |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Fix incorrect return code of boot option update Correct the return code for out-of-memory and no boot option found Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
339b527b |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Move bootorder and bootoption apis to lib Rename and move bootorder and bootoption apis from cmd to lib for re-use between eficonfig and bootmgr Fix 'unexpected indentation' when 'make htmldocs' after functions are moved Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
2c0b0c31 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_SECURE_BOOT This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_SECURE_BOOT defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
83f3d121 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_MM_COMM_TEE This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_MM_COMM_TEE defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
88df3634 |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: CTRL+S to save the boot order 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>
|
#
45f5319f |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
menu: remove CTRL+C to quit On the sandbox called without "--terminal raw" CTRL+C leaves U-Boot, "ESC/CTRL+C to quit" is misleading. Let's remove CTRL+C to quit key handling from bootmenu and eficonfig menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
|
#
8dbd0a0f |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add vertical scroll support The current eficonfig menu does not support vertical scroll, so it can not display the menu entries greater than the console row size. This commit add the vertial scroll support. The console size is retrieved by SIMPLE_TEXT_OUTPUT_PROTOCOL.QueryMode() service, then calculates the row size for menu entry by subtracting menu header and description row size from the console row size. "start" and "end" are added in the efimenu structure. "start" keeps the menu entry index at the top, "end" keeps the bottom menu entry index. item_data_print() menu function only draws the menu entry between "start" and "end". This commit also fixes the issue that "Save" and "Quit" entries can be moved by BKEY_PLUS in change boot order menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
0d590852 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation This commit removes the change boot order specific menu implementation. The change boot order implementation calls eficonfig_process_common() same as other menus. The change boot order menu requires own item_data_print and item_choice implementation, but display_statusline function can be a same function as other menus. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
cd160b27 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor eficonfig_process_common function Current change boot order implementation does not call eficonfig_process_common() and call own menu functions for display_statusline, item_data_print and item_choice. Change boot order functionality should call eficonfig_process_common() to improve maintenanceability. This commit is a preparation to remove the change boot order specific implementation. The menu functions (display_statusline, item_data_print and item_choice) are added as argument of eficonfig_process_common(). The menu description string displayed at the bottom of the menu is also added as argument. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
32bab0ea |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Make use of CLI character processing Avoid duplicating some of the escape-sequence processing here and use the CLI function instead. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
d0ca98db |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Update bootmenu_loop() to return the code Use the return value to save having to pass around a pointer. This also resolves any ambiguity about what *key contains when the function is called. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
2da4a15e |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Rename KEY_... to BKEY_... This enum values conflict with linux/input.h so rename them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
64550274 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: avoid SetVariable between GetNextVariableName calls The current code calls efi_set_variable_int() to delete the invalid boot option between calls to efi_get_next_variable_name_int(), it may produce unpredictable results. This commit moves removal of the invalid boot option outside of the efi_get_next_variable_name_int() calls. EFI_NOT_FOUND returned from efi_get_next_variable_name_int() indicates we retrieved all EFI variables, it should be treated as EFI_SUCEESS. To address the checkpatch warning of too many leading tabs, combine two if statement into one. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
ce327084 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: carve out efi_get_next_variable_name_int calls To retrieve the EFI variable name by efi_get_next_variable_name_int(), the sequence of alloc -> efi_get_next_variable_name_int -> realloc -> efi_get_next_variable_name_int is required. In current code, this sequence repeatedly appears in the several functions. It should be curved out a common function. This commit also fixes the missing free() of var_name16 in eficonfig_delete_invalid_boot_option(). Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
140a8959 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use efi_get_next_variable_name_int() eficonfig command reads all possible UEFI load options from 0x0000 to 0xFFFF to construct the menu. This takes too much time in some environment. This commit uses efi_get_next_variable_name_int() to read all existing UEFI load options to significantlly reduce the count of efi_get_var() call. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
78b1ccc4 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use u16_strsize() to get u16 string buffer size Use u16_strsize() to simplify the u16 string buffer size calculation. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c67d3c9e |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix going one directory up issue The directory name in eficonfig menu entry contains the '\' separator. strcmp() argument ".." is wrong and one directory up handling does not work correctly. strcmp() argument must include '\' separator. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c3b5af63 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add UEFI Secure Boot Key enrollment interface This commit adds the menu-driven UEFI Secure Boot Key enrollment interface. User can enroll PK, KEK, db and dbx by selecting file. Only the signed EFI Signature List(s) with an authenticated header, typically '.auth' file, is accepted. To clear the PK, KEK, db and dbx, user needs to enroll the null key signed by PK or KEK. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
21faf4ef |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use protocol interface for file selection EFI_SIMPLE_FILE_SYSTEM_PROTOCOL is not always provided by U-Boot. Use protocol interface functions instead of U-Boot internal functions. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d6566113 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose eficonfig_create_device_path() Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use eficonfig_create_device_path() to construct the full device path from device path of the volume and file path, so move it out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d571f9b2 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation All the eficonfig menus other than "Change Boot Order" use 'eficonfig_entry' structure for each menu entry. This commit refactors change boot order implementation to use 'eficonfig_entry' structure same as other menus to have consistent menu handling. This commit also simplifies the data->active handling when KEY_SPACE is pressed, and sizeof() parameter. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
8961e93e |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose append entry function Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use append_entry() and append_quit_entry() to construct the menu, so move them out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
a84040ab |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor file selection handling eficonfig_select_file_handler() is commonly used to select the file. eficonfig_display_select_file_option() adds an additional menu to clear the selected file. eficonfig_display_select_file_option() is not always necessary for the file selection process, so it must be outside of eficonfig_select_file_handler(). This commit also renames the following functions to avoid confusion. eficonfig_select_file_handler() -> eficonfig_process_select_file() eficonfig_select_file() -> eficonfig_show_file_selection() eficonfig_display_select_file_option() -> eficonfig_process_show_file_option() Finally, test_eficonfig.py need to be updated to get aligned with the above modification. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
1167e88a |
|
14-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix missing variable initialization The 'ret' variable must be initialized before use in eficonfig_delete_invalid_boot_option(). Fixes: c416f1c0bc ("bootmenu: add removable media entries") Addresses-Coverity: 376207 ("Uninitialized variables") Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
3d595ac5 |
|
09-Nov-2022 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: remove superfluous if in eficonfig_edit_boot_option Goto for an immediately succeeding label is superfluous. Fixes: 87d791423ac6 ("eficonfig: menu-driven addition of UEFI boot option") Addresses-Coverity: 376202 ("Identical code for different branches") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
9945bc4f |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Fix incorrect return code of boot option update Correct the return code for out-of-memory and no boot option found Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
339b527b |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Move bootorder and bootoption apis to lib Rename and move bootorder and bootoption apis from cmd to lib for re-use between eficonfig and bootmgr Fix 'unexpected indentation' when 'make htmldocs' after functions are moved Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
2c0b0c31 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_SECURE_BOOT This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_SECURE_BOOT defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
83f3d121 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_MM_COMM_TEE This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_MM_COMM_TEE defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
88df3634 |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: CTRL+S to save the boot order 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>
|
#
45f5319f |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
menu: remove CTRL+C to quit On the sandbox called without "--terminal raw" CTRL+C leaves U-Boot, "ESC/CTRL+C to quit" is misleading. Let's remove CTRL+C to quit key handling from bootmenu and eficonfig menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
|
#
8dbd0a0f |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add vertical scroll support The current eficonfig menu does not support vertical scroll, so it can not display the menu entries greater than the console row size. This commit add the vertial scroll support. The console size is retrieved by SIMPLE_TEXT_OUTPUT_PROTOCOL.QueryMode() service, then calculates the row size for menu entry by subtracting menu header and description row size from the console row size. "start" and "end" are added in the efimenu structure. "start" keeps the menu entry index at the top, "end" keeps the bottom menu entry index. item_data_print() menu function only draws the menu entry between "start" and "end". This commit also fixes the issue that "Save" and "Quit" entries can be moved by BKEY_PLUS in change boot order menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
0d590852 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation This commit removes the change boot order specific menu implementation. The change boot order implementation calls eficonfig_process_common() same as other menus. The change boot order menu requires own item_data_print and item_choice implementation, but display_statusline function can be a same function as other menus. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
cd160b27 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor eficonfig_process_common function Current change boot order implementation does not call eficonfig_process_common() and call own menu functions for display_statusline, item_data_print and item_choice. Change boot order functionality should call eficonfig_process_common() to improve maintenanceability. This commit is a preparation to remove the change boot order specific implementation. The menu functions (display_statusline, item_data_print and item_choice) are added as argument of eficonfig_process_common(). The menu description string displayed at the bottom of the menu is also added as argument. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
32bab0ea |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Make use of CLI character processing Avoid duplicating some of the escape-sequence processing here and use the CLI function instead. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
d0ca98db |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Update bootmenu_loop() to return the code Use the return value to save having to pass around a pointer. This also resolves any ambiguity about what *key contains when the function is called. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
2da4a15e |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Rename KEY_... to BKEY_... This enum values conflict with linux/input.h so rename them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
64550274 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: avoid SetVariable between GetNextVariableName calls The current code calls efi_set_variable_int() to delete the invalid boot option between calls to efi_get_next_variable_name_int(), it may produce unpredictable results. This commit moves removal of the invalid boot option outside of the efi_get_next_variable_name_int() calls. EFI_NOT_FOUND returned from efi_get_next_variable_name_int() indicates we retrieved all EFI variables, it should be treated as EFI_SUCEESS. To address the checkpatch warning of too many leading tabs, combine two if statement into one. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
ce327084 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: carve out efi_get_next_variable_name_int calls To retrieve the EFI variable name by efi_get_next_variable_name_int(), the sequence of alloc -> efi_get_next_variable_name_int -> realloc -> efi_get_next_variable_name_int is required. In current code, this sequence repeatedly appears in the several functions. It should be curved out a common function. This commit also fixes the missing free() of var_name16 in eficonfig_delete_invalid_boot_option(). Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
140a8959 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use efi_get_next_variable_name_int() eficonfig command reads all possible UEFI load options from 0x0000 to 0xFFFF to construct the menu. This takes too much time in some environment. This commit uses efi_get_next_variable_name_int() to read all existing UEFI load options to significantlly reduce the count of efi_get_var() call. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
78b1ccc4 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use u16_strsize() to get u16 string buffer size Use u16_strsize() to simplify the u16 string buffer size calculation. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c67d3c9e |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix going one directory up issue The directory name in eficonfig menu entry contains the '\' separator. strcmp() argument ".." is wrong and one directory up handling does not work correctly. strcmp() argument must include '\' separator. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c3b5af63 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add UEFI Secure Boot Key enrollment interface This commit adds the menu-driven UEFI Secure Boot Key enrollment interface. User can enroll PK, KEK, db and dbx by selecting file. Only the signed EFI Signature List(s) with an authenticated header, typically '.auth' file, is accepted. To clear the PK, KEK, db and dbx, user needs to enroll the null key signed by PK or KEK. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
21faf4ef |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use protocol interface for file selection EFI_SIMPLE_FILE_SYSTEM_PROTOCOL is not always provided by U-Boot. Use protocol interface functions instead of U-Boot internal functions. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d6566113 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose eficonfig_create_device_path() Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use eficonfig_create_device_path() to construct the full device path from device path of the volume and file path, so move it out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d571f9b2 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation All the eficonfig menus other than "Change Boot Order" use 'eficonfig_entry' structure for each menu entry. This commit refactors change boot order implementation to use 'eficonfig_entry' structure same as other menus to have consistent menu handling. This commit also simplifies the data->active handling when KEY_SPACE is pressed, and sizeof() parameter. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
8961e93e |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose append entry function Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use append_entry() and append_quit_entry() to construct the menu, so move them out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
a84040ab |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor file selection handling eficonfig_select_file_handler() is commonly used to select the file. eficonfig_display_select_file_option() adds an additional menu to clear the selected file. eficonfig_display_select_file_option() is not always necessary for the file selection process, so it must be outside of eficonfig_select_file_handler(). This commit also renames the following functions to avoid confusion. eficonfig_select_file_handler() -> eficonfig_process_select_file() eficonfig_select_file() -> eficonfig_show_file_selection() eficonfig_display_select_file_option() -> eficonfig_process_show_file_option() Finally, test_eficonfig.py need to be updated to get aligned with the above modification. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
1167e88a |
|
14-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix missing variable initialization The 'ret' variable must be initialized before use in eficonfig_delete_invalid_boot_option(). Fixes: c416f1c0bc ("bootmenu: add removable media entries") Addresses-Coverity: 376207 ("Uninitialized variables") Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
3d595ac5 |
|
09-Nov-2022 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: remove superfluous if in eficonfig_edit_boot_option Goto for an immediately succeeding label is superfluous. Fixes: 87d791423ac6 ("eficonfig: menu-driven addition of UEFI boot option") Addresses-Coverity: 376202 ("Identical code for different branches") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
9945bc4f |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Fix incorrect return code of boot option update Correct the return code for out-of-memory and no boot option found Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
339b527b |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Move bootorder and bootoption apis to lib Rename and move bootorder and bootoption apis from cmd to lib for re-use between eficonfig and bootmgr Fix 'unexpected indentation' when 'make htmldocs' after functions are moved Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
2c0b0c31 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_SECURE_BOOT This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_SECURE_BOOT defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
83f3d121 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_MM_COMM_TEE This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_MM_COMM_TEE defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
88df3634 |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: CTRL+S to save the boot order 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>
|
#
45f5319f |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
menu: remove CTRL+C to quit On the sandbox called without "--terminal raw" CTRL+C leaves U-Boot, "ESC/CTRL+C to quit" is misleading. Let's remove CTRL+C to quit key handling from bootmenu and eficonfig menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
|
#
8dbd0a0f |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add vertical scroll support The current eficonfig menu does not support vertical scroll, so it can not display the menu entries greater than the console row size. This commit add the vertial scroll support. The console size is retrieved by SIMPLE_TEXT_OUTPUT_PROTOCOL.QueryMode() service, then calculates the row size for menu entry by subtracting menu header and description row size from the console row size. "start" and "end" are added in the efimenu structure. "start" keeps the menu entry index at the top, "end" keeps the bottom menu entry index. item_data_print() menu function only draws the menu entry between "start" and "end". This commit also fixes the issue that "Save" and "Quit" entries can be moved by BKEY_PLUS in change boot order menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
0d590852 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation This commit removes the change boot order specific menu implementation. The change boot order implementation calls eficonfig_process_common() same as other menus. The change boot order menu requires own item_data_print and item_choice implementation, but display_statusline function can be a same function as other menus. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
cd160b27 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor eficonfig_process_common function Current change boot order implementation does not call eficonfig_process_common() and call own menu functions for display_statusline, item_data_print and item_choice. Change boot order functionality should call eficonfig_process_common() to improve maintenanceability. This commit is a preparation to remove the change boot order specific implementation. The menu functions (display_statusline, item_data_print and item_choice) are added as argument of eficonfig_process_common(). The menu description string displayed at the bottom of the menu is also added as argument. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
32bab0ea |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Make use of CLI character processing Avoid duplicating some of the escape-sequence processing here and use the CLI function instead. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
d0ca98db |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Update bootmenu_loop() to return the code Use the return value to save having to pass around a pointer. This also resolves any ambiguity about what *key contains when the function is called. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
2da4a15e |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Rename KEY_... to BKEY_... This enum values conflict with linux/input.h so rename them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
64550274 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: avoid SetVariable between GetNextVariableName calls The current code calls efi_set_variable_int() to delete the invalid boot option between calls to efi_get_next_variable_name_int(), it may produce unpredictable results. This commit moves removal of the invalid boot option outside of the efi_get_next_variable_name_int() calls. EFI_NOT_FOUND returned from efi_get_next_variable_name_int() indicates we retrieved all EFI variables, it should be treated as EFI_SUCEESS. To address the checkpatch warning of too many leading tabs, combine two if statement into one. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
ce327084 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: carve out efi_get_next_variable_name_int calls To retrieve the EFI variable name by efi_get_next_variable_name_int(), the sequence of alloc -> efi_get_next_variable_name_int -> realloc -> efi_get_next_variable_name_int is required. In current code, this sequence repeatedly appears in the several functions. It should be curved out a common function. This commit also fixes the missing free() of var_name16 in eficonfig_delete_invalid_boot_option(). Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
140a8959 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use efi_get_next_variable_name_int() eficonfig command reads all possible UEFI load options from 0x0000 to 0xFFFF to construct the menu. This takes too much time in some environment. This commit uses efi_get_next_variable_name_int() to read all existing UEFI load options to significantlly reduce the count of efi_get_var() call. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
78b1ccc4 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use u16_strsize() to get u16 string buffer size Use u16_strsize() to simplify the u16 string buffer size calculation. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c67d3c9e |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix going one directory up issue The directory name in eficonfig menu entry contains the '\' separator. strcmp() argument ".." is wrong and one directory up handling does not work correctly. strcmp() argument must include '\' separator. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c3b5af63 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add UEFI Secure Boot Key enrollment interface This commit adds the menu-driven UEFI Secure Boot Key enrollment interface. User can enroll PK, KEK, db and dbx by selecting file. Only the signed EFI Signature List(s) with an authenticated header, typically '.auth' file, is accepted. To clear the PK, KEK, db and dbx, user needs to enroll the null key signed by PK or KEK. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
21faf4ef |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use protocol interface for file selection EFI_SIMPLE_FILE_SYSTEM_PROTOCOL is not always provided by U-Boot. Use protocol interface functions instead of U-Boot internal functions. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d6566113 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose eficonfig_create_device_path() Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use eficonfig_create_device_path() to construct the full device path from device path of the volume and file path, so move it out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d571f9b2 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation All the eficonfig menus other than "Change Boot Order" use 'eficonfig_entry' structure for each menu entry. This commit refactors change boot order implementation to use 'eficonfig_entry' structure same as other menus to have consistent menu handling. This commit also simplifies the data->active handling when KEY_SPACE is pressed, and sizeof() parameter. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
8961e93e |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose append entry function Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use append_entry() and append_quit_entry() to construct the menu, so move them out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
a84040ab |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor file selection handling eficonfig_select_file_handler() is commonly used to select the file. eficonfig_display_select_file_option() adds an additional menu to clear the selected file. eficonfig_display_select_file_option() is not always necessary for the file selection process, so it must be outside of eficonfig_select_file_handler(). This commit also renames the following functions to avoid confusion. eficonfig_select_file_handler() -> eficonfig_process_select_file() eficonfig_select_file() -> eficonfig_show_file_selection() eficonfig_display_select_file_option() -> eficonfig_process_show_file_option() Finally, test_eficonfig.py need to be updated to get aligned with the above modification. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
1167e88a |
|
14-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix missing variable initialization The 'ret' variable must be initialized before use in eficonfig_delete_invalid_boot_option(). Fixes: c416f1c0bc ("bootmenu: add removable media entries") Addresses-Coverity: 376207 ("Uninitialized variables") Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
3d595ac5 |
|
09-Nov-2022 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: remove superfluous if in eficonfig_edit_boot_option Goto for an immediately succeeding label is superfluous. Fixes: 87d791423ac6 ("eficonfig: menu-driven addition of UEFI boot option") Addresses-Coverity: 376202 ("Identical code for different branches") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
9945bc4f |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Fix incorrect return code of boot option update Correct the return code for out-of-memory and no boot option found Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
339b527b |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Move bootorder and bootoption apis to lib Rename and move bootorder and bootoption apis from cmd to lib for re-use between eficonfig and bootmgr Fix 'unexpected indentation' when 'make htmldocs' after functions are moved Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
2c0b0c31 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_SECURE_BOOT This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_SECURE_BOOT defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
83f3d121 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_MM_COMM_TEE This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_MM_COMM_TEE defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
88df3634 |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: CTRL+S to save the boot order 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>
|
#
45f5319f |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
menu: remove CTRL+C to quit On the sandbox called without "--terminal raw" CTRL+C leaves U-Boot, "ESC/CTRL+C to quit" is misleading. Let's remove CTRL+C to quit key handling from bootmenu and eficonfig menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
|
#
8dbd0a0f |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add vertical scroll support The current eficonfig menu does not support vertical scroll, so it can not display the menu entries greater than the console row size. This commit add the vertial scroll support. The console size is retrieved by SIMPLE_TEXT_OUTPUT_PROTOCOL.QueryMode() service, then calculates the row size for menu entry by subtracting menu header and description row size from the console row size. "start" and "end" are added in the efimenu structure. "start" keeps the menu entry index at the top, "end" keeps the bottom menu entry index. item_data_print() menu function only draws the menu entry between "start" and "end". This commit also fixes the issue that "Save" and "Quit" entries can be moved by BKEY_PLUS in change boot order menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
0d590852 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation This commit removes the change boot order specific menu implementation. The change boot order implementation calls eficonfig_process_common() same as other menus. The change boot order menu requires own item_data_print and item_choice implementation, but display_statusline function can be a same function as other menus. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
cd160b27 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor eficonfig_process_common function Current change boot order implementation does not call eficonfig_process_common() and call own menu functions for display_statusline, item_data_print and item_choice. Change boot order functionality should call eficonfig_process_common() to improve maintenanceability. This commit is a preparation to remove the change boot order specific implementation. The menu functions (display_statusline, item_data_print and item_choice) are added as argument of eficonfig_process_common(). The menu description string displayed at the bottom of the menu is also added as argument. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
32bab0ea |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Make use of CLI character processing Avoid duplicating some of the escape-sequence processing here and use the CLI function instead. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
d0ca98db |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Update bootmenu_loop() to return the code Use the return value to save having to pass around a pointer. This also resolves any ambiguity about what *key contains when the function is called. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
2da4a15e |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Rename KEY_... to BKEY_... This enum values conflict with linux/input.h so rename them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
64550274 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: avoid SetVariable between GetNextVariableName calls The current code calls efi_set_variable_int() to delete the invalid boot option between calls to efi_get_next_variable_name_int(), it may produce unpredictable results. This commit moves removal of the invalid boot option outside of the efi_get_next_variable_name_int() calls. EFI_NOT_FOUND returned from efi_get_next_variable_name_int() indicates we retrieved all EFI variables, it should be treated as EFI_SUCEESS. To address the checkpatch warning of too many leading tabs, combine two if statement into one. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
ce327084 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: carve out efi_get_next_variable_name_int calls To retrieve the EFI variable name by efi_get_next_variable_name_int(), the sequence of alloc -> efi_get_next_variable_name_int -> realloc -> efi_get_next_variable_name_int is required. In current code, this sequence repeatedly appears in the several functions. It should be curved out a common function. This commit also fixes the missing free() of var_name16 in eficonfig_delete_invalid_boot_option(). Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
140a8959 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use efi_get_next_variable_name_int() eficonfig command reads all possible UEFI load options from 0x0000 to 0xFFFF to construct the menu. This takes too much time in some environment. This commit uses efi_get_next_variable_name_int() to read all existing UEFI load options to significantlly reduce the count of efi_get_var() call. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
78b1ccc4 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use u16_strsize() to get u16 string buffer size Use u16_strsize() to simplify the u16 string buffer size calculation. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c67d3c9e |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix going one directory up issue The directory name in eficonfig menu entry contains the '\' separator. strcmp() argument ".." is wrong and one directory up handling does not work correctly. strcmp() argument must include '\' separator. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c3b5af63 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add UEFI Secure Boot Key enrollment interface This commit adds the menu-driven UEFI Secure Boot Key enrollment interface. User can enroll PK, KEK, db and dbx by selecting file. Only the signed EFI Signature List(s) with an authenticated header, typically '.auth' file, is accepted. To clear the PK, KEK, db and dbx, user needs to enroll the null key signed by PK or KEK. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
21faf4ef |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use protocol interface for file selection EFI_SIMPLE_FILE_SYSTEM_PROTOCOL is not always provided by U-Boot. Use protocol interface functions instead of U-Boot internal functions. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d6566113 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose eficonfig_create_device_path() Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use eficonfig_create_device_path() to construct the full device path from device path of the volume and file path, so move it out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d571f9b2 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation All the eficonfig menus other than "Change Boot Order" use 'eficonfig_entry' structure for each menu entry. This commit refactors change boot order implementation to use 'eficonfig_entry' structure same as other menus to have consistent menu handling. This commit also simplifies the data->active handling when KEY_SPACE is pressed, and sizeof() parameter. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
8961e93e |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose append entry function Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use append_entry() and append_quit_entry() to construct the menu, so move them out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
a84040ab |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor file selection handling eficonfig_select_file_handler() is commonly used to select the file. eficonfig_display_select_file_option() adds an additional menu to clear the selected file. eficonfig_display_select_file_option() is not always necessary for the file selection process, so it must be outside of eficonfig_select_file_handler(). This commit also renames the following functions to avoid confusion. eficonfig_select_file_handler() -> eficonfig_process_select_file() eficonfig_select_file() -> eficonfig_show_file_selection() eficonfig_display_select_file_option() -> eficonfig_process_show_file_option() Finally, test_eficonfig.py need to be updated to get aligned with the above modification. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
1167e88a |
|
14-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix missing variable initialization The 'ret' variable must be initialized before use in eficonfig_delete_invalid_boot_option(). Fixes: c416f1c0bc ("bootmenu: add removable media entries") Addresses-Coverity: 376207 ("Uninitialized variables") Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
3d595ac5 |
|
09-Nov-2022 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: remove superfluous if in eficonfig_edit_boot_option Goto for an immediately succeeding label is superfluous. Fixes: 87d791423ac6 ("eficonfig: menu-driven addition of UEFI boot option") Addresses-Coverity: 376202 ("Identical code for different branches") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
9945bc4f |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Fix incorrect return code of boot option update Correct the return code for out-of-memory and no boot option found Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
339b527b |
|
19-Jun-2023 |
Raymond Mao <raymond.mao@linaro.org> |
Move bootorder and bootoption apis to lib Rename and move bootorder and bootoption apis from cmd to lib for re-use between eficonfig and bootmgr Fix 'unexpected indentation' when 'make htmldocs' after functions are moved Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
2c0b0c31 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_SECURE_BOOT This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_SECURE_BOOT defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
83f3d121 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_MM_COMM_TEE This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_MM_COMM_TEE defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
88df3634 |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: CTRL+S to save the boot order 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>
|
#
45f5319f |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
menu: remove CTRL+C to quit On the sandbox called without "--terminal raw" CTRL+C leaves U-Boot, "ESC/CTRL+C to quit" is misleading. Let's remove CTRL+C to quit key handling from bootmenu and eficonfig menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
|
#
8dbd0a0f |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add vertical scroll support The current eficonfig menu does not support vertical scroll, so it can not display the menu entries greater than the console row size. This commit add the vertial scroll support. The console size is retrieved by SIMPLE_TEXT_OUTPUT_PROTOCOL.QueryMode() service, then calculates the row size for menu entry by subtracting menu header and description row size from the console row size. "start" and "end" are added in the efimenu structure. "start" keeps the menu entry index at the top, "end" keeps the bottom menu entry index. item_data_print() menu function only draws the menu entry between "start" and "end". This commit also fixes the issue that "Save" and "Quit" entries can be moved by BKEY_PLUS in change boot order menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
0d590852 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation This commit removes the change boot order specific menu implementation. The change boot order implementation calls eficonfig_process_common() same as other menus. The change boot order menu requires own item_data_print and item_choice implementation, but display_statusline function can be a same function as other menus. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
cd160b27 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor eficonfig_process_common function Current change boot order implementation does not call eficonfig_process_common() and call own menu functions for display_statusline, item_data_print and item_choice. Change boot order functionality should call eficonfig_process_common() to improve maintenanceability. This commit is a preparation to remove the change boot order specific implementation. The menu functions (display_statusline, item_data_print and item_choice) are added as argument of eficonfig_process_common(). The menu description string displayed at the bottom of the menu is also added as argument. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
32bab0ea |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Make use of CLI character processing Avoid duplicating some of the escape-sequence processing here and use the CLI function instead. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
d0ca98db |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Update bootmenu_loop() to return the code Use the return value to save having to pass around a pointer. This also resolves any ambiguity about what *key contains when the function is called. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
2da4a15e |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Rename KEY_... to BKEY_... This enum values conflict with linux/input.h so rename them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
64550274 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: avoid SetVariable between GetNextVariableName calls The current code calls efi_set_variable_int() to delete the invalid boot option between calls to efi_get_next_variable_name_int(), it may produce unpredictable results. This commit moves removal of the invalid boot option outside of the efi_get_next_variable_name_int() calls. EFI_NOT_FOUND returned from efi_get_next_variable_name_int() indicates we retrieved all EFI variables, it should be treated as EFI_SUCEESS. To address the checkpatch warning of too many leading tabs, combine two if statement into one. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
ce327084 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: carve out efi_get_next_variable_name_int calls To retrieve the EFI variable name by efi_get_next_variable_name_int(), the sequence of alloc -> efi_get_next_variable_name_int -> realloc -> efi_get_next_variable_name_int is required. In current code, this sequence repeatedly appears in the several functions. It should be curved out a common function. This commit also fixes the missing free() of var_name16 in eficonfig_delete_invalid_boot_option(). Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
140a8959 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use efi_get_next_variable_name_int() eficonfig command reads all possible UEFI load options from 0x0000 to 0xFFFF to construct the menu. This takes too much time in some environment. This commit uses efi_get_next_variable_name_int() to read all existing UEFI load options to significantlly reduce the count of efi_get_var() call. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
78b1ccc4 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use u16_strsize() to get u16 string buffer size Use u16_strsize() to simplify the u16 string buffer size calculation. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c67d3c9e |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix going one directory up issue The directory name in eficonfig menu entry contains the '\' separator. strcmp() argument ".." is wrong and one directory up handling does not work correctly. strcmp() argument must include '\' separator. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c3b5af63 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add UEFI Secure Boot Key enrollment interface This commit adds the menu-driven UEFI Secure Boot Key enrollment interface. User can enroll PK, KEK, db and dbx by selecting file. Only the signed EFI Signature List(s) with an authenticated header, typically '.auth' file, is accepted. To clear the PK, KEK, db and dbx, user needs to enroll the null key signed by PK or KEK. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
21faf4ef |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use protocol interface for file selection EFI_SIMPLE_FILE_SYSTEM_PROTOCOL is not always provided by U-Boot. Use protocol interface functions instead of U-Boot internal functions. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d6566113 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose eficonfig_create_device_path() Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use eficonfig_create_device_path() to construct the full device path from device path of the volume and file path, so move it out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d571f9b2 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation All the eficonfig menus other than "Change Boot Order" use 'eficonfig_entry' structure for each menu entry. This commit refactors change boot order implementation to use 'eficonfig_entry' structure same as other menus to have consistent menu handling. This commit also simplifies the data->active handling when KEY_SPACE is pressed, and sizeof() parameter. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
8961e93e |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose append entry function Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use append_entry() and append_quit_entry() to construct the menu, so move them out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
a84040ab |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor file selection handling eficonfig_select_file_handler() is commonly used to select the file. eficonfig_display_select_file_option() adds an additional menu to clear the selected file. eficonfig_display_select_file_option() is not always necessary for the file selection process, so it must be outside of eficonfig_select_file_handler(). This commit also renames the following functions to avoid confusion. eficonfig_select_file_handler() -> eficonfig_process_select_file() eficonfig_select_file() -> eficonfig_show_file_selection() eficonfig_display_select_file_option() -> eficonfig_process_show_file_option() Finally, test_eficonfig.py need to be updated to get aligned with the above modification. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
1167e88a |
|
14-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix missing variable initialization The 'ret' variable must be initialized before use in eficonfig_delete_invalid_boot_option(). Fixes: c416f1c0bc ("bootmenu: add removable media entries") Addresses-Coverity: 376207 ("Uninitialized variables") Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
3d595ac5 |
|
09-Nov-2022 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: remove superfluous if in eficonfig_edit_boot_option Goto for an immediately succeeding label is superfluous. Fixes: 87d791423ac6 ("eficonfig: menu-driven addition of UEFI boot option") Addresses-Coverity: 376202 ("Identical code for different branches") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
2c0b0c31 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_SECURE_BOOT This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_SECURE_BOOT defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
83f3d121 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_MM_COMM_TEE This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_MM_COMM_TEE defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
88df3634 |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: CTRL+S to save the boot order 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>
|
#
45f5319f |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
menu: remove CTRL+C to quit On the sandbox called without "--terminal raw" CTRL+C leaves U-Boot, "ESC/CTRL+C to quit" is misleading. Let's remove CTRL+C to quit key handling from bootmenu and eficonfig menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
|
#
8dbd0a0f |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add vertical scroll support The current eficonfig menu does not support vertical scroll, so it can not display the menu entries greater than the console row size. This commit add the vertial scroll support. The console size is retrieved by SIMPLE_TEXT_OUTPUT_PROTOCOL.QueryMode() service, then calculates the row size for menu entry by subtracting menu header and description row size from the console row size. "start" and "end" are added in the efimenu structure. "start" keeps the menu entry index at the top, "end" keeps the bottom menu entry index. item_data_print() menu function only draws the menu entry between "start" and "end". This commit also fixes the issue that "Save" and "Quit" entries can be moved by BKEY_PLUS in change boot order menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
0d590852 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation This commit removes the change boot order specific menu implementation. The change boot order implementation calls eficonfig_process_common() same as other menus. The change boot order menu requires own item_data_print and item_choice implementation, but display_statusline function can be a same function as other menus. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
cd160b27 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor eficonfig_process_common function Current change boot order implementation does not call eficonfig_process_common() and call own menu functions for display_statusline, item_data_print and item_choice. Change boot order functionality should call eficonfig_process_common() to improve maintenanceability. This commit is a preparation to remove the change boot order specific implementation. The menu functions (display_statusline, item_data_print and item_choice) are added as argument of eficonfig_process_common(). The menu description string displayed at the bottom of the menu is also added as argument. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
32bab0ea |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Make use of CLI character processing Avoid duplicating some of the escape-sequence processing here and use the CLI function instead. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
d0ca98db |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Update bootmenu_loop() to return the code Use the return value to save having to pass around a pointer. This also resolves any ambiguity about what *key contains when the function is called. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
2da4a15e |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Rename KEY_... to BKEY_... This enum values conflict with linux/input.h so rename them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
64550274 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: avoid SetVariable between GetNextVariableName calls The current code calls efi_set_variable_int() to delete the invalid boot option between calls to efi_get_next_variable_name_int(), it may produce unpredictable results. This commit moves removal of the invalid boot option outside of the efi_get_next_variable_name_int() calls. EFI_NOT_FOUND returned from efi_get_next_variable_name_int() indicates we retrieved all EFI variables, it should be treated as EFI_SUCEESS. To address the checkpatch warning of too many leading tabs, combine two if statement into one. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
ce327084 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: carve out efi_get_next_variable_name_int calls To retrieve the EFI variable name by efi_get_next_variable_name_int(), the sequence of alloc -> efi_get_next_variable_name_int -> realloc -> efi_get_next_variable_name_int is required. In current code, this sequence repeatedly appears in the several functions. It should be curved out a common function. This commit also fixes the missing free() of var_name16 in eficonfig_delete_invalid_boot_option(). Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
140a8959 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use efi_get_next_variable_name_int() eficonfig command reads all possible UEFI load options from 0x0000 to 0xFFFF to construct the menu. This takes too much time in some environment. This commit uses efi_get_next_variable_name_int() to read all existing UEFI load options to significantlly reduce the count of efi_get_var() call. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
78b1ccc4 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use u16_strsize() to get u16 string buffer size Use u16_strsize() to simplify the u16 string buffer size calculation. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c67d3c9e |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix going one directory up issue The directory name in eficonfig menu entry contains the '\' separator. strcmp() argument ".." is wrong and one directory up handling does not work correctly. strcmp() argument must include '\' separator. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c3b5af63 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add UEFI Secure Boot Key enrollment interface This commit adds the menu-driven UEFI Secure Boot Key enrollment interface. User can enroll PK, KEK, db and dbx by selecting file. Only the signed EFI Signature List(s) with an authenticated header, typically '.auth' file, is accepted. To clear the PK, KEK, db and dbx, user needs to enroll the null key signed by PK or KEK. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
21faf4ef |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use protocol interface for file selection EFI_SIMPLE_FILE_SYSTEM_PROTOCOL is not always provided by U-Boot. Use protocol interface functions instead of U-Boot internal functions. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d6566113 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose eficonfig_create_device_path() Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use eficonfig_create_device_path() to construct the full device path from device path of the volume and file path, so move it out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d571f9b2 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation All the eficonfig menus other than "Change Boot Order" use 'eficonfig_entry' structure for each menu entry. This commit refactors change boot order implementation to use 'eficonfig_entry' structure same as other menus to have consistent menu handling. This commit also simplifies the data->active handling when KEY_SPACE is pressed, and sizeof() parameter. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
8961e93e |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose append entry function Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use append_entry() and append_quit_entry() to construct the menu, so move them out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
a84040ab |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor file selection handling eficonfig_select_file_handler() is commonly used to select the file. eficonfig_display_select_file_option() adds an additional menu to clear the selected file. eficonfig_display_select_file_option() is not always necessary for the file selection process, so it must be outside of eficonfig_select_file_handler(). This commit also renames the following functions to avoid confusion. eficonfig_select_file_handler() -> eficonfig_process_select_file() eficonfig_select_file() -> eficonfig_show_file_selection() eficonfig_display_select_file_option() -> eficonfig_process_show_file_option() Finally, test_eficonfig.py need to be updated to get aligned with the above modification. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
1167e88a |
|
14-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix missing variable initialization The 'ret' variable must be initialized before use in eficonfig_delete_invalid_boot_option(). Fixes: c416f1c0bc ("bootmenu: add removable media entries") Addresses-Coverity: 376207 ("Uninitialized variables") Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
3d595ac5 |
|
09-Nov-2022 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: remove superfluous if in eficonfig_edit_boot_option Goto for an immediately succeeding label is superfluous. Fixes: 87d791423ac6 ("eficonfig: menu-driven addition of UEFI boot option") Addresses-Coverity: 376202 ("Identical code for different branches") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
2c0b0c31 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_SECURE_BOOT This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_SECURE_BOOT defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
83f3d121 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_MM_COMM_TEE This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_MM_COMM_TEE defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
88df3634 |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: CTRL+S to save the boot order 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>
|
#
45f5319f |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
menu: remove CTRL+C to quit On the sandbox called without "--terminal raw" CTRL+C leaves U-Boot, "ESC/CTRL+C to quit" is misleading. Let's remove CTRL+C to quit key handling from bootmenu and eficonfig menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
|
#
8dbd0a0f |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add vertical scroll support The current eficonfig menu does not support vertical scroll, so it can not display the menu entries greater than the console row size. This commit add the vertial scroll support. The console size is retrieved by SIMPLE_TEXT_OUTPUT_PROTOCOL.QueryMode() service, then calculates the row size for menu entry by subtracting menu header and description row size from the console row size. "start" and "end" are added in the efimenu structure. "start" keeps the menu entry index at the top, "end" keeps the bottom menu entry index. item_data_print() menu function only draws the menu entry between "start" and "end". This commit also fixes the issue that "Save" and "Quit" entries can be moved by BKEY_PLUS in change boot order menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
0d590852 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation This commit removes the change boot order specific menu implementation. The change boot order implementation calls eficonfig_process_common() same as other menus. The change boot order menu requires own item_data_print and item_choice implementation, but display_statusline function can be a same function as other menus. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
cd160b27 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor eficonfig_process_common function Current change boot order implementation does not call eficonfig_process_common() and call own menu functions for display_statusline, item_data_print and item_choice. Change boot order functionality should call eficonfig_process_common() to improve maintenanceability. This commit is a preparation to remove the change boot order specific implementation. The menu functions (display_statusline, item_data_print and item_choice) are added as argument of eficonfig_process_common(). The menu description string displayed at the bottom of the menu is also added as argument. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
32bab0ea |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Make use of CLI character processing Avoid duplicating some of the escape-sequence processing here and use the CLI function instead. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
d0ca98db |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Update bootmenu_loop() to return the code Use the return value to save having to pass around a pointer. This also resolves any ambiguity about what *key contains when the function is called. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
2da4a15e |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Rename KEY_... to BKEY_... This enum values conflict with linux/input.h so rename them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
64550274 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: avoid SetVariable between GetNextVariableName calls The current code calls efi_set_variable_int() to delete the invalid boot option between calls to efi_get_next_variable_name_int(), it may produce unpredictable results. This commit moves removal of the invalid boot option outside of the efi_get_next_variable_name_int() calls. EFI_NOT_FOUND returned from efi_get_next_variable_name_int() indicates we retrieved all EFI variables, it should be treated as EFI_SUCEESS. To address the checkpatch warning of too many leading tabs, combine two if statement into one. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
ce327084 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: carve out efi_get_next_variable_name_int calls To retrieve the EFI variable name by efi_get_next_variable_name_int(), the sequence of alloc -> efi_get_next_variable_name_int -> realloc -> efi_get_next_variable_name_int is required. In current code, this sequence repeatedly appears in the several functions. It should be curved out a common function. This commit also fixes the missing free() of var_name16 in eficonfig_delete_invalid_boot_option(). Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
140a8959 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use efi_get_next_variable_name_int() eficonfig command reads all possible UEFI load options from 0x0000 to 0xFFFF to construct the menu. This takes too much time in some environment. This commit uses efi_get_next_variable_name_int() to read all existing UEFI load options to significantlly reduce the count of efi_get_var() call. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
78b1ccc4 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use u16_strsize() to get u16 string buffer size Use u16_strsize() to simplify the u16 string buffer size calculation. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c67d3c9e |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix going one directory up issue The directory name in eficonfig menu entry contains the '\' separator. strcmp() argument ".." is wrong and one directory up handling does not work correctly. strcmp() argument must include '\' separator. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c3b5af63 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add UEFI Secure Boot Key enrollment interface This commit adds the menu-driven UEFI Secure Boot Key enrollment interface. User can enroll PK, KEK, db and dbx by selecting file. Only the signed EFI Signature List(s) with an authenticated header, typically '.auth' file, is accepted. To clear the PK, KEK, db and dbx, user needs to enroll the null key signed by PK or KEK. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
21faf4ef |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use protocol interface for file selection EFI_SIMPLE_FILE_SYSTEM_PROTOCOL is not always provided by U-Boot. Use protocol interface functions instead of U-Boot internal functions. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d6566113 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose eficonfig_create_device_path() Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use eficonfig_create_device_path() to construct the full device path from device path of the volume and file path, so move it out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d571f9b2 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation All the eficonfig menus other than "Change Boot Order" use 'eficonfig_entry' structure for each menu entry. This commit refactors change boot order implementation to use 'eficonfig_entry' structure same as other menus to have consistent menu handling. This commit also simplifies the data->active handling when KEY_SPACE is pressed, and sizeof() parameter. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
8961e93e |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose append entry function Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use append_entry() and append_quit_entry() to construct the menu, so move them out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
a84040ab |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor file selection handling eficonfig_select_file_handler() is commonly used to select the file. eficonfig_display_select_file_option() adds an additional menu to clear the selected file. eficonfig_display_select_file_option() is not always necessary for the file selection process, so it must be outside of eficonfig_select_file_handler(). This commit also renames the following functions to avoid confusion. eficonfig_select_file_handler() -> eficonfig_process_select_file() eficonfig_select_file() -> eficonfig_show_file_selection() eficonfig_display_select_file_option() -> eficonfig_process_show_file_option() Finally, test_eficonfig.py need to be updated to get aligned with the above modification. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
1167e88a |
|
14-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix missing variable initialization The 'ret' variable must be initialized before use in eficonfig_delete_invalid_boot_option(). Fixes: c416f1c0bc ("bootmenu: add removable media entries") Addresses-Coverity: 376207 ("Uninitialized variables") Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
3d595ac5 |
|
09-Nov-2022 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: remove superfluous if in eficonfig_edit_boot_option Goto for an immediately succeeding label is superfluous. Fixes: 87d791423ac6 ("eficonfig: menu-driven addition of UEFI boot option") Addresses-Coverity: 376202 ("Identical code for different branches") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
2c0b0c31 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_SECURE_BOOT This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_SECURE_BOOT defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
83f3d121 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_MM_COMM_TEE This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_MM_COMM_TEE defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
88df3634 |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: CTRL+S to save the boot order 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>
|
#
45f5319f |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
menu: remove CTRL+C to quit On the sandbox called without "--terminal raw" CTRL+C leaves U-Boot, "ESC/CTRL+C to quit" is misleading. Let's remove CTRL+C to quit key handling from bootmenu and eficonfig menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
|
#
8dbd0a0f |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add vertical scroll support The current eficonfig menu does not support vertical scroll, so it can not display the menu entries greater than the console row size. This commit add the vertial scroll support. The console size is retrieved by SIMPLE_TEXT_OUTPUT_PROTOCOL.QueryMode() service, then calculates the row size for menu entry by subtracting menu header and description row size from the console row size. "start" and "end" are added in the efimenu structure. "start" keeps the menu entry index at the top, "end" keeps the bottom menu entry index. item_data_print() menu function only draws the menu entry between "start" and "end". This commit also fixes the issue that "Save" and "Quit" entries can be moved by BKEY_PLUS in change boot order menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
0d590852 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation This commit removes the change boot order specific menu implementation. The change boot order implementation calls eficonfig_process_common() same as other menus. The change boot order menu requires own item_data_print and item_choice implementation, but display_statusline function can be a same function as other menus. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
cd160b27 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor eficonfig_process_common function Current change boot order implementation does not call eficonfig_process_common() and call own menu functions for display_statusline, item_data_print and item_choice. Change boot order functionality should call eficonfig_process_common() to improve maintenanceability. This commit is a preparation to remove the change boot order specific implementation. The menu functions (display_statusline, item_data_print and item_choice) are added as argument of eficonfig_process_common(). The menu description string displayed at the bottom of the menu is also added as argument. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
32bab0ea |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Make use of CLI character processing Avoid duplicating some of the escape-sequence processing here and use the CLI function instead. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
d0ca98db |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Update bootmenu_loop() to return the code Use the return value to save having to pass around a pointer. This also resolves any ambiguity about what *key contains when the function is called. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
2da4a15e |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Rename KEY_... to BKEY_... This enum values conflict with linux/input.h so rename them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
64550274 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: avoid SetVariable between GetNextVariableName calls The current code calls efi_set_variable_int() to delete the invalid boot option between calls to efi_get_next_variable_name_int(), it may produce unpredictable results. This commit moves removal of the invalid boot option outside of the efi_get_next_variable_name_int() calls. EFI_NOT_FOUND returned from efi_get_next_variable_name_int() indicates we retrieved all EFI variables, it should be treated as EFI_SUCEESS. To address the checkpatch warning of too many leading tabs, combine two if statement into one. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
ce327084 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: carve out efi_get_next_variable_name_int calls To retrieve the EFI variable name by efi_get_next_variable_name_int(), the sequence of alloc -> efi_get_next_variable_name_int -> realloc -> efi_get_next_variable_name_int is required. In current code, this sequence repeatedly appears in the several functions. It should be curved out a common function. This commit also fixes the missing free() of var_name16 in eficonfig_delete_invalid_boot_option(). Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
140a8959 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use efi_get_next_variable_name_int() eficonfig command reads all possible UEFI load options from 0x0000 to 0xFFFF to construct the menu. This takes too much time in some environment. This commit uses efi_get_next_variable_name_int() to read all existing UEFI load options to significantlly reduce the count of efi_get_var() call. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
78b1ccc4 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use u16_strsize() to get u16 string buffer size Use u16_strsize() to simplify the u16 string buffer size calculation. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c67d3c9e |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix going one directory up issue The directory name in eficonfig menu entry contains the '\' separator. strcmp() argument ".." is wrong and one directory up handling does not work correctly. strcmp() argument must include '\' separator. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c3b5af63 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add UEFI Secure Boot Key enrollment interface This commit adds the menu-driven UEFI Secure Boot Key enrollment interface. User can enroll PK, KEK, db and dbx by selecting file. Only the signed EFI Signature List(s) with an authenticated header, typically '.auth' file, is accepted. To clear the PK, KEK, db and dbx, user needs to enroll the null key signed by PK or KEK. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
21faf4ef |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use protocol interface for file selection EFI_SIMPLE_FILE_SYSTEM_PROTOCOL is not always provided by U-Boot. Use protocol interface functions instead of U-Boot internal functions. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d6566113 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose eficonfig_create_device_path() Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use eficonfig_create_device_path() to construct the full device path from device path of the volume and file path, so move it out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d571f9b2 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation All the eficonfig menus other than "Change Boot Order" use 'eficonfig_entry' structure for each menu entry. This commit refactors change boot order implementation to use 'eficonfig_entry' structure same as other menus to have consistent menu handling. This commit also simplifies the data->active handling when KEY_SPACE is pressed, and sizeof() parameter. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
8961e93e |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose append entry function Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use append_entry() and append_quit_entry() to construct the menu, so move them out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
a84040ab |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor file selection handling eficonfig_select_file_handler() is commonly used to select the file. eficonfig_display_select_file_option() adds an additional menu to clear the selected file. eficonfig_display_select_file_option() is not always necessary for the file selection process, so it must be outside of eficonfig_select_file_handler(). This commit also renames the following functions to avoid confusion. eficonfig_select_file_handler() -> eficonfig_process_select_file() eficonfig_select_file() -> eficonfig_show_file_selection() eficonfig_display_select_file_option() -> eficonfig_process_show_file_option() Finally, test_eficonfig.py need to be updated to get aligned with the above modification. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
1167e88a |
|
14-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix missing variable initialization The 'ret' variable must be initialized before use in eficonfig_delete_invalid_boot_option(). Fixes: c416f1c0bc ("bootmenu: add removable media entries") Addresses-Coverity: 376207 ("Uninitialized variables") Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
3d595ac5 |
|
09-Nov-2022 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: remove superfluous if in eficonfig_edit_boot_option Goto for an immediately succeeding label is superfluous. Fixes: 87d791423ac6 ("eficonfig: menu-driven addition of UEFI boot option") Addresses-Coverity: 376202 ("Identical code for different branches") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
2c0b0c31 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_SECURE_BOOT This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_SECURE_BOOT defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
83f3d121 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_MM_COMM_TEE This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_MM_COMM_TEE defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
88df3634 |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: CTRL+S to save the boot order 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>
|
#
45f5319f |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
menu: remove CTRL+C to quit On the sandbox called without "--terminal raw" CTRL+C leaves U-Boot, "ESC/CTRL+C to quit" is misleading. Let's remove CTRL+C to quit key handling from bootmenu and eficonfig menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
|
#
8dbd0a0f |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add vertical scroll support The current eficonfig menu does not support vertical scroll, so it can not display the menu entries greater than the console row size. This commit add the vertial scroll support. The console size is retrieved by SIMPLE_TEXT_OUTPUT_PROTOCOL.QueryMode() service, then calculates the row size for menu entry by subtracting menu header and description row size from the console row size. "start" and "end" are added in the efimenu structure. "start" keeps the menu entry index at the top, "end" keeps the bottom menu entry index. item_data_print() menu function only draws the menu entry between "start" and "end". This commit also fixes the issue that "Save" and "Quit" entries can be moved by BKEY_PLUS in change boot order menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
0d590852 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation This commit removes the change boot order specific menu implementation. The change boot order implementation calls eficonfig_process_common() same as other menus. The change boot order menu requires own item_data_print and item_choice implementation, but display_statusline function can be a same function as other menus. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
cd160b27 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor eficonfig_process_common function Current change boot order implementation does not call eficonfig_process_common() and call own menu functions for display_statusline, item_data_print and item_choice. Change boot order functionality should call eficonfig_process_common() to improve maintenanceability. This commit is a preparation to remove the change boot order specific implementation. The menu functions (display_statusline, item_data_print and item_choice) are added as argument of eficonfig_process_common(). The menu description string displayed at the bottom of the menu is also added as argument. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
32bab0ea |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Make use of CLI character processing Avoid duplicating some of the escape-sequence processing here and use the CLI function instead. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
d0ca98db |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Update bootmenu_loop() to return the code Use the return value to save having to pass around a pointer. This also resolves any ambiguity about what *key contains when the function is called. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
2da4a15e |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Rename KEY_... to BKEY_... This enum values conflict with linux/input.h so rename them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
64550274 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: avoid SetVariable between GetNextVariableName calls The current code calls efi_set_variable_int() to delete the invalid boot option between calls to efi_get_next_variable_name_int(), it may produce unpredictable results. This commit moves removal of the invalid boot option outside of the efi_get_next_variable_name_int() calls. EFI_NOT_FOUND returned from efi_get_next_variable_name_int() indicates we retrieved all EFI variables, it should be treated as EFI_SUCEESS. To address the checkpatch warning of too many leading tabs, combine two if statement into one. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
ce327084 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: carve out efi_get_next_variable_name_int calls To retrieve the EFI variable name by efi_get_next_variable_name_int(), the sequence of alloc -> efi_get_next_variable_name_int -> realloc -> efi_get_next_variable_name_int is required. In current code, this sequence repeatedly appears in the several functions. It should be curved out a common function. This commit also fixes the missing free() of var_name16 in eficonfig_delete_invalid_boot_option(). Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
140a8959 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use efi_get_next_variable_name_int() eficonfig command reads all possible UEFI load options from 0x0000 to 0xFFFF to construct the menu. This takes too much time in some environment. This commit uses efi_get_next_variable_name_int() to read all existing UEFI load options to significantlly reduce the count of efi_get_var() call. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
78b1ccc4 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use u16_strsize() to get u16 string buffer size Use u16_strsize() to simplify the u16 string buffer size calculation. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c67d3c9e |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix going one directory up issue The directory name in eficonfig menu entry contains the '\' separator. strcmp() argument ".." is wrong and one directory up handling does not work correctly. strcmp() argument must include '\' separator. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c3b5af63 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add UEFI Secure Boot Key enrollment interface This commit adds the menu-driven UEFI Secure Boot Key enrollment interface. User can enroll PK, KEK, db and dbx by selecting file. Only the signed EFI Signature List(s) with an authenticated header, typically '.auth' file, is accepted. To clear the PK, KEK, db and dbx, user needs to enroll the null key signed by PK or KEK. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
21faf4ef |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use protocol interface for file selection EFI_SIMPLE_FILE_SYSTEM_PROTOCOL is not always provided by U-Boot. Use protocol interface functions instead of U-Boot internal functions. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d6566113 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose eficonfig_create_device_path() Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use eficonfig_create_device_path() to construct the full device path from device path of the volume and file path, so move it out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d571f9b2 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation All the eficonfig menus other than "Change Boot Order" use 'eficonfig_entry' structure for each menu entry. This commit refactors change boot order implementation to use 'eficonfig_entry' structure same as other menus to have consistent menu handling. This commit also simplifies the data->active handling when KEY_SPACE is pressed, and sizeof() parameter. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
8961e93e |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose append entry function Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use append_entry() and append_quit_entry() to construct the menu, so move them out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
a84040ab |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor file selection handling eficonfig_select_file_handler() is commonly used to select the file. eficonfig_display_select_file_option() adds an additional menu to clear the selected file. eficonfig_display_select_file_option() is not always necessary for the file selection process, so it must be outside of eficonfig_select_file_handler(). This commit also renames the following functions to avoid confusion. eficonfig_select_file_handler() -> eficonfig_process_select_file() eficonfig_select_file() -> eficonfig_show_file_selection() eficonfig_display_select_file_option() -> eficonfig_process_show_file_option() Finally, test_eficonfig.py need to be updated to get aligned with the above modification. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
1167e88a |
|
14-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix missing variable initialization The 'ret' variable must be initialized before use in eficonfig_delete_invalid_boot_option(). Fixes: c416f1c0bc ("bootmenu: add removable media entries") Addresses-Coverity: 376207 ("Uninitialized variables") Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
3d595ac5 |
|
09-Nov-2022 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: remove superfluous if in eficonfig_edit_boot_option Goto for an immediately succeeding label is superfluous. Fixes: 87d791423ac6 ("eficonfig: menu-driven addition of UEFI boot option") Addresses-Coverity: 376202 ("Identical code for different branches") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
2c0b0c31 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_SECURE_BOOT This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_SECURE_BOOT defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
83f3d121 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_MM_COMM_TEE This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_MM_COMM_TEE defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
88df3634 |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: CTRL+S to save the boot order 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>
|
#
45f5319f |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
menu: remove CTRL+C to quit On the sandbox called without "--terminal raw" CTRL+C leaves U-Boot, "ESC/CTRL+C to quit" is misleading. Let's remove CTRL+C to quit key handling from bootmenu and eficonfig menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
|
#
8dbd0a0f |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add vertical scroll support The current eficonfig menu does not support vertical scroll, so it can not display the menu entries greater than the console row size. This commit add the vertial scroll support. The console size is retrieved by SIMPLE_TEXT_OUTPUT_PROTOCOL.QueryMode() service, then calculates the row size for menu entry by subtracting menu header and description row size from the console row size. "start" and "end" are added in the efimenu structure. "start" keeps the menu entry index at the top, "end" keeps the bottom menu entry index. item_data_print() menu function only draws the menu entry between "start" and "end". This commit also fixes the issue that "Save" and "Quit" entries can be moved by BKEY_PLUS in change boot order menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
0d590852 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation This commit removes the change boot order specific menu implementation. The change boot order implementation calls eficonfig_process_common() same as other menus. The change boot order menu requires own item_data_print and item_choice implementation, but display_statusline function can be a same function as other menus. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
cd160b27 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor eficonfig_process_common function Current change boot order implementation does not call eficonfig_process_common() and call own menu functions for display_statusline, item_data_print and item_choice. Change boot order functionality should call eficonfig_process_common() to improve maintenanceability. This commit is a preparation to remove the change boot order specific implementation. The menu functions (display_statusline, item_data_print and item_choice) are added as argument of eficonfig_process_common(). The menu description string displayed at the bottom of the menu is also added as argument. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
32bab0ea |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Make use of CLI character processing Avoid duplicating some of the escape-sequence processing here and use the CLI function instead. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
d0ca98db |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Update bootmenu_loop() to return the code Use the return value to save having to pass around a pointer. This also resolves any ambiguity about what *key contains when the function is called. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
2da4a15e |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Rename KEY_... to BKEY_... This enum values conflict with linux/input.h so rename them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
64550274 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: avoid SetVariable between GetNextVariableName calls The current code calls efi_set_variable_int() to delete the invalid boot option between calls to efi_get_next_variable_name_int(), it may produce unpredictable results. This commit moves removal of the invalid boot option outside of the efi_get_next_variable_name_int() calls. EFI_NOT_FOUND returned from efi_get_next_variable_name_int() indicates we retrieved all EFI variables, it should be treated as EFI_SUCEESS. To address the checkpatch warning of too many leading tabs, combine two if statement into one. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
ce327084 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: carve out efi_get_next_variable_name_int calls To retrieve the EFI variable name by efi_get_next_variable_name_int(), the sequence of alloc -> efi_get_next_variable_name_int -> realloc -> efi_get_next_variable_name_int is required. In current code, this sequence repeatedly appears in the several functions. It should be curved out a common function. This commit also fixes the missing free() of var_name16 in eficonfig_delete_invalid_boot_option(). Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
140a8959 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use efi_get_next_variable_name_int() eficonfig command reads all possible UEFI load options from 0x0000 to 0xFFFF to construct the menu. This takes too much time in some environment. This commit uses efi_get_next_variable_name_int() to read all existing UEFI load options to significantlly reduce the count of efi_get_var() call. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
78b1ccc4 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use u16_strsize() to get u16 string buffer size Use u16_strsize() to simplify the u16 string buffer size calculation. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c67d3c9e |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix going one directory up issue The directory name in eficonfig menu entry contains the '\' separator. strcmp() argument ".." is wrong and one directory up handling does not work correctly. strcmp() argument must include '\' separator. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c3b5af63 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add UEFI Secure Boot Key enrollment interface This commit adds the menu-driven UEFI Secure Boot Key enrollment interface. User can enroll PK, KEK, db and dbx by selecting file. Only the signed EFI Signature List(s) with an authenticated header, typically '.auth' file, is accepted. To clear the PK, KEK, db and dbx, user needs to enroll the null key signed by PK or KEK. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
21faf4ef |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use protocol interface for file selection EFI_SIMPLE_FILE_SYSTEM_PROTOCOL is not always provided by U-Boot. Use protocol interface functions instead of U-Boot internal functions. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d6566113 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose eficonfig_create_device_path() Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use eficonfig_create_device_path() to construct the full device path from device path of the volume and file path, so move it out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d571f9b2 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation All the eficonfig menus other than "Change Boot Order" use 'eficonfig_entry' structure for each menu entry. This commit refactors change boot order implementation to use 'eficonfig_entry' structure same as other menus to have consistent menu handling. This commit also simplifies the data->active handling when KEY_SPACE is pressed, and sizeof() parameter. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
8961e93e |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose append entry function Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use append_entry() and append_quit_entry() to construct the menu, so move them out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
a84040ab |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor file selection handling eficonfig_select_file_handler() is commonly used to select the file. eficonfig_display_select_file_option() adds an additional menu to clear the selected file. eficonfig_display_select_file_option() is not always necessary for the file selection process, so it must be outside of eficonfig_select_file_handler(). This commit also renames the following functions to avoid confusion. eficonfig_select_file_handler() -> eficonfig_process_select_file() eficonfig_select_file() -> eficonfig_show_file_selection() eficonfig_display_select_file_option() -> eficonfig_process_show_file_option() Finally, test_eficonfig.py need to be updated to get aligned with the above modification. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
1167e88a |
|
14-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix missing variable initialization The 'ret' variable must be initialized before use in eficonfig_delete_invalid_boot_option(). Fixes: c416f1c0bc ("bootmenu: add removable media entries") Addresses-Coverity: 376207 ("Uninitialized variables") Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
3d595ac5 |
|
09-Nov-2022 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: remove superfluous if in eficonfig_edit_boot_option Goto for an immediately succeeding label is superfluous. Fixes: 87d791423ac6 ("eficonfig: menu-driven addition of UEFI boot option") Addresses-Coverity: 376202 ("Identical code for different branches") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
2c0b0c31 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_SECURE_BOOT This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_SECURE_BOOT defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
83f3d121 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_MM_COMM_TEE This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_MM_COMM_TEE defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
88df3634 |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: CTRL+S to save the boot order 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>
|
#
45f5319f |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
menu: remove CTRL+C to quit On the sandbox called without "--terminal raw" CTRL+C leaves U-Boot, "ESC/CTRL+C to quit" is misleading. Let's remove CTRL+C to quit key handling from bootmenu and eficonfig menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
|
#
8dbd0a0f |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add vertical scroll support The current eficonfig menu does not support vertical scroll, so it can not display the menu entries greater than the console row size. This commit add the vertial scroll support. The console size is retrieved by SIMPLE_TEXT_OUTPUT_PROTOCOL.QueryMode() service, then calculates the row size for menu entry by subtracting menu header and description row size from the console row size. "start" and "end" are added in the efimenu structure. "start" keeps the menu entry index at the top, "end" keeps the bottom menu entry index. item_data_print() menu function only draws the menu entry between "start" and "end". This commit also fixes the issue that "Save" and "Quit" entries can be moved by BKEY_PLUS in change boot order menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
0d590852 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation This commit removes the change boot order specific menu implementation. The change boot order implementation calls eficonfig_process_common() same as other menus. The change boot order menu requires own item_data_print and item_choice implementation, but display_statusline function can be a same function as other menus. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
cd160b27 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor eficonfig_process_common function Current change boot order implementation does not call eficonfig_process_common() and call own menu functions for display_statusline, item_data_print and item_choice. Change boot order functionality should call eficonfig_process_common() to improve maintenanceability. This commit is a preparation to remove the change boot order specific implementation. The menu functions (display_statusline, item_data_print and item_choice) are added as argument of eficonfig_process_common(). The menu description string displayed at the bottom of the menu is also added as argument. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
32bab0ea |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Make use of CLI character processing Avoid duplicating some of the escape-sequence processing here and use the CLI function instead. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
d0ca98db |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Update bootmenu_loop() to return the code Use the return value to save having to pass around a pointer. This also resolves any ambiguity about what *key contains when the function is called. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
2da4a15e |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Rename KEY_... to BKEY_... This enum values conflict with linux/input.h so rename them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
64550274 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: avoid SetVariable between GetNextVariableName calls The current code calls efi_set_variable_int() to delete the invalid boot option between calls to efi_get_next_variable_name_int(), it may produce unpredictable results. This commit moves removal of the invalid boot option outside of the efi_get_next_variable_name_int() calls. EFI_NOT_FOUND returned from efi_get_next_variable_name_int() indicates we retrieved all EFI variables, it should be treated as EFI_SUCEESS. To address the checkpatch warning of too many leading tabs, combine two if statement into one. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
ce327084 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: carve out efi_get_next_variable_name_int calls To retrieve the EFI variable name by efi_get_next_variable_name_int(), the sequence of alloc -> efi_get_next_variable_name_int -> realloc -> efi_get_next_variable_name_int is required. In current code, this sequence repeatedly appears in the several functions. It should be curved out a common function. This commit also fixes the missing free() of var_name16 in eficonfig_delete_invalid_boot_option(). Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
140a8959 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use efi_get_next_variable_name_int() eficonfig command reads all possible UEFI load options from 0x0000 to 0xFFFF to construct the menu. This takes too much time in some environment. This commit uses efi_get_next_variable_name_int() to read all existing UEFI load options to significantlly reduce the count of efi_get_var() call. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
78b1ccc4 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use u16_strsize() to get u16 string buffer size Use u16_strsize() to simplify the u16 string buffer size calculation. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c67d3c9e |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix going one directory up issue The directory name in eficonfig menu entry contains the '\' separator. strcmp() argument ".." is wrong and one directory up handling does not work correctly. strcmp() argument must include '\' separator. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c3b5af63 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add UEFI Secure Boot Key enrollment interface This commit adds the menu-driven UEFI Secure Boot Key enrollment interface. User can enroll PK, KEK, db and dbx by selecting file. Only the signed EFI Signature List(s) with an authenticated header, typically '.auth' file, is accepted. To clear the PK, KEK, db and dbx, user needs to enroll the null key signed by PK or KEK. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
21faf4ef |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use protocol interface for file selection EFI_SIMPLE_FILE_SYSTEM_PROTOCOL is not always provided by U-Boot. Use protocol interface functions instead of U-Boot internal functions. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d6566113 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose eficonfig_create_device_path() Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use eficonfig_create_device_path() to construct the full device path from device path of the volume and file path, so move it out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d571f9b2 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation All the eficonfig menus other than "Change Boot Order" use 'eficonfig_entry' structure for each menu entry. This commit refactors change boot order implementation to use 'eficonfig_entry' structure same as other menus to have consistent menu handling. This commit also simplifies the data->active handling when KEY_SPACE is pressed, and sizeof() parameter. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
8961e93e |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose append entry function Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use append_entry() and append_quit_entry() to construct the menu, so move them out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
a84040ab |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor file selection handling eficonfig_select_file_handler() is commonly used to select the file. eficonfig_display_select_file_option() adds an additional menu to clear the selected file. eficonfig_display_select_file_option() is not always necessary for the file selection process, so it must be outside of eficonfig_select_file_handler(). This commit also renames the following functions to avoid confusion. eficonfig_select_file_handler() -> eficonfig_process_select_file() eficonfig_select_file() -> eficonfig_show_file_selection() eficonfig_display_select_file_option() -> eficonfig_process_show_file_option() Finally, test_eficonfig.py need to be updated to get aligned with the above modification. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
1167e88a |
|
14-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix missing variable initialization The 'ret' variable must be initialized before use in eficonfig_delete_invalid_boot_option(). Fixes: c416f1c0bc ("bootmenu: add removable media entries") Addresses-Coverity: 376207 ("Uninitialized variables") Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
3d595ac5 |
|
09-Nov-2022 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: remove superfluous if in eficonfig_edit_boot_option Goto for an immediately succeeding label is superfluous. Fixes: 87d791423ac6 ("eficonfig: menu-driven addition of UEFI boot option") Addresses-Coverity: 376202 ("Identical code for different branches") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
2c0b0c31 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_SECURE_BOOT This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_SECURE_BOOT defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
83f3d121 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_MM_COMM_TEE This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_MM_COMM_TEE defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
88df3634 |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: CTRL+S to save the boot order 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>
|
#
45f5319f |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
menu: remove CTRL+C to quit On the sandbox called without "--terminal raw" CTRL+C leaves U-Boot, "ESC/CTRL+C to quit" is misleading. Let's remove CTRL+C to quit key handling from bootmenu and eficonfig menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
|
#
8dbd0a0f |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add vertical scroll support The current eficonfig menu does not support vertical scroll, so it can not display the menu entries greater than the console row size. This commit add the vertial scroll support. The console size is retrieved by SIMPLE_TEXT_OUTPUT_PROTOCOL.QueryMode() service, then calculates the row size for menu entry by subtracting menu header and description row size from the console row size. "start" and "end" are added in the efimenu structure. "start" keeps the menu entry index at the top, "end" keeps the bottom menu entry index. item_data_print() menu function only draws the menu entry between "start" and "end". This commit also fixes the issue that "Save" and "Quit" entries can be moved by BKEY_PLUS in change boot order menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
0d590852 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation This commit removes the change boot order specific menu implementation. The change boot order implementation calls eficonfig_process_common() same as other menus. The change boot order menu requires own item_data_print and item_choice implementation, but display_statusline function can be a same function as other menus. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
cd160b27 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor eficonfig_process_common function Current change boot order implementation does not call eficonfig_process_common() and call own menu functions for display_statusline, item_data_print and item_choice. Change boot order functionality should call eficonfig_process_common() to improve maintenanceability. This commit is a preparation to remove the change boot order specific implementation. The menu functions (display_statusline, item_data_print and item_choice) are added as argument of eficonfig_process_common(). The menu description string displayed at the bottom of the menu is also added as argument. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
32bab0ea |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Make use of CLI character processing Avoid duplicating some of the escape-sequence processing here and use the CLI function instead. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
d0ca98db |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Update bootmenu_loop() to return the code Use the return value to save having to pass around a pointer. This also resolves any ambiguity about what *key contains when the function is called. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
2da4a15e |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Rename KEY_... to BKEY_... This enum values conflict with linux/input.h so rename them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
64550274 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: avoid SetVariable between GetNextVariableName calls The current code calls efi_set_variable_int() to delete the invalid boot option between calls to efi_get_next_variable_name_int(), it may produce unpredictable results. This commit moves removal of the invalid boot option outside of the efi_get_next_variable_name_int() calls. EFI_NOT_FOUND returned from efi_get_next_variable_name_int() indicates we retrieved all EFI variables, it should be treated as EFI_SUCEESS. To address the checkpatch warning of too many leading tabs, combine two if statement into one. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
ce327084 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: carve out efi_get_next_variable_name_int calls To retrieve the EFI variable name by efi_get_next_variable_name_int(), the sequence of alloc -> efi_get_next_variable_name_int -> realloc -> efi_get_next_variable_name_int is required. In current code, this sequence repeatedly appears in the several functions. It should be curved out a common function. This commit also fixes the missing free() of var_name16 in eficonfig_delete_invalid_boot_option(). Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
140a8959 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use efi_get_next_variable_name_int() eficonfig command reads all possible UEFI load options from 0x0000 to 0xFFFF to construct the menu. This takes too much time in some environment. This commit uses efi_get_next_variable_name_int() to read all existing UEFI load options to significantlly reduce the count of efi_get_var() call. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
78b1ccc4 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use u16_strsize() to get u16 string buffer size Use u16_strsize() to simplify the u16 string buffer size calculation. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c67d3c9e |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix going one directory up issue The directory name in eficonfig menu entry contains the '\' separator. strcmp() argument ".." is wrong and one directory up handling does not work correctly. strcmp() argument must include '\' separator. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c3b5af63 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add UEFI Secure Boot Key enrollment interface This commit adds the menu-driven UEFI Secure Boot Key enrollment interface. User can enroll PK, KEK, db and dbx by selecting file. Only the signed EFI Signature List(s) with an authenticated header, typically '.auth' file, is accepted. To clear the PK, KEK, db and dbx, user needs to enroll the null key signed by PK or KEK. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
21faf4ef |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use protocol interface for file selection EFI_SIMPLE_FILE_SYSTEM_PROTOCOL is not always provided by U-Boot. Use protocol interface functions instead of U-Boot internal functions. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d6566113 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose eficonfig_create_device_path() Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use eficonfig_create_device_path() to construct the full device path from device path of the volume and file path, so move it out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d571f9b2 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation All the eficonfig menus other than "Change Boot Order" use 'eficonfig_entry' structure for each menu entry. This commit refactors change boot order implementation to use 'eficonfig_entry' structure same as other menus to have consistent menu handling. This commit also simplifies the data->active handling when KEY_SPACE is pressed, and sizeof() parameter. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
8961e93e |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose append entry function Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use append_entry() and append_quit_entry() to construct the menu, so move them out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
a84040ab |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor file selection handling eficonfig_select_file_handler() is commonly used to select the file. eficonfig_display_select_file_option() adds an additional menu to clear the selected file. eficonfig_display_select_file_option() is not always necessary for the file selection process, so it must be outside of eficonfig_select_file_handler(). This commit also renames the following functions to avoid confusion. eficonfig_select_file_handler() -> eficonfig_process_select_file() eficonfig_select_file() -> eficonfig_show_file_selection() eficonfig_display_select_file_option() -> eficonfig_process_show_file_option() Finally, test_eficonfig.py need to be updated to get aligned with the above modification. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
1167e88a |
|
14-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix missing variable initialization The 'ret' variable must be initialized before use in eficonfig_delete_invalid_boot_option(). Fixes: c416f1c0bc ("bootmenu: add removable media entries") Addresses-Coverity: 376207 ("Uninitialized variables") Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
3d595ac5 |
|
09-Nov-2022 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: remove superfluous if in eficonfig_edit_boot_option Goto for an immediately succeeding label is superfluous. Fixes: 87d791423ac6 ("eficonfig: menu-driven addition of UEFI boot option") Addresses-Coverity: 376202 ("Identical code for different branches") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
2c0b0c31 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_SECURE_BOOT This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_SECURE_BOOT defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
83f3d121 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_MM_COMM_TEE This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_MM_COMM_TEE defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
88df3634 |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: CTRL+S to save the boot order 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>
|
#
45f5319f |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
menu: remove CTRL+C to quit On the sandbox called without "--terminal raw" CTRL+C leaves U-Boot, "ESC/CTRL+C to quit" is misleading. Let's remove CTRL+C to quit key handling from bootmenu and eficonfig menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
|
#
8dbd0a0f |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add vertical scroll support The current eficonfig menu does not support vertical scroll, so it can not display the menu entries greater than the console row size. This commit add the vertial scroll support. The console size is retrieved by SIMPLE_TEXT_OUTPUT_PROTOCOL.QueryMode() service, then calculates the row size for menu entry by subtracting menu header and description row size from the console row size. "start" and "end" are added in the efimenu structure. "start" keeps the menu entry index at the top, "end" keeps the bottom menu entry index. item_data_print() menu function only draws the menu entry between "start" and "end". This commit also fixes the issue that "Save" and "Quit" entries can be moved by BKEY_PLUS in change boot order menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
0d590852 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation This commit removes the change boot order specific menu implementation. The change boot order implementation calls eficonfig_process_common() same as other menus. The change boot order menu requires own item_data_print and item_choice implementation, but display_statusline function can be a same function as other menus. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
cd160b27 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor eficonfig_process_common function Current change boot order implementation does not call eficonfig_process_common() and call own menu functions for display_statusline, item_data_print and item_choice. Change boot order functionality should call eficonfig_process_common() to improve maintenanceability. This commit is a preparation to remove the change boot order specific implementation. The menu functions (display_statusline, item_data_print and item_choice) are added as argument of eficonfig_process_common(). The menu description string displayed at the bottom of the menu is also added as argument. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
32bab0ea |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Make use of CLI character processing Avoid duplicating some of the escape-sequence processing here and use the CLI function instead. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
d0ca98db |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Update bootmenu_loop() to return the code Use the return value to save having to pass around a pointer. This also resolves any ambiguity about what *key contains when the function is called. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
2da4a15e |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Rename KEY_... to BKEY_... This enum values conflict with linux/input.h so rename them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
64550274 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: avoid SetVariable between GetNextVariableName calls The current code calls efi_set_variable_int() to delete the invalid boot option between calls to efi_get_next_variable_name_int(), it may produce unpredictable results. This commit moves removal of the invalid boot option outside of the efi_get_next_variable_name_int() calls. EFI_NOT_FOUND returned from efi_get_next_variable_name_int() indicates we retrieved all EFI variables, it should be treated as EFI_SUCEESS. To address the checkpatch warning of too many leading tabs, combine two if statement into one. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
ce327084 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: carve out efi_get_next_variable_name_int calls To retrieve the EFI variable name by efi_get_next_variable_name_int(), the sequence of alloc -> efi_get_next_variable_name_int -> realloc -> efi_get_next_variable_name_int is required. In current code, this sequence repeatedly appears in the several functions. It should be curved out a common function. This commit also fixes the missing free() of var_name16 in eficonfig_delete_invalid_boot_option(). Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
140a8959 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use efi_get_next_variable_name_int() eficonfig command reads all possible UEFI load options from 0x0000 to 0xFFFF to construct the menu. This takes too much time in some environment. This commit uses efi_get_next_variable_name_int() to read all existing UEFI load options to significantlly reduce the count of efi_get_var() call. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
78b1ccc4 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use u16_strsize() to get u16 string buffer size Use u16_strsize() to simplify the u16 string buffer size calculation. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c67d3c9e |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix going one directory up issue The directory name in eficonfig menu entry contains the '\' separator. strcmp() argument ".." is wrong and one directory up handling does not work correctly. strcmp() argument must include '\' separator. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c3b5af63 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add UEFI Secure Boot Key enrollment interface This commit adds the menu-driven UEFI Secure Boot Key enrollment interface. User can enroll PK, KEK, db and dbx by selecting file. Only the signed EFI Signature List(s) with an authenticated header, typically '.auth' file, is accepted. To clear the PK, KEK, db and dbx, user needs to enroll the null key signed by PK or KEK. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
21faf4ef |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use protocol interface for file selection EFI_SIMPLE_FILE_SYSTEM_PROTOCOL is not always provided by U-Boot. Use protocol interface functions instead of U-Boot internal functions. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d6566113 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose eficonfig_create_device_path() Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use eficonfig_create_device_path() to construct the full device path from device path of the volume and file path, so move it out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d571f9b2 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation All the eficonfig menus other than "Change Boot Order" use 'eficonfig_entry' structure for each menu entry. This commit refactors change boot order implementation to use 'eficonfig_entry' structure same as other menus to have consistent menu handling. This commit also simplifies the data->active handling when KEY_SPACE is pressed, and sizeof() parameter. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
8961e93e |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose append entry function Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use append_entry() and append_quit_entry() to construct the menu, so move them out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
a84040ab |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor file selection handling eficonfig_select_file_handler() is commonly used to select the file. eficonfig_display_select_file_option() adds an additional menu to clear the selected file. eficonfig_display_select_file_option() is not always necessary for the file selection process, so it must be outside of eficonfig_select_file_handler(). This commit also renames the following functions to avoid confusion. eficonfig_select_file_handler() -> eficonfig_process_select_file() eficonfig_select_file() -> eficonfig_show_file_selection() eficonfig_display_select_file_option() -> eficonfig_process_show_file_option() Finally, test_eficonfig.py need to be updated to get aligned with the above modification. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
1167e88a |
|
14-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix missing variable initialization The 'ret' variable must be initialized before use in eficonfig_delete_invalid_boot_option(). Fixes: c416f1c0bc ("bootmenu: add removable media entries") Addresses-Coverity: 376207 ("Uninitialized variables") Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
3d595ac5 |
|
09-Nov-2022 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: remove superfluous if in eficonfig_edit_boot_option Goto for an immediately succeeding label is superfluous. Fixes: 87d791423ac6 ("eficonfig: menu-driven addition of UEFI boot option") Addresses-Coverity: 376202 ("Identical code for different branches") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
2c0b0c31 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_SECURE_BOOT This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_SECURE_BOOT defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
83f3d121 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_MM_COMM_TEE This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_MM_COMM_TEE defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
88df3634 |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: CTRL+S to save the boot order 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>
|
#
45f5319f |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
menu: remove CTRL+C to quit On the sandbox called without "--terminal raw" CTRL+C leaves U-Boot, "ESC/CTRL+C to quit" is misleading. Let's remove CTRL+C to quit key handling from bootmenu and eficonfig menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
|
#
8dbd0a0f |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add vertical scroll support The current eficonfig menu does not support vertical scroll, so it can not display the menu entries greater than the console row size. This commit add the vertial scroll support. The console size is retrieved by SIMPLE_TEXT_OUTPUT_PROTOCOL.QueryMode() service, then calculates the row size for menu entry by subtracting menu header and description row size from the console row size. "start" and "end" are added in the efimenu structure. "start" keeps the menu entry index at the top, "end" keeps the bottom menu entry index. item_data_print() menu function only draws the menu entry between "start" and "end". This commit also fixes the issue that "Save" and "Quit" entries can be moved by BKEY_PLUS in change boot order menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
0d590852 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation This commit removes the change boot order specific menu implementation. The change boot order implementation calls eficonfig_process_common() same as other menus. The change boot order menu requires own item_data_print and item_choice implementation, but display_statusline function can be a same function as other menus. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
cd160b27 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor eficonfig_process_common function Current change boot order implementation does not call eficonfig_process_common() and call own menu functions for display_statusline, item_data_print and item_choice. Change boot order functionality should call eficonfig_process_common() to improve maintenanceability. This commit is a preparation to remove the change boot order specific implementation. The menu functions (display_statusline, item_data_print and item_choice) are added as argument of eficonfig_process_common(). The menu description string displayed at the bottom of the menu is also added as argument. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
32bab0ea |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Make use of CLI character processing Avoid duplicating some of the escape-sequence processing here and use the CLI function instead. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
d0ca98db |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Update bootmenu_loop() to return the code Use the return value to save having to pass around a pointer. This also resolves any ambiguity about what *key contains when the function is called. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
2da4a15e |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Rename KEY_... to BKEY_... This enum values conflict with linux/input.h so rename them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
64550274 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: avoid SetVariable between GetNextVariableName calls The current code calls efi_set_variable_int() to delete the invalid boot option between calls to efi_get_next_variable_name_int(), it may produce unpredictable results. This commit moves removal of the invalid boot option outside of the efi_get_next_variable_name_int() calls. EFI_NOT_FOUND returned from efi_get_next_variable_name_int() indicates we retrieved all EFI variables, it should be treated as EFI_SUCEESS. To address the checkpatch warning of too many leading tabs, combine two if statement into one. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
ce327084 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: carve out efi_get_next_variable_name_int calls To retrieve the EFI variable name by efi_get_next_variable_name_int(), the sequence of alloc -> efi_get_next_variable_name_int -> realloc -> efi_get_next_variable_name_int is required. In current code, this sequence repeatedly appears in the several functions. It should be curved out a common function. This commit also fixes the missing free() of var_name16 in eficonfig_delete_invalid_boot_option(). Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
140a8959 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use efi_get_next_variable_name_int() eficonfig command reads all possible UEFI load options from 0x0000 to 0xFFFF to construct the menu. This takes too much time in some environment. This commit uses efi_get_next_variable_name_int() to read all existing UEFI load options to significantlly reduce the count of efi_get_var() call. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
78b1ccc4 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use u16_strsize() to get u16 string buffer size Use u16_strsize() to simplify the u16 string buffer size calculation. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c67d3c9e |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix going one directory up issue The directory name in eficonfig menu entry contains the '\' separator. strcmp() argument ".." is wrong and one directory up handling does not work correctly. strcmp() argument must include '\' separator. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c3b5af63 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add UEFI Secure Boot Key enrollment interface This commit adds the menu-driven UEFI Secure Boot Key enrollment interface. User can enroll PK, KEK, db and dbx by selecting file. Only the signed EFI Signature List(s) with an authenticated header, typically '.auth' file, is accepted. To clear the PK, KEK, db and dbx, user needs to enroll the null key signed by PK or KEK. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
21faf4ef |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use protocol interface for file selection EFI_SIMPLE_FILE_SYSTEM_PROTOCOL is not always provided by U-Boot. Use protocol interface functions instead of U-Boot internal functions. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d6566113 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose eficonfig_create_device_path() Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use eficonfig_create_device_path() to construct the full device path from device path of the volume and file path, so move it out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d571f9b2 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation All the eficonfig menus other than "Change Boot Order" use 'eficonfig_entry' structure for each menu entry. This commit refactors change boot order implementation to use 'eficonfig_entry' structure same as other menus to have consistent menu handling. This commit also simplifies the data->active handling when KEY_SPACE is pressed, and sizeof() parameter. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
8961e93e |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose append entry function Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use append_entry() and append_quit_entry() to construct the menu, so move them out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
a84040ab |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor file selection handling eficonfig_select_file_handler() is commonly used to select the file. eficonfig_display_select_file_option() adds an additional menu to clear the selected file. eficonfig_display_select_file_option() is not always necessary for the file selection process, so it must be outside of eficonfig_select_file_handler(). This commit also renames the following functions to avoid confusion. eficonfig_select_file_handler() -> eficonfig_process_select_file() eficonfig_select_file() -> eficonfig_show_file_selection() eficonfig_display_select_file_option() -> eficonfig_process_show_file_option() Finally, test_eficonfig.py need to be updated to get aligned with the above modification. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
1167e88a |
|
14-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix missing variable initialization The 'ret' variable must be initialized before use in eficonfig_delete_invalid_boot_option(). Fixes: c416f1c0bc ("bootmenu: add removable media entries") Addresses-Coverity: 376207 ("Uninitialized variables") Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
3d595ac5 |
|
09-Nov-2022 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: remove superfluous if in eficonfig_edit_boot_option Goto for an immediately succeeding label is superfluous. Fixes: 87d791423ac6 ("eficonfig: menu-driven addition of UEFI boot option") Addresses-Coverity: 376202 ("Identical code for different branches") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
2c0b0c31 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_SECURE_BOOT This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_SECURE_BOOT defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
83f3d121 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_MM_COMM_TEE This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_MM_COMM_TEE defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
88df3634 |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: CTRL+S to save the boot order 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>
|
#
45f5319f |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
menu: remove CTRL+C to quit On the sandbox called without "--terminal raw" CTRL+C leaves U-Boot, "ESC/CTRL+C to quit" is misleading. Let's remove CTRL+C to quit key handling from bootmenu and eficonfig menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
|
#
8dbd0a0f |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add vertical scroll support The current eficonfig menu does not support vertical scroll, so it can not display the menu entries greater than the console row size. This commit add the vertial scroll support. The console size is retrieved by SIMPLE_TEXT_OUTPUT_PROTOCOL.QueryMode() service, then calculates the row size for menu entry by subtracting menu header and description row size from the console row size. "start" and "end" are added in the efimenu structure. "start" keeps the menu entry index at the top, "end" keeps the bottom menu entry index. item_data_print() menu function only draws the menu entry between "start" and "end". This commit also fixes the issue that "Save" and "Quit" entries can be moved by BKEY_PLUS in change boot order menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
0d590852 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation This commit removes the change boot order specific menu implementation. The change boot order implementation calls eficonfig_process_common() same as other menus. The change boot order menu requires own item_data_print and item_choice implementation, but display_statusline function can be a same function as other menus. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
cd160b27 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor eficonfig_process_common function Current change boot order implementation does not call eficonfig_process_common() and call own menu functions for display_statusline, item_data_print and item_choice. Change boot order functionality should call eficonfig_process_common() to improve maintenanceability. This commit is a preparation to remove the change boot order specific implementation. The menu functions (display_statusline, item_data_print and item_choice) are added as argument of eficonfig_process_common(). The menu description string displayed at the bottom of the menu is also added as argument. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
32bab0ea |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Make use of CLI character processing Avoid duplicating some of the escape-sequence processing here and use the CLI function instead. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
d0ca98db |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Update bootmenu_loop() to return the code Use the return value to save having to pass around a pointer. This also resolves any ambiguity about what *key contains when the function is called. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
2da4a15e |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Rename KEY_... to BKEY_... This enum values conflict with linux/input.h so rename them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
64550274 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: avoid SetVariable between GetNextVariableName calls The current code calls efi_set_variable_int() to delete the invalid boot option between calls to efi_get_next_variable_name_int(), it may produce unpredictable results. This commit moves removal of the invalid boot option outside of the efi_get_next_variable_name_int() calls. EFI_NOT_FOUND returned from efi_get_next_variable_name_int() indicates we retrieved all EFI variables, it should be treated as EFI_SUCEESS. To address the checkpatch warning of too many leading tabs, combine two if statement into one. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
ce327084 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: carve out efi_get_next_variable_name_int calls To retrieve the EFI variable name by efi_get_next_variable_name_int(), the sequence of alloc -> efi_get_next_variable_name_int -> realloc -> efi_get_next_variable_name_int is required. In current code, this sequence repeatedly appears in the several functions. It should be curved out a common function. This commit also fixes the missing free() of var_name16 in eficonfig_delete_invalid_boot_option(). Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
140a8959 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use efi_get_next_variable_name_int() eficonfig command reads all possible UEFI load options from 0x0000 to 0xFFFF to construct the menu. This takes too much time in some environment. This commit uses efi_get_next_variable_name_int() to read all existing UEFI load options to significantlly reduce the count of efi_get_var() call. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
78b1ccc4 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use u16_strsize() to get u16 string buffer size Use u16_strsize() to simplify the u16 string buffer size calculation. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c67d3c9e |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix going one directory up issue The directory name in eficonfig menu entry contains the '\' separator. strcmp() argument ".." is wrong and one directory up handling does not work correctly. strcmp() argument must include '\' separator. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c3b5af63 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add UEFI Secure Boot Key enrollment interface This commit adds the menu-driven UEFI Secure Boot Key enrollment interface. User can enroll PK, KEK, db and dbx by selecting file. Only the signed EFI Signature List(s) with an authenticated header, typically '.auth' file, is accepted. To clear the PK, KEK, db and dbx, user needs to enroll the null key signed by PK or KEK. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
21faf4ef |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use protocol interface for file selection EFI_SIMPLE_FILE_SYSTEM_PROTOCOL is not always provided by U-Boot. Use protocol interface functions instead of U-Boot internal functions. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d6566113 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose eficonfig_create_device_path() Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use eficonfig_create_device_path() to construct the full device path from device path of the volume and file path, so move it out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d571f9b2 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation All the eficonfig menus other than "Change Boot Order" use 'eficonfig_entry' structure for each menu entry. This commit refactors change boot order implementation to use 'eficonfig_entry' structure same as other menus to have consistent menu handling. This commit also simplifies the data->active handling when KEY_SPACE is pressed, and sizeof() parameter. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
8961e93e |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose append entry function Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use append_entry() and append_quit_entry() to construct the menu, so move them out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
a84040ab |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor file selection handling eficonfig_select_file_handler() is commonly used to select the file. eficonfig_display_select_file_option() adds an additional menu to clear the selected file. eficonfig_display_select_file_option() is not always necessary for the file selection process, so it must be outside of eficonfig_select_file_handler(). This commit also renames the following functions to avoid confusion. eficonfig_select_file_handler() -> eficonfig_process_select_file() eficonfig_select_file() -> eficonfig_show_file_selection() eficonfig_display_select_file_option() -> eficonfig_process_show_file_option() Finally, test_eficonfig.py need to be updated to get aligned with the above modification. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
1167e88a |
|
14-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix missing variable initialization The 'ret' variable must be initialized before use in eficonfig_delete_invalid_boot_option(). Fixes: c416f1c0bc ("bootmenu: add removable media entries") Addresses-Coverity: 376207 ("Uninitialized variables") Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
3d595ac5 |
|
09-Nov-2022 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: remove superfluous if in eficonfig_edit_boot_option Goto for an immediately succeeding label is superfluous. Fixes: 87d791423ac6 ("eficonfig: menu-driven addition of UEFI boot option") Addresses-Coverity: 376202 ("Identical code for different branches") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
2c0b0c31 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_SECURE_BOOT This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_SECURE_BOOT defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
83f3d121 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_MM_COMM_TEE This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_MM_COMM_TEE defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
88df3634 |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: CTRL+S to save the boot order 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>
|
#
45f5319f |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
menu: remove CTRL+C to quit On the sandbox called without "--terminal raw" CTRL+C leaves U-Boot, "ESC/CTRL+C to quit" is misleading. Let's remove CTRL+C to quit key handling from bootmenu and eficonfig menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
|
#
8dbd0a0f |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add vertical scroll support The current eficonfig menu does not support vertical scroll, so it can not display the menu entries greater than the console row size. This commit add the vertial scroll support. The console size is retrieved by SIMPLE_TEXT_OUTPUT_PROTOCOL.QueryMode() service, then calculates the row size for menu entry by subtracting menu header and description row size from the console row size. "start" and "end" are added in the efimenu structure. "start" keeps the menu entry index at the top, "end" keeps the bottom menu entry index. item_data_print() menu function only draws the menu entry between "start" and "end". This commit also fixes the issue that "Save" and "Quit" entries can be moved by BKEY_PLUS in change boot order menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
0d590852 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation This commit removes the change boot order specific menu implementation. The change boot order implementation calls eficonfig_process_common() same as other menus. The change boot order menu requires own item_data_print and item_choice implementation, but display_statusline function can be a same function as other menus. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
cd160b27 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor eficonfig_process_common function Current change boot order implementation does not call eficonfig_process_common() and call own menu functions for display_statusline, item_data_print and item_choice. Change boot order functionality should call eficonfig_process_common() to improve maintenanceability. This commit is a preparation to remove the change boot order specific implementation. The menu functions (display_statusline, item_data_print and item_choice) are added as argument of eficonfig_process_common(). The menu description string displayed at the bottom of the menu is also added as argument. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
32bab0ea |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Make use of CLI character processing Avoid duplicating some of the escape-sequence processing here and use the CLI function instead. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
d0ca98db |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Update bootmenu_loop() to return the code Use the return value to save having to pass around a pointer. This also resolves any ambiguity about what *key contains when the function is called. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
2da4a15e |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Rename KEY_... to BKEY_... This enum values conflict with linux/input.h so rename them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
64550274 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: avoid SetVariable between GetNextVariableName calls The current code calls efi_set_variable_int() to delete the invalid boot option between calls to efi_get_next_variable_name_int(), it may produce unpredictable results. This commit moves removal of the invalid boot option outside of the efi_get_next_variable_name_int() calls. EFI_NOT_FOUND returned from efi_get_next_variable_name_int() indicates we retrieved all EFI variables, it should be treated as EFI_SUCEESS. To address the checkpatch warning of too many leading tabs, combine two if statement into one. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
ce327084 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: carve out efi_get_next_variable_name_int calls To retrieve the EFI variable name by efi_get_next_variable_name_int(), the sequence of alloc -> efi_get_next_variable_name_int -> realloc -> efi_get_next_variable_name_int is required. In current code, this sequence repeatedly appears in the several functions. It should be curved out a common function. This commit also fixes the missing free() of var_name16 in eficonfig_delete_invalid_boot_option(). Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
140a8959 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use efi_get_next_variable_name_int() eficonfig command reads all possible UEFI load options from 0x0000 to 0xFFFF to construct the menu. This takes too much time in some environment. This commit uses efi_get_next_variable_name_int() to read all existing UEFI load options to significantlly reduce the count of efi_get_var() call. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
78b1ccc4 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use u16_strsize() to get u16 string buffer size Use u16_strsize() to simplify the u16 string buffer size calculation. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c67d3c9e |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix going one directory up issue The directory name in eficonfig menu entry contains the '\' separator. strcmp() argument ".." is wrong and one directory up handling does not work correctly. strcmp() argument must include '\' separator. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c3b5af63 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add UEFI Secure Boot Key enrollment interface This commit adds the menu-driven UEFI Secure Boot Key enrollment interface. User can enroll PK, KEK, db and dbx by selecting file. Only the signed EFI Signature List(s) with an authenticated header, typically '.auth' file, is accepted. To clear the PK, KEK, db and dbx, user needs to enroll the null key signed by PK or KEK. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
21faf4ef |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use protocol interface for file selection EFI_SIMPLE_FILE_SYSTEM_PROTOCOL is not always provided by U-Boot. Use protocol interface functions instead of U-Boot internal functions. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d6566113 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose eficonfig_create_device_path() Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use eficonfig_create_device_path() to construct the full device path from device path of the volume and file path, so move it out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d571f9b2 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation All the eficonfig menus other than "Change Boot Order" use 'eficonfig_entry' structure for each menu entry. This commit refactors change boot order implementation to use 'eficonfig_entry' structure same as other menus to have consistent menu handling. This commit also simplifies the data->active handling when KEY_SPACE is pressed, and sizeof() parameter. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
8961e93e |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose append entry function Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use append_entry() and append_quit_entry() to construct the menu, so move them out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
a84040ab |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor file selection handling eficonfig_select_file_handler() is commonly used to select the file. eficonfig_display_select_file_option() adds an additional menu to clear the selected file. eficonfig_display_select_file_option() is not always necessary for the file selection process, so it must be outside of eficonfig_select_file_handler(). This commit also renames the following functions to avoid confusion. eficonfig_select_file_handler() -> eficonfig_process_select_file() eficonfig_select_file() -> eficonfig_show_file_selection() eficonfig_display_select_file_option() -> eficonfig_process_show_file_option() Finally, test_eficonfig.py need to be updated to get aligned with the above modification. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
1167e88a |
|
14-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix missing variable initialization The 'ret' variable must be initialized before use in eficonfig_delete_invalid_boot_option(). Fixes: c416f1c0bc ("bootmenu: add removable media entries") Addresses-Coverity: 376207 ("Uninitialized variables") Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
3d595ac5 |
|
09-Nov-2022 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: remove superfluous if in eficonfig_edit_boot_option Goto for an immediately succeeding label is superfluous. Fixes: 87d791423ac6 ("eficonfig: menu-driven addition of UEFI boot option") Addresses-Coverity: 376202 ("Identical code for different branches") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
2c0b0c31 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_SECURE_BOOT This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_SECURE_BOOT defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
83f3d121 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_MM_COMM_TEE This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_MM_COMM_TEE defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
88df3634 |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: CTRL+S to save the boot order 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>
|
#
45f5319f |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
menu: remove CTRL+C to quit On the sandbox called without "--terminal raw" CTRL+C leaves U-Boot, "ESC/CTRL+C to quit" is misleading. Let's remove CTRL+C to quit key handling from bootmenu and eficonfig menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
|
#
8dbd0a0f |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add vertical scroll support The current eficonfig menu does not support vertical scroll, so it can not display the menu entries greater than the console row size. This commit add the vertial scroll support. The console size is retrieved by SIMPLE_TEXT_OUTPUT_PROTOCOL.QueryMode() service, then calculates the row size for menu entry by subtracting menu header and description row size from the console row size. "start" and "end" are added in the efimenu structure. "start" keeps the menu entry index at the top, "end" keeps the bottom menu entry index. item_data_print() menu function only draws the menu entry between "start" and "end". This commit also fixes the issue that "Save" and "Quit" entries can be moved by BKEY_PLUS in change boot order menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
0d590852 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation This commit removes the change boot order specific menu implementation. The change boot order implementation calls eficonfig_process_common() same as other menus. The change boot order menu requires own item_data_print and item_choice implementation, but display_statusline function can be a same function as other menus. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
cd160b27 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor eficonfig_process_common function Current change boot order implementation does not call eficonfig_process_common() and call own menu functions for display_statusline, item_data_print and item_choice. Change boot order functionality should call eficonfig_process_common() to improve maintenanceability. This commit is a preparation to remove the change boot order specific implementation. The menu functions (display_statusline, item_data_print and item_choice) are added as argument of eficonfig_process_common(). The menu description string displayed at the bottom of the menu is also added as argument. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
32bab0ea |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Make use of CLI character processing Avoid duplicating some of the escape-sequence processing here and use the CLI function instead. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
d0ca98db |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Update bootmenu_loop() to return the code Use the return value to save having to pass around a pointer. This also resolves any ambiguity about what *key contains when the function is called. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
2da4a15e |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Rename KEY_... to BKEY_... This enum values conflict with linux/input.h so rename them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
64550274 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: avoid SetVariable between GetNextVariableName calls The current code calls efi_set_variable_int() to delete the invalid boot option between calls to efi_get_next_variable_name_int(), it may produce unpredictable results. This commit moves removal of the invalid boot option outside of the efi_get_next_variable_name_int() calls. EFI_NOT_FOUND returned from efi_get_next_variable_name_int() indicates we retrieved all EFI variables, it should be treated as EFI_SUCEESS. To address the checkpatch warning of too many leading tabs, combine two if statement into one. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
ce327084 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: carve out efi_get_next_variable_name_int calls To retrieve the EFI variable name by efi_get_next_variable_name_int(), the sequence of alloc -> efi_get_next_variable_name_int -> realloc -> efi_get_next_variable_name_int is required. In current code, this sequence repeatedly appears in the several functions. It should be curved out a common function. This commit also fixes the missing free() of var_name16 in eficonfig_delete_invalid_boot_option(). Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
140a8959 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use efi_get_next_variable_name_int() eficonfig command reads all possible UEFI load options from 0x0000 to 0xFFFF to construct the menu. This takes too much time in some environment. This commit uses efi_get_next_variable_name_int() to read all existing UEFI load options to significantlly reduce the count of efi_get_var() call. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
78b1ccc4 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use u16_strsize() to get u16 string buffer size Use u16_strsize() to simplify the u16 string buffer size calculation. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c67d3c9e |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix going one directory up issue The directory name in eficonfig menu entry contains the '\' separator. strcmp() argument ".." is wrong and one directory up handling does not work correctly. strcmp() argument must include '\' separator. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c3b5af63 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add UEFI Secure Boot Key enrollment interface This commit adds the menu-driven UEFI Secure Boot Key enrollment interface. User can enroll PK, KEK, db and dbx by selecting file. Only the signed EFI Signature List(s) with an authenticated header, typically '.auth' file, is accepted. To clear the PK, KEK, db and dbx, user needs to enroll the null key signed by PK or KEK. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
21faf4ef |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use protocol interface for file selection EFI_SIMPLE_FILE_SYSTEM_PROTOCOL is not always provided by U-Boot. Use protocol interface functions instead of U-Boot internal functions. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d6566113 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose eficonfig_create_device_path() Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use eficonfig_create_device_path() to construct the full device path from device path of the volume and file path, so move it out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d571f9b2 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation All the eficonfig menus other than "Change Boot Order" use 'eficonfig_entry' structure for each menu entry. This commit refactors change boot order implementation to use 'eficonfig_entry' structure same as other menus to have consistent menu handling. This commit also simplifies the data->active handling when KEY_SPACE is pressed, and sizeof() parameter. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
8961e93e |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose append entry function Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use append_entry() and append_quit_entry() to construct the menu, so move them out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
a84040ab |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor file selection handling eficonfig_select_file_handler() is commonly used to select the file. eficonfig_display_select_file_option() adds an additional menu to clear the selected file. eficonfig_display_select_file_option() is not always necessary for the file selection process, so it must be outside of eficonfig_select_file_handler(). This commit also renames the following functions to avoid confusion. eficonfig_select_file_handler() -> eficonfig_process_select_file() eficonfig_select_file() -> eficonfig_show_file_selection() eficonfig_display_select_file_option() -> eficonfig_process_show_file_option() Finally, test_eficonfig.py need to be updated to get aligned with the above modification. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
1167e88a |
|
14-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix missing variable initialization The 'ret' variable must be initialized before use in eficonfig_delete_invalid_boot_option(). Fixes: c416f1c0bc ("bootmenu: add removable media entries") Addresses-Coverity: 376207 ("Uninitialized variables") Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
3d595ac5 |
|
09-Nov-2022 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: remove superfluous if in eficonfig_edit_boot_option Goto for an immediately succeeding label is superfluous. Fixes: 87d791423ac6 ("eficonfig: menu-driven addition of UEFI boot option") Addresses-Coverity: 376202 ("Identical code for different branches") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
2c0b0c31 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_SECURE_BOOT This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_SECURE_BOOT defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
83f3d121 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_MM_COMM_TEE This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_MM_COMM_TEE defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
88df3634 |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: CTRL+S to save the boot order 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>
|
#
45f5319f |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
menu: remove CTRL+C to quit On the sandbox called without "--terminal raw" CTRL+C leaves U-Boot, "ESC/CTRL+C to quit" is misleading. Let's remove CTRL+C to quit key handling from bootmenu and eficonfig menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
|
#
8dbd0a0f |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add vertical scroll support The current eficonfig menu does not support vertical scroll, so it can not display the menu entries greater than the console row size. This commit add the vertial scroll support. The console size is retrieved by SIMPLE_TEXT_OUTPUT_PROTOCOL.QueryMode() service, then calculates the row size for menu entry by subtracting menu header and description row size from the console row size. "start" and "end" are added in the efimenu structure. "start" keeps the menu entry index at the top, "end" keeps the bottom menu entry index. item_data_print() menu function only draws the menu entry between "start" and "end". This commit also fixes the issue that "Save" and "Quit" entries can be moved by BKEY_PLUS in change boot order menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
0d590852 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation This commit removes the change boot order specific menu implementation. The change boot order implementation calls eficonfig_process_common() same as other menus. The change boot order menu requires own item_data_print and item_choice implementation, but display_statusline function can be a same function as other menus. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
cd160b27 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor eficonfig_process_common function Current change boot order implementation does not call eficonfig_process_common() and call own menu functions for display_statusline, item_data_print and item_choice. Change boot order functionality should call eficonfig_process_common() to improve maintenanceability. This commit is a preparation to remove the change boot order specific implementation. The menu functions (display_statusline, item_data_print and item_choice) are added as argument of eficonfig_process_common(). The menu description string displayed at the bottom of the menu is also added as argument. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
32bab0ea |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Make use of CLI character processing Avoid duplicating some of the escape-sequence processing here and use the CLI function instead. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
d0ca98db |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Update bootmenu_loop() to return the code Use the return value to save having to pass around a pointer. This also resolves any ambiguity about what *key contains when the function is called. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
2da4a15e |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Rename KEY_... to BKEY_... This enum values conflict with linux/input.h so rename them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
64550274 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: avoid SetVariable between GetNextVariableName calls The current code calls efi_set_variable_int() to delete the invalid boot option between calls to efi_get_next_variable_name_int(), it may produce unpredictable results. This commit moves removal of the invalid boot option outside of the efi_get_next_variable_name_int() calls. EFI_NOT_FOUND returned from efi_get_next_variable_name_int() indicates we retrieved all EFI variables, it should be treated as EFI_SUCEESS. To address the checkpatch warning of too many leading tabs, combine two if statement into one. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
ce327084 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: carve out efi_get_next_variable_name_int calls To retrieve the EFI variable name by efi_get_next_variable_name_int(), the sequence of alloc -> efi_get_next_variable_name_int -> realloc -> efi_get_next_variable_name_int is required. In current code, this sequence repeatedly appears in the several functions. It should be curved out a common function. This commit also fixes the missing free() of var_name16 in eficonfig_delete_invalid_boot_option(). Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
140a8959 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use efi_get_next_variable_name_int() eficonfig command reads all possible UEFI load options from 0x0000 to 0xFFFF to construct the menu. This takes too much time in some environment. This commit uses efi_get_next_variable_name_int() to read all existing UEFI load options to significantlly reduce the count of efi_get_var() call. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
78b1ccc4 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use u16_strsize() to get u16 string buffer size Use u16_strsize() to simplify the u16 string buffer size calculation. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c67d3c9e |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix going one directory up issue The directory name in eficonfig menu entry contains the '\' separator. strcmp() argument ".." is wrong and one directory up handling does not work correctly. strcmp() argument must include '\' separator. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c3b5af63 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add UEFI Secure Boot Key enrollment interface This commit adds the menu-driven UEFI Secure Boot Key enrollment interface. User can enroll PK, KEK, db and dbx by selecting file. Only the signed EFI Signature List(s) with an authenticated header, typically '.auth' file, is accepted. To clear the PK, KEK, db and dbx, user needs to enroll the null key signed by PK or KEK. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
21faf4ef |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use protocol interface for file selection EFI_SIMPLE_FILE_SYSTEM_PROTOCOL is not always provided by U-Boot. Use protocol interface functions instead of U-Boot internal functions. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d6566113 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose eficonfig_create_device_path() Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use eficonfig_create_device_path() to construct the full device path from device path of the volume and file path, so move it out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d571f9b2 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation All the eficonfig menus other than "Change Boot Order" use 'eficonfig_entry' structure for each menu entry. This commit refactors change boot order implementation to use 'eficonfig_entry' structure same as other menus to have consistent menu handling. This commit also simplifies the data->active handling when KEY_SPACE is pressed, and sizeof() parameter. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
8961e93e |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose append entry function Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use append_entry() and append_quit_entry() to construct the menu, so move them out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
a84040ab |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor file selection handling eficonfig_select_file_handler() is commonly used to select the file. eficonfig_display_select_file_option() adds an additional menu to clear the selected file. eficonfig_display_select_file_option() is not always necessary for the file selection process, so it must be outside of eficonfig_select_file_handler(). This commit also renames the following functions to avoid confusion. eficonfig_select_file_handler() -> eficonfig_process_select_file() eficonfig_select_file() -> eficonfig_show_file_selection() eficonfig_display_select_file_option() -> eficonfig_process_show_file_option() Finally, test_eficonfig.py need to be updated to get aligned with the above modification. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
1167e88a |
|
14-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix missing variable initialization The 'ret' variable must be initialized before use in eficonfig_delete_invalid_boot_option(). Fixes: c416f1c0bc ("bootmenu: add removable media entries") Addresses-Coverity: 376207 ("Uninitialized variables") Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
3d595ac5 |
|
09-Nov-2022 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: remove superfluous if in eficonfig_edit_boot_option Goto for an immediately succeeding label is superfluous. Fixes: 87d791423ac6 ("eficonfig: menu-driven addition of UEFI boot option") Addresses-Coverity: 376202 ("Identical code for different branches") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
2c0b0c31 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_SECURE_BOOT This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_SECURE_BOOT defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
83f3d121 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_MM_COMM_TEE This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_MM_COMM_TEE defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
88df3634 |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: CTRL+S to save the boot order 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>
|
#
45f5319f |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
menu: remove CTRL+C to quit On the sandbox called without "--terminal raw" CTRL+C leaves U-Boot, "ESC/CTRL+C to quit" is misleading. Let's remove CTRL+C to quit key handling from bootmenu and eficonfig menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
|
#
8dbd0a0f |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add vertical scroll support The current eficonfig menu does not support vertical scroll, so it can not display the menu entries greater than the console row size. This commit add the vertial scroll support. The console size is retrieved by SIMPLE_TEXT_OUTPUT_PROTOCOL.QueryMode() service, then calculates the row size for menu entry by subtracting menu header and description row size from the console row size. "start" and "end" are added in the efimenu structure. "start" keeps the menu entry index at the top, "end" keeps the bottom menu entry index. item_data_print() menu function only draws the menu entry between "start" and "end". This commit also fixes the issue that "Save" and "Quit" entries can be moved by BKEY_PLUS in change boot order menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
0d590852 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation This commit removes the change boot order specific menu implementation. The change boot order implementation calls eficonfig_process_common() same as other menus. The change boot order menu requires own item_data_print and item_choice implementation, but display_statusline function can be a same function as other menus. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
cd160b27 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor eficonfig_process_common function Current change boot order implementation does not call eficonfig_process_common() and call own menu functions for display_statusline, item_data_print and item_choice. Change boot order functionality should call eficonfig_process_common() to improve maintenanceability. This commit is a preparation to remove the change boot order specific implementation. The menu functions (display_statusline, item_data_print and item_choice) are added as argument of eficonfig_process_common(). The menu description string displayed at the bottom of the menu is also added as argument. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
32bab0ea |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Make use of CLI character processing Avoid duplicating some of the escape-sequence processing here and use the CLI function instead. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
d0ca98db |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Update bootmenu_loop() to return the code Use the return value to save having to pass around a pointer. This also resolves any ambiguity about what *key contains when the function is called. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
2da4a15e |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Rename KEY_... to BKEY_... This enum values conflict with linux/input.h so rename them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
64550274 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: avoid SetVariable between GetNextVariableName calls The current code calls efi_set_variable_int() to delete the invalid boot option between calls to efi_get_next_variable_name_int(), it may produce unpredictable results. This commit moves removal of the invalid boot option outside of the efi_get_next_variable_name_int() calls. EFI_NOT_FOUND returned from efi_get_next_variable_name_int() indicates we retrieved all EFI variables, it should be treated as EFI_SUCEESS. To address the checkpatch warning of too many leading tabs, combine two if statement into one. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
ce327084 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: carve out efi_get_next_variable_name_int calls To retrieve the EFI variable name by efi_get_next_variable_name_int(), the sequence of alloc -> efi_get_next_variable_name_int -> realloc -> efi_get_next_variable_name_int is required. In current code, this sequence repeatedly appears in the several functions. It should be curved out a common function. This commit also fixes the missing free() of var_name16 in eficonfig_delete_invalid_boot_option(). Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
140a8959 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use efi_get_next_variable_name_int() eficonfig command reads all possible UEFI load options from 0x0000 to 0xFFFF to construct the menu. This takes too much time in some environment. This commit uses efi_get_next_variable_name_int() to read all existing UEFI load options to significantlly reduce the count of efi_get_var() call. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
78b1ccc4 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use u16_strsize() to get u16 string buffer size Use u16_strsize() to simplify the u16 string buffer size calculation. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c67d3c9e |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix going one directory up issue The directory name in eficonfig menu entry contains the '\' separator. strcmp() argument ".." is wrong and one directory up handling does not work correctly. strcmp() argument must include '\' separator. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c3b5af63 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add UEFI Secure Boot Key enrollment interface This commit adds the menu-driven UEFI Secure Boot Key enrollment interface. User can enroll PK, KEK, db and dbx by selecting file. Only the signed EFI Signature List(s) with an authenticated header, typically '.auth' file, is accepted. To clear the PK, KEK, db and dbx, user needs to enroll the null key signed by PK or KEK. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
21faf4ef |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use protocol interface for file selection EFI_SIMPLE_FILE_SYSTEM_PROTOCOL is not always provided by U-Boot. Use protocol interface functions instead of U-Boot internal functions. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d6566113 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose eficonfig_create_device_path() Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use eficonfig_create_device_path() to construct the full device path from device path of the volume and file path, so move it out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d571f9b2 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation All the eficonfig menus other than "Change Boot Order" use 'eficonfig_entry' structure for each menu entry. This commit refactors change boot order implementation to use 'eficonfig_entry' structure same as other menus to have consistent menu handling. This commit also simplifies the data->active handling when KEY_SPACE is pressed, and sizeof() parameter. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
8961e93e |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose append entry function Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use append_entry() and append_quit_entry() to construct the menu, so move them out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
a84040ab |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor file selection handling eficonfig_select_file_handler() is commonly used to select the file. eficonfig_display_select_file_option() adds an additional menu to clear the selected file. eficonfig_display_select_file_option() is not always necessary for the file selection process, so it must be outside of eficonfig_select_file_handler(). This commit also renames the following functions to avoid confusion. eficonfig_select_file_handler() -> eficonfig_process_select_file() eficonfig_select_file() -> eficonfig_show_file_selection() eficonfig_display_select_file_option() -> eficonfig_process_show_file_option() Finally, test_eficonfig.py need to be updated to get aligned with the above modification. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
1167e88a |
|
14-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix missing variable initialization The 'ret' variable must be initialized before use in eficonfig_delete_invalid_boot_option(). Fixes: c416f1c0bc ("bootmenu: add removable media entries") Addresses-Coverity: 376207 ("Uninitialized variables") Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
3d595ac5 |
|
09-Nov-2022 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: remove superfluous if in eficonfig_edit_boot_option Goto for an immediately succeeding label is superfluous. Fixes: 87d791423ac6 ("eficonfig: menu-driven addition of UEFI boot option") Addresses-Coverity: 376202 ("Identical code for different branches") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
2c0b0c31 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_SECURE_BOOT This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_SECURE_BOOT defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
83f3d121 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_MM_COMM_TEE This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_MM_COMM_TEE defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
88df3634 |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: CTRL+S to save the boot order 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>
|
#
45f5319f |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
menu: remove CTRL+C to quit On the sandbox called without "--terminal raw" CTRL+C leaves U-Boot, "ESC/CTRL+C to quit" is misleading. Let's remove CTRL+C to quit key handling from bootmenu and eficonfig menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
|
#
8dbd0a0f |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add vertical scroll support The current eficonfig menu does not support vertical scroll, so it can not display the menu entries greater than the console row size. This commit add the vertial scroll support. The console size is retrieved by SIMPLE_TEXT_OUTPUT_PROTOCOL.QueryMode() service, then calculates the row size for menu entry by subtracting menu header and description row size from the console row size. "start" and "end" are added in the efimenu structure. "start" keeps the menu entry index at the top, "end" keeps the bottom menu entry index. item_data_print() menu function only draws the menu entry between "start" and "end". This commit also fixes the issue that "Save" and "Quit" entries can be moved by BKEY_PLUS in change boot order menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
0d590852 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation This commit removes the change boot order specific menu implementation. The change boot order implementation calls eficonfig_process_common() same as other menus. The change boot order menu requires own item_data_print and item_choice implementation, but display_statusline function can be a same function as other menus. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
cd160b27 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor eficonfig_process_common function Current change boot order implementation does not call eficonfig_process_common() and call own menu functions for display_statusline, item_data_print and item_choice. Change boot order functionality should call eficonfig_process_common() to improve maintenanceability. This commit is a preparation to remove the change boot order specific implementation. The menu functions (display_statusline, item_data_print and item_choice) are added as argument of eficonfig_process_common(). The menu description string displayed at the bottom of the menu is also added as argument. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
32bab0ea |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Make use of CLI character processing Avoid duplicating some of the escape-sequence processing here and use the CLI function instead. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
d0ca98db |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Update bootmenu_loop() to return the code Use the return value to save having to pass around a pointer. This also resolves any ambiguity about what *key contains when the function is called. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
2da4a15e |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Rename KEY_... to BKEY_... This enum values conflict with linux/input.h so rename them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
64550274 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: avoid SetVariable between GetNextVariableName calls The current code calls efi_set_variable_int() to delete the invalid boot option between calls to efi_get_next_variable_name_int(), it may produce unpredictable results. This commit moves removal of the invalid boot option outside of the efi_get_next_variable_name_int() calls. EFI_NOT_FOUND returned from efi_get_next_variable_name_int() indicates we retrieved all EFI variables, it should be treated as EFI_SUCEESS. To address the checkpatch warning of too many leading tabs, combine two if statement into one. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
ce327084 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: carve out efi_get_next_variable_name_int calls To retrieve the EFI variable name by efi_get_next_variable_name_int(), the sequence of alloc -> efi_get_next_variable_name_int -> realloc -> efi_get_next_variable_name_int is required. In current code, this sequence repeatedly appears in the several functions. It should be curved out a common function. This commit also fixes the missing free() of var_name16 in eficonfig_delete_invalid_boot_option(). Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
140a8959 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use efi_get_next_variable_name_int() eficonfig command reads all possible UEFI load options from 0x0000 to 0xFFFF to construct the menu. This takes too much time in some environment. This commit uses efi_get_next_variable_name_int() to read all existing UEFI load options to significantlly reduce the count of efi_get_var() call. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
78b1ccc4 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use u16_strsize() to get u16 string buffer size Use u16_strsize() to simplify the u16 string buffer size calculation. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c67d3c9e |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix going one directory up issue The directory name in eficonfig menu entry contains the '\' separator. strcmp() argument ".." is wrong and one directory up handling does not work correctly. strcmp() argument must include '\' separator. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c3b5af63 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add UEFI Secure Boot Key enrollment interface This commit adds the menu-driven UEFI Secure Boot Key enrollment interface. User can enroll PK, KEK, db and dbx by selecting file. Only the signed EFI Signature List(s) with an authenticated header, typically '.auth' file, is accepted. To clear the PK, KEK, db and dbx, user needs to enroll the null key signed by PK or KEK. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
21faf4ef |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use protocol interface for file selection EFI_SIMPLE_FILE_SYSTEM_PROTOCOL is not always provided by U-Boot. Use protocol interface functions instead of U-Boot internal functions. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d6566113 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose eficonfig_create_device_path() Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use eficonfig_create_device_path() to construct the full device path from device path of the volume and file path, so move it out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d571f9b2 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation All the eficonfig menus other than "Change Boot Order" use 'eficonfig_entry' structure for each menu entry. This commit refactors change boot order implementation to use 'eficonfig_entry' structure same as other menus to have consistent menu handling. This commit also simplifies the data->active handling when KEY_SPACE is pressed, and sizeof() parameter. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
8961e93e |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose append entry function Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use append_entry() and append_quit_entry() to construct the menu, so move them out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
a84040ab |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor file selection handling eficonfig_select_file_handler() is commonly used to select the file. eficonfig_display_select_file_option() adds an additional menu to clear the selected file. eficonfig_display_select_file_option() is not always necessary for the file selection process, so it must be outside of eficonfig_select_file_handler(). This commit also renames the following functions to avoid confusion. eficonfig_select_file_handler() -> eficonfig_process_select_file() eficonfig_select_file() -> eficonfig_show_file_selection() eficonfig_display_select_file_option() -> eficonfig_process_show_file_option() Finally, test_eficonfig.py need to be updated to get aligned with the above modification. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
1167e88a |
|
14-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix missing variable initialization The 'ret' variable must be initialized before use in eficonfig_delete_invalid_boot_option(). Fixes: c416f1c0bc ("bootmenu: add removable media entries") Addresses-Coverity: 376207 ("Uninitialized variables") Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
3d595ac5 |
|
09-Nov-2022 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: remove superfluous if in eficonfig_edit_boot_option Goto for an immediately succeeding label is superfluous. Fixes: 87d791423ac6 ("eficonfig: menu-driven addition of UEFI boot option") Addresses-Coverity: 376202 ("Identical code for different branches") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
2c0b0c31 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_SECURE_BOOT This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_SECURE_BOOT defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
83f3d121 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_MM_COMM_TEE This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_MM_COMM_TEE defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
88df3634 |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: CTRL+S to save the boot order 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>
|
#
45f5319f |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
menu: remove CTRL+C to quit On the sandbox called without "--terminal raw" CTRL+C leaves U-Boot, "ESC/CTRL+C to quit" is misleading. Let's remove CTRL+C to quit key handling from bootmenu and eficonfig menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
|
#
8dbd0a0f |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add vertical scroll support The current eficonfig menu does not support vertical scroll, so it can not display the menu entries greater than the console row size. This commit add the vertial scroll support. The console size is retrieved by SIMPLE_TEXT_OUTPUT_PROTOCOL.QueryMode() service, then calculates the row size for menu entry by subtracting menu header and description row size from the console row size. "start" and "end" are added in the efimenu structure. "start" keeps the menu entry index at the top, "end" keeps the bottom menu entry index. item_data_print() menu function only draws the menu entry between "start" and "end". This commit also fixes the issue that "Save" and "Quit" entries can be moved by BKEY_PLUS in change boot order menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
0d590852 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation This commit removes the change boot order specific menu implementation. The change boot order implementation calls eficonfig_process_common() same as other menus. The change boot order menu requires own item_data_print and item_choice implementation, but display_statusline function can be a same function as other menus. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
cd160b27 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor eficonfig_process_common function Current change boot order implementation does not call eficonfig_process_common() and call own menu functions for display_statusline, item_data_print and item_choice. Change boot order functionality should call eficonfig_process_common() to improve maintenanceability. This commit is a preparation to remove the change boot order specific implementation. The menu functions (display_statusline, item_data_print and item_choice) are added as argument of eficonfig_process_common(). The menu description string displayed at the bottom of the menu is also added as argument. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
32bab0ea |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Make use of CLI character processing Avoid duplicating some of the escape-sequence processing here and use the CLI function instead. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
d0ca98db |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Update bootmenu_loop() to return the code Use the return value to save having to pass around a pointer. This also resolves any ambiguity about what *key contains when the function is called. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
2da4a15e |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Rename KEY_... to BKEY_... This enum values conflict with linux/input.h so rename them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
64550274 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: avoid SetVariable between GetNextVariableName calls The current code calls efi_set_variable_int() to delete the invalid boot option between calls to efi_get_next_variable_name_int(), it may produce unpredictable results. This commit moves removal of the invalid boot option outside of the efi_get_next_variable_name_int() calls. EFI_NOT_FOUND returned from efi_get_next_variable_name_int() indicates we retrieved all EFI variables, it should be treated as EFI_SUCEESS. To address the checkpatch warning of too many leading tabs, combine two if statement into one. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
ce327084 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: carve out efi_get_next_variable_name_int calls To retrieve the EFI variable name by efi_get_next_variable_name_int(), the sequence of alloc -> efi_get_next_variable_name_int -> realloc -> efi_get_next_variable_name_int is required. In current code, this sequence repeatedly appears in the several functions. It should be curved out a common function. This commit also fixes the missing free() of var_name16 in eficonfig_delete_invalid_boot_option(). Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
140a8959 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use efi_get_next_variable_name_int() eficonfig command reads all possible UEFI load options from 0x0000 to 0xFFFF to construct the menu. This takes too much time in some environment. This commit uses efi_get_next_variable_name_int() to read all existing UEFI load options to significantlly reduce the count of efi_get_var() call. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
78b1ccc4 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use u16_strsize() to get u16 string buffer size Use u16_strsize() to simplify the u16 string buffer size calculation. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c67d3c9e |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix going one directory up issue The directory name in eficonfig menu entry contains the '\' separator. strcmp() argument ".." is wrong and one directory up handling does not work correctly. strcmp() argument must include '\' separator. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c3b5af63 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add UEFI Secure Boot Key enrollment interface This commit adds the menu-driven UEFI Secure Boot Key enrollment interface. User can enroll PK, KEK, db and dbx by selecting file. Only the signed EFI Signature List(s) with an authenticated header, typically '.auth' file, is accepted. To clear the PK, KEK, db and dbx, user needs to enroll the null key signed by PK or KEK. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
21faf4ef |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use protocol interface for file selection EFI_SIMPLE_FILE_SYSTEM_PROTOCOL is not always provided by U-Boot. Use protocol interface functions instead of U-Boot internal functions. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d6566113 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose eficonfig_create_device_path() Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use eficonfig_create_device_path() to construct the full device path from device path of the volume and file path, so move it out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d571f9b2 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation All the eficonfig menus other than "Change Boot Order" use 'eficonfig_entry' structure for each menu entry. This commit refactors change boot order implementation to use 'eficonfig_entry' structure same as other menus to have consistent menu handling. This commit also simplifies the data->active handling when KEY_SPACE is pressed, and sizeof() parameter. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
8961e93e |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose append entry function Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use append_entry() and append_quit_entry() to construct the menu, so move them out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
a84040ab |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor file selection handling eficonfig_select_file_handler() is commonly used to select the file. eficonfig_display_select_file_option() adds an additional menu to clear the selected file. eficonfig_display_select_file_option() is not always necessary for the file selection process, so it must be outside of eficonfig_select_file_handler(). This commit also renames the following functions to avoid confusion. eficonfig_select_file_handler() -> eficonfig_process_select_file() eficonfig_select_file() -> eficonfig_show_file_selection() eficonfig_display_select_file_option() -> eficonfig_process_show_file_option() Finally, test_eficonfig.py need to be updated to get aligned with the above modification. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
1167e88a |
|
14-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix missing variable initialization The 'ret' variable must be initialized before use in eficonfig_delete_invalid_boot_option(). Fixes: c416f1c0bc ("bootmenu: add removable media entries") Addresses-Coverity: 376207 ("Uninitialized variables") Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
3d595ac5 |
|
09-Nov-2022 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: remove superfluous if in eficonfig_edit_boot_option Goto for an immediately succeeding label is superfluous. Fixes: 87d791423ac6 ("eficonfig: menu-driven addition of UEFI boot option") Addresses-Coverity: 376202 ("Identical code for different branches") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
2c0b0c31 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_SECURE_BOOT This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_SECURE_BOOT defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
83f3d121 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_MM_COMM_TEE This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_MM_COMM_TEE defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
88df3634 |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: CTRL+S to save the boot order 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>
|
#
45f5319f |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
menu: remove CTRL+C to quit On the sandbox called without "--terminal raw" CTRL+C leaves U-Boot, "ESC/CTRL+C to quit" is misleading. Let's remove CTRL+C to quit key handling from bootmenu and eficonfig menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
|
#
8dbd0a0f |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add vertical scroll support The current eficonfig menu does not support vertical scroll, so it can not display the menu entries greater than the console row size. This commit add the vertial scroll support. The console size is retrieved by SIMPLE_TEXT_OUTPUT_PROTOCOL.QueryMode() service, then calculates the row size for menu entry by subtracting menu header and description row size from the console row size. "start" and "end" are added in the efimenu structure. "start" keeps the menu entry index at the top, "end" keeps the bottom menu entry index. item_data_print() menu function only draws the menu entry between "start" and "end". This commit also fixes the issue that "Save" and "Quit" entries can be moved by BKEY_PLUS in change boot order menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
0d590852 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation This commit removes the change boot order specific menu implementation. The change boot order implementation calls eficonfig_process_common() same as other menus. The change boot order menu requires own item_data_print and item_choice implementation, but display_statusline function can be a same function as other menus. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
cd160b27 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor eficonfig_process_common function Current change boot order implementation does not call eficonfig_process_common() and call own menu functions for display_statusline, item_data_print and item_choice. Change boot order functionality should call eficonfig_process_common() to improve maintenanceability. This commit is a preparation to remove the change boot order specific implementation. The menu functions (display_statusline, item_data_print and item_choice) are added as argument of eficonfig_process_common(). The menu description string displayed at the bottom of the menu is also added as argument. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
32bab0ea |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Make use of CLI character processing Avoid duplicating some of the escape-sequence processing here and use the CLI function instead. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
d0ca98db |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Update bootmenu_loop() to return the code Use the return value to save having to pass around a pointer. This also resolves any ambiguity about what *key contains when the function is called. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
2da4a15e |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Rename KEY_... to BKEY_... This enum values conflict with linux/input.h so rename them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
64550274 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: avoid SetVariable between GetNextVariableName calls The current code calls efi_set_variable_int() to delete the invalid boot option between calls to efi_get_next_variable_name_int(), it may produce unpredictable results. This commit moves removal of the invalid boot option outside of the efi_get_next_variable_name_int() calls. EFI_NOT_FOUND returned from efi_get_next_variable_name_int() indicates we retrieved all EFI variables, it should be treated as EFI_SUCEESS. To address the checkpatch warning of too many leading tabs, combine two if statement into one. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
ce327084 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: carve out efi_get_next_variable_name_int calls To retrieve the EFI variable name by efi_get_next_variable_name_int(), the sequence of alloc -> efi_get_next_variable_name_int -> realloc -> efi_get_next_variable_name_int is required. In current code, this sequence repeatedly appears in the several functions. It should be curved out a common function. This commit also fixes the missing free() of var_name16 in eficonfig_delete_invalid_boot_option(). Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
140a8959 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use efi_get_next_variable_name_int() eficonfig command reads all possible UEFI load options from 0x0000 to 0xFFFF to construct the menu. This takes too much time in some environment. This commit uses efi_get_next_variable_name_int() to read all existing UEFI load options to significantlly reduce the count of efi_get_var() call. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
78b1ccc4 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use u16_strsize() to get u16 string buffer size Use u16_strsize() to simplify the u16 string buffer size calculation. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c67d3c9e |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix going one directory up issue The directory name in eficonfig menu entry contains the '\' separator. strcmp() argument ".." is wrong and one directory up handling does not work correctly. strcmp() argument must include '\' separator. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c3b5af63 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add UEFI Secure Boot Key enrollment interface This commit adds the menu-driven UEFI Secure Boot Key enrollment interface. User can enroll PK, KEK, db and dbx by selecting file. Only the signed EFI Signature List(s) with an authenticated header, typically '.auth' file, is accepted. To clear the PK, KEK, db and dbx, user needs to enroll the null key signed by PK or KEK. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
21faf4ef |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use protocol interface for file selection EFI_SIMPLE_FILE_SYSTEM_PROTOCOL is not always provided by U-Boot. Use protocol interface functions instead of U-Boot internal functions. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d6566113 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose eficonfig_create_device_path() Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use eficonfig_create_device_path() to construct the full device path from device path of the volume and file path, so move it out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d571f9b2 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation All the eficonfig menus other than "Change Boot Order" use 'eficonfig_entry' structure for each menu entry. This commit refactors change boot order implementation to use 'eficonfig_entry' structure same as other menus to have consistent menu handling. This commit also simplifies the data->active handling when KEY_SPACE is pressed, and sizeof() parameter. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
8961e93e |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose append entry function Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use append_entry() and append_quit_entry() to construct the menu, so move them out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
a84040ab |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor file selection handling eficonfig_select_file_handler() is commonly used to select the file. eficonfig_display_select_file_option() adds an additional menu to clear the selected file. eficonfig_display_select_file_option() is not always necessary for the file selection process, so it must be outside of eficonfig_select_file_handler(). This commit also renames the following functions to avoid confusion. eficonfig_select_file_handler() -> eficonfig_process_select_file() eficonfig_select_file() -> eficonfig_show_file_selection() eficonfig_display_select_file_option() -> eficonfig_process_show_file_option() Finally, test_eficonfig.py need to be updated to get aligned with the above modification. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
1167e88a |
|
14-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix missing variable initialization The 'ret' variable must be initialized before use in eficonfig_delete_invalid_boot_option(). Fixes: c416f1c0bc ("bootmenu: add removable media entries") Addresses-Coverity: 376207 ("Uninitialized variables") Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
3d595ac5 |
|
09-Nov-2022 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: remove superfluous if in eficonfig_edit_boot_option Goto for an immediately succeeding label is superfluous. Fixes: 87d791423ac6 ("eficonfig: menu-driven addition of UEFI boot option") Addresses-Coverity: 376202 ("Identical code for different branches") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
2c0b0c31 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_SECURE_BOOT This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_SECURE_BOOT defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
83f3d121 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_MM_COMM_TEE This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_MM_COMM_TEE defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
88df3634 |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: CTRL+S to save the boot order 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>
|
#
45f5319f |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
menu: remove CTRL+C to quit On the sandbox called without "--terminal raw" CTRL+C leaves U-Boot, "ESC/CTRL+C to quit" is misleading. Let's remove CTRL+C to quit key handling from bootmenu and eficonfig menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
|
#
8dbd0a0f |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add vertical scroll support The current eficonfig menu does not support vertical scroll, so it can not display the menu entries greater than the console row size. This commit add the vertial scroll support. The console size is retrieved by SIMPLE_TEXT_OUTPUT_PROTOCOL.QueryMode() service, then calculates the row size for menu entry by subtracting menu header and description row size from the console row size. "start" and "end" are added in the efimenu structure. "start" keeps the menu entry index at the top, "end" keeps the bottom menu entry index. item_data_print() menu function only draws the menu entry between "start" and "end". This commit also fixes the issue that "Save" and "Quit" entries can be moved by BKEY_PLUS in change boot order menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
0d590852 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation This commit removes the change boot order specific menu implementation. The change boot order implementation calls eficonfig_process_common() same as other menus. The change boot order menu requires own item_data_print and item_choice implementation, but display_statusline function can be a same function as other menus. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
cd160b27 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor eficonfig_process_common function Current change boot order implementation does not call eficonfig_process_common() and call own menu functions for display_statusline, item_data_print and item_choice. Change boot order functionality should call eficonfig_process_common() to improve maintenanceability. This commit is a preparation to remove the change boot order specific implementation. The menu functions (display_statusline, item_data_print and item_choice) are added as argument of eficonfig_process_common(). The menu description string displayed at the bottom of the menu is also added as argument. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
32bab0ea |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Make use of CLI character processing Avoid duplicating some of the escape-sequence processing here and use the CLI function instead. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
d0ca98db |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Update bootmenu_loop() to return the code Use the return value to save having to pass around a pointer. This also resolves any ambiguity about what *key contains when the function is called. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
2da4a15e |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Rename KEY_... to BKEY_... This enum values conflict with linux/input.h so rename them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
64550274 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: avoid SetVariable between GetNextVariableName calls The current code calls efi_set_variable_int() to delete the invalid boot option between calls to efi_get_next_variable_name_int(), it may produce unpredictable results. This commit moves removal of the invalid boot option outside of the efi_get_next_variable_name_int() calls. EFI_NOT_FOUND returned from efi_get_next_variable_name_int() indicates we retrieved all EFI variables, it should be treated as EFI_SUCEESS. To address the checkpatch warning of too many leading tabs, combine two if statement into one. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
ce327084 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: carve out efi_get_next_variable_name_int calls To retrieve the EFI variable name by efi_get_next_variable_name_int(), the sequence of alloc -> efi_get_next_variable_name_int -> realloc -> efi_get_next_variable_name_int is required. In current code, this sequence repeatedly appears in the several functions. It should be curved out a common function. This commit also fixes the missing free() of var_name16 in eficonfig_delete_invalid_boot_option(). Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
140a8959 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use efi_get_next_variable_name_int() eficonfig command reads all possible UEFI load options from 0x0000 to 0xFFFF to construct the menu. This takes too much time in some environment. This commit uses efi_get_next_variable_name_int() to read all existing UEFI load options to significantlly reduce the count of efi_get_var() call. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
78b1ccc4 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use u16_strsize() to get u16 string buffer size Use u16_strsize() to simplify the u16 string buffer size calculation. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c67d3c9e |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix going one directory up issue The directory name in eficonfig menu entry contains the '\' separator. strcmp() argument ".." is wrong and one directory up handling does not work correctly. strcmp() argument must include '\' separator. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c3b5af63 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add UEFI Secure Boot Key enrollment interface This commit adds the menu-driven UEFI Secure Boot Key enrollment interface. User can enroll PK, KEK, db and dbx by selecting file. Only the signed EFI Signature List(s) with an authenticated header, typically '.auth' file, is accepted. To clear the PK, KEK, db and dbx, user needs to enroll the null key signed by PK or KEK. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
21faf4ef |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use protocol interface for file selection EFI_SIMPLE_FILE_SYSTEM_PROTOCOL is not always provided by U-Boot. Use protocol interface functions instead of U-Boot internal functions. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d6566113 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose eficonfig_create_device_path() Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use eficonfig_create_device_path() to construct the full device path from device path of the volume and file path, so move it out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d571f9b2 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation All the eficonfig menus other than "Change Boot Order" use 'eficonfig_entry' structure for each menu entry. This commit refactors change boot order implementation to use 'eficonfig_entry' structure same as other menus to have consistent menu handling. This commit also simplifies the data->active handling when KEY_SPACE is pressed, and sizeof() parameter. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
8961e93e |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose append entry function Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use append_entry() and append_quit_entry() to construct the menu, so move them out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
a84040ab |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor file selection handling eficonfig_select_file_handler() is commonly used to select the file. eficonfig_display_select_file_option() adds an additional menu to clear the selected file. eficonfig_display_select_file_option() is not always necessary for the file selection process, so it must be outside of eficonfig_select_file_handler(). This commit also renames the following functions to avoid confusion. eficonfig_select_file_handler() -> eficonfig_process_select_file() eficonfig_select_file() -> eficonfig_show_file_selection() eficonfig_display_select_file_option() -> eficonfig_process_show_file_option() Finally, test_eficonfig.py need to be updated to get aligned with the above modification. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
1167e88a |
|
14-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix missing variable initialization The 'ret' variable must be initialized before use in eficonfig_delete_invalid_boot_option(). Fixes: c416f1c0bc ("bootmenu: add removable media entries") Addresses-Coverity: 376207 ("Uninitialized variables") Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
3d595ac5 |
|
09-Nov-2022 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: remove superfluous if in eficonfig_edit_boot_option Goto for an immediately succeeding label is superfluous. Fixes: 87d791423ac6 ("eficonfig: menu-driven addition of UEFI boot option") Addresses-Coverity: 376202 ("Identical code for different branches") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
2c0b0c31 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_SECURE_BOOT This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_SECURE_BOOT defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
83f3d121 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_MM_COMM_TEE This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_MM_COMM_TEE defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
88df3634 |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: CTRL+S to save the boot order 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>
|
#
45f5319f |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
menu: remove CTRL+C to quit On the sandbox called without "--terminal raw" CTRL+C leaves U-Boot, "ESC/CTRL+C to quit" is misleading. Let's remove CTRL+C to quit key handling from bootmenu and eficonfig menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
|
#
8dbd0a0f |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add vertical scroll support The current eficonfig menu does not support vertical scroll, so it can not display the menu entries greater than the console row size. This commit add the vertial scroll support. The console size is retrieved by SIMPLE_TEXT_OUTPUT_PROTOCOL.QueryMode() service, then calculates the row size for menu entry by subtracting menu header and description row size from the console row size. "start" and "end" are added in the efimenu structure. "start" keeps the menu entry index at the top, "end" keeps the bottom menu entry index. item_data_print() menu function only draws the menu entry between "start" and "end". This commit also fixes the issue that "Save" and "Quit" entries can be moved by BKEY_PLUS in change boot order menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
0d590852 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation This commit removes the change boot order specific menu implementation. The change boot order implementation calls eficonfig_process_common() same as other menus. The change boot order menu requires own item_data_print and item_choice implementation, but display_statusline function can be a same function as other menus. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
cd160b27 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor eficonfig_process_common function Current change boot order implementation does not call eficonfig_process_common() and call own menu functions for display_statusline, item_data_print and item_choice. Change boot order functionality should call eficonfig_process_common() to improve maintenanceability. This commit is a preparation to remove the change boot order specific implementation. The menu functions (display_statusline, item_data_print and item_choice) are added as argument of eficonfig_process_common(). The menu description string displayed at the bottom of the menu is also added as argument. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
32bab0ea |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Make use of CLI character processing Avoid duplicating some of the escape-sequence processing here and use the CLI function instead. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
d0ca98db |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Update bootmenu_loop() to return the code Use the return value to save having to pass around a pointer. This also resolves any ambiguity about what *key contains when the function is called. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
2da4a15e |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Rename KEY_... to BKEY_... This enum values conflict with linux/input.h so rename them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
64550274 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: avoid SetVariable between GetNextVariableName calls The current code calls efi_set_variable_int() to delete the invalid boot option between calls to efi_get_next_variable_name_int(), it may produce unpredictable results. This commit moves removal of the invalid boot option outside of the efi_get_next_variable_name_int() calls. EFI_NOT_FOUND returned from efi_get_next_variable_name_int() indicates we retrieved all EFI variables, it should be treated as EFI_SUCEESS. To address the checkpatch warning of too many leading tabs, combine two if statement into one. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
ce327084 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: carve out efi_get_next_variable_name_int calls To retrieve the EFI variable name by efi_get_next_variable_name_int(), the sequence of alloc -> efi_get_next_variable_name_int -> realloc -> efi_get_next_variable_name_int is required. In current code, this sequence repeatedly appears in the several functions. It should be curved out a common function. This commit also fixes the missing free() of var_name16 in eficonfig_delete_invalid_boot_option(). Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
140a8959 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use efi_get_next_variable_name_int() eficonfig command reads all possible UEFI load options from 0x0000 to 0xFFFF to construct the menu. This takes too much time in some environment. This commit uses efi_get_next_variable_name_int() to read all existing UEFI load options to significantlly reduce the count of efi_get_var() call. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
78b1ccc4 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use u16_strsize() to get u16 string buffer size Use u16_strsize() to simplify the u16 string buffer size calculation. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c67d3c9e |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix going one directory up issue The directory name in eficonfig menu entry contains the '\' separator. strcmp() argument ".." is wrong and one directory up handling does not work correctly. strcmp() argument must include '\' separator. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c3b5af63 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add UEFI Secure Boot Key enrollment interface This commit adds the menu-driven UEFI Secure Boot Key enrollment interface. User can enroll PK, KEK, db and dbx by selecting file. Only the signed EFI Signature List(s) with an authenticated header, typically '.auth' file, is accepted. To clear the PK, KEK, db and dbx, user needs to enroll the null key signed by PK or KEK. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
21faf4ef |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use protocol interface for file selection EFI_SIMPLE_FILE_SYSTEM_PROTOCOL is not always provided by U-Boot. Use protocol interface functions instead of U-Boot internal functions. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d6566113 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose eficonfig_create_device_path() Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use eficonfig_create_device_path() to construct the full device path from device path of the volume and file path, so move it out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d571f9b2 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation All the eficonfig menus other than "Change Boot Order" use 'eficonfig_entry' structure for each menu entry. This commit refactors change boot order implementation to use 'eficonfig_entry' structure same as other menus to have consistent menu handling. This commit also simplifies the data->active handling when KEY_SPACE is pressed, and sizeof() parameter. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
8961e93e |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose append entry function Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use append_entry() and append_quit_entry() to construct the menu, so move them out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
a84040ab |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor file selection handling eficonfig_select_file_handler() is commonly used to select the file. eficonfig_display_select_file_option() adds an additional menu to clear the selected file. eficonfig_display_select_file_option() is not always necessary for the file selection process, so it must be outside of eficonfig_select_file_handler(). This commit also renames the following functions to avoid confusion. eficonfig_select_file_handler() -> eficonfig_process_select_file() eficonfig_select_file() -> eficonfig_show_file_selection() eficonfig_display_select_file_option() -> eficonfig_process_show_file_option() Finally, test_eficonfig.py need to be updated to get aligned with the above modification. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
1167e88a |
|
14-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix missing variable initialization The 'ret' variable must be initialized before use in eficonfig_delete_invalid_boot_option(). Fixes: c416f1c0bc ("bootmenu: add removable media entries") Addresses-Coverity: 376207 ("Uninitialized variables") Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
3d595ac5 |
|
09-Nov-2022 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: remove superfluous if in eficonfig_edit_boot_option Goto for an immediately succeeding label is superfluous. Fixes: 87d791423ac6 ("eficonfig: menu-driven addition of UEFI boot option") Addresses-Coverity: 376202 ("Identical code for different branches") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
2c0b0c31 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_SECURE_BOOT This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_SECURE_BOOT defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
83f3d121 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_MM_COMM_TEE This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_MM_COMM_TEE defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
88df3634 |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: CTRL+S to save the boot order 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>
|
#
45f5319f |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
menu: remove CTRL+C to quit On the sandbox called without "--terminal raw" CTRL+C leaves U-Boot, "ESC/CTRL+C to quit" is misleading. Let's remove CTRL+C to quit key handling from bootmenu and eficonfig menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
|
#
8dbd0a0f |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add vertical scroll support The current eficonfig menu does not support vertical scroll, so it can not display the menu entries greater than the console row size. This commit add the vertial scroll support. The console size is retrieved by SIMPLE_TEXT_OUTPUT_PROTOCOL.QueryMode() service, then calculates the row size for menu entry by subtracting menu header and description row size from the console row size. "start" and "end" are added in the efimenu structure. "start" keeps the menu entry index at the top, "end" keeps the bottom menu entry index. item_data_print() menu function only draws the menu entry between "start" and "end". This commit also fixes the issue that "Save" and "Quit" entries can be moved by BKEY_PLUS in change boot order menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
0d590852 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation This commit removes the change boot order specific menu implementation. The change boot order implementation calls eficonfig_process_common() same as other menus. The change boot order menu requires own item_data_print and item_choice implementation, but display_statusline function can be a same function as other menus. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
cd160b27 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor eficonfig_process_common function Current change boot order implementation does not call eficonfig_process_common() and call own menu functions for display_statusline, item_data_print and item_choice. Change boot order functionality should call eficonfig_process_common() to improve maintenanceability. This commit is a preparation to remove the change boot order specific implementation. The menu functions (display_statusline, item_data_print and item_choice) are added as argument of eficonfig_process_common(). The menu description string displayed at the bottom of the menu is also added as argument. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
32bab0ea |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Make use of CLI character processing Avoid duplicating some of the escape-sequence processing here and use the CLI function instead. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
d0ca98db |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Update bootmenu_loop() to return the code Use the return value to save having to pass around a pointer. This also resolves any ambiguity about what *key contains when the function is called. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
2da4a15e |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Rename KEY_... to BKEY_... This enum values conflict with linux/input.h so rename them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
64550274 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: avoid SetVariable between GetNextVariableName calls The current code calls efi_set_variable_int() to delete the invalid boot option between calls to efi_get_next_variable_name_int(), it may produce unpredictable results. This commit moves removal of the invalid boot option outside of the efi_get_next_variable_name_int() calls. EFI_NOT_FOUND returned from efi_get_next_variable_name_int() indicates we retrieved all EFI variables, it should be treated as EFI_SUCEESS. To address the checkpatch warning of too many leading tabs, combine two if statement into one. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
ce327084 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: carve out efi_get_next_variable_name_int calls To retrieve the EFI variable name by efi_get_next_variable_name_int(), the sequence of alloc -> efi_get_next_variable_name_int -> realloc -> efi_get_next_variable_name_int is required. In current code, this sequence repeatedly appears in the several functions. It should be curved out a common function. This commit also fixes the missing free() of var_name16 in eficonfig_delete_invalid_boot_option(). Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
140a8959 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use efi_get_next_variable_name_int() eficonfig command reads all possible UEFI load options from 0x0000 to 0xFFFF to construct the menu. This takes too much time in some environment. This commit uses efi_get_next_variable_name_int() to read all existing UEFI load options to significantlly reduce the count of efi_get_var() call. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
78b1ccc4 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use u16_strsize() to get u16 string buffer size Use u16_strsize() to simplify the u16 string buffer size calculation. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c67d3c9e |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix going one directory up issue The directory name in eficonfig menu entry contains the '\' separator. strcmp() argument ".." is wrong and one directory up handling does not work correctly. strcmp() argument must include '\' separator. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c3b5af63 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add UEFI Secure Boot Key enrollment interface This commit adds the menu-driven UEFI Secure Boot Key enrollment interface. User can enroll PK, KEK, db and dbx by selecting file. Only the signed EFI Signature List(s) with an authenticated header, typically '.auth' file, is accepted. To clear the PK, KEK, db and dbx, user needs to enroll the null key signed by PK or KEK. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
21faf4ef |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use protocol interface for file selection EFI_SIMPLE_FILE_SYSTEM_PROTOCOL is not always provided by U-Boot. Use protocol interface functions instead of U-Boot internal functions. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d6566113 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose eficonfig_create_device_path() Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use eficonfig_create_device_path() to construct the full device path from device path of the volume and file path, so move it out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d571f9b2 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation All the eficonfig menus other than "Change Boot Order" use 'eficonfig_entry' structure for each menu entry. This commit refactors change boot order implementation to use 'eficonfig_entry' structure same as other menus to have consistent menu handling. This commit also simplifies the data->active handling when KEY_SPACE is pressed, and sizeof() parameter. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
8961e93e |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose append entry function Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use append_entry() and append_quit_entry() to construct the menu, so move them out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
a84040ab |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor file selection handling eficonfig_select_file_handler() is commonly used to select the file. eficonfig_display_select_file_option() adds an additional menu to clear the selected file. eficonfig_display_select_file_option() is not always necessary for the file selection process, so it must be outside of eficonfig_select_file_handler(). This commit also renames the following functions to avoid confusion. eficonfig_select_file_handler() -> eficonfig_process_select_file() eficonfig_select_file() -> eficonfig_show_file_selection() eficonfig_display_select_file_option() -> eficonfig_process_show_file_option() Finally, test_eficonfig.py need to be updated to get aligned with the above modification. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
1167e88a |
|
14-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix missing variable initialization The 'ret' variable must be initialized before use in eficonfig_delete_invalid_boot_option(). Fixes: c416f1c0bc ("bootmenu: add removable media entries") Addresses-Coverity: 376207 ("Uninitialized variables") Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
3d595ac5 |
|
09-Nov-2022 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: remove superfluous if in eficonfig_edit_boot_option Goto for an immediately succeeding label is superfluous. Fixes: 87d791423ac6 ("eficonfig: menu-driven addition of UEFI boot option") Addresses-Coverity: 376202 ("Identical code for different branches") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
2c0b0c31 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_SECURE_BOOT This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_SECURE_BOOT defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
83f3d121 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_MM_COMM_TEE This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_MM_COMM_TEE defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
88df3634 |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: CTRL+S to save the boot order 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>
|
#
45f5319f |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
menu: remove CTRL+C to quit On the sandbox called without "--terminal raw" CTRL+C leaves U-Boot, "ESC/CTRL+C to quit" is misleading. Let's remove CTRL+C to quit key handling from bootmenu and eficonfig menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
|
#
8dbd0a0f |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add vertical scroll support The current eficonfig menu does not support vertical scroll, so it can not display the menu entries greater than the console row size. This commit add the vertial scroll support. The console size is retrieved by SIMPLE_TEXT_OUTPUT_PROTOCOL.QueryMode() service, then calculates the row size for menu entry by subtracting menu header and description row size from the console row size. "start" and "end" are added in the efimenu structure. "start" keeps the menu entry index at the top, "end" keeps the bottom menu entry index. item_data_print() menu function only draws the menu entry between "start" and "end". This commit also fixes the issue that "Save" and "Quit" entries can be moved by BKEY_PLUS in change boot order menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
0d590852 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation This commit removes the change boot order specific menu implementation. The change boot order implementation calls eficonfig_process_common() same as other menus. The change boot order menu requires own item_data_print and item_choice implementation, but display_statusline function can be a same function as other menus. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
cd160b27 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor eficonfig_process_common function Current change boot order implementation does not call eficonfig_process_common() and call own menu functions for display_statusline, item_data_print and item_choice. Change boot order functionality should call eficonfig_process_common() to improve maintenanceability. This commit is a preparation to remove the change boot order specific implementation. The menu functions (display_statusline, item_data_print and item_choice) are added as argument of eficonfig_process_common(). The menu description string displayed at the bottom of the menu is also added as argument. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
32bab0ea |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Make use of CLI character processing Avoid duplicating some of the escape-sequence processing here and use the CLI function instead. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
d0ca98db |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Update bootmenu_loop() to return the code Use the return value to save having to pass around a pointer. This also resolves any ambiguity about what *key contains when the function is called. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
2da4a15e |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Rename KEY_... to BKEY_... This enum values conflict with linux/input.h so rename them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
64550274 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: avoid SetVariable between GetNextVariableName calls The current code calls efi_set_variable_int() to delete the invalid boot option between calls to efi_get_next_variable_name_int(), it may produce unpredictable results. This commit moves removal of the invalid boot option outside of the efi_get_next_variable_name_int() calls. EFI_NOT_FOUND returned from efi_get_next_variable_name_int() indicates we retrieved all EFI variables, it should be treated as EFI_SUCEESS. To address the checkpatch warning of too many leading tabs, combine two if statement into one. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
ce327084 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: carve out efi_get_next_variable_name_int calls To retrieve the EFI variable name by efi_get_next_variable_name_int(), the sequence of alloc -> efi_get_next_variable_name_int -> realloc -> efi_get_next_variable_name_int is required. In current code, this sequence repeatedly appears in the several functions. It should be curved out a common function. This commit also fixes the missing free() of var_name16 in eficonfig_delete_invalid_boot_option(). Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
140a8959 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use efi_get_next_variable_name_int() eficonfig command reads all possible UEFI load options from 0x0000 to 0xFFFF to construct the menu. This takes too much time in some environment. This commit uses efi_get_next_variable_name_int() to read all existing UEFI load options to significantlly reduce the count of efi_get_var() call. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
78b1ccc4 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use u16_strsize() to get u16 string buffer size Use u16_strsize() to simplify the u16 string buffer size calculation. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c67d3c9e |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix going one directory up issue The directory name in eficonfig menu entry contains the '\' separator. strcmp() argument ".." is wrong and one directory up handling does not work correctly. strcmp() argument must include '\' separator. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c3b5af63 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add UEFI Secure Boot Key enrollment interface This commit adds the menu-driven UEFI Secure Boot Key enrollment interface. User can enroll PK, KEK, db and dbx by selecting file. Only the signed EFI Signature List(s) with an authenticated header, typically '.auth' file, is accepted. To clear the PK, KEK, db and dbx, user needs to enroll the null key signed by PK or KEK. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
21faf4ef |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use protocol interface for file selection EFI_SIMPLE_FILE_SYSTEM_PROTOCOL is not always provided by U-Boot. Use protocol interface functions instead of U-Boot internal functions. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d6566113 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose eficonfig_create_device_path() Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use eficonfig_create_device_path() to construct the full device path from device path of the volume and file path, so move it out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d571f9b2 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation All the eficonfig menus other than "Change Boot Order" use 'eficonfig_entry' structure for each menu entry. This commit refactors change boot order implementation to use 'eficonfig_entry' structure same as other menus to have consistent menu handling. This commit also simplifies the data->active handling when KEY_SPACE is pressed, and sizeof() parameter. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
8961e93e |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose append entry function Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use append_entry() and append_quit_entry() to construct the menu, so move them out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
a84040ab |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor file selection handling eficonfig_select_file_handler() is commonly used to select the file. eficonfig_display_select_file_option() adds an additional menu to clear the selected file. eficonfig_display_select_file_option() is not always necessary for the file selection process, so it must be outside of eficonfig_select_file_handler(). This commit also renames the following functions to avoid confusion. eficonfig_select_file_handler() -> eficonfig_process_select_file() eficonfig_select_file() -> eficonfig_show_file_selection() eficonfig_display_select_file_option() -> eficonfig_process_show_file_option() Finally, test_eficonfig.py need to be updated to get aligned with the above modification. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
1167e88a |
|
14-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix missing variable initialization The 'ret' variable must be initialized before use in eficonfig_delete_invalid_boot_option(). Fixes: c416f1c0bc ("bootmenu: add removable media entries") Addresses-Coverity: 376207 ("Uninitialized variables") Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
3d595ac5 |
|
09-Nov-2022 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: remove superfluous if in eficonfig_edit_boot_option Goto for an immediately succeeding label is superfluous. Fixes: 87d791423ac6 ("eficonfig: menu-driven addition of UEFI boot option") Addresses-Coverity: 376202 ("Identical code for different branches") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
2c0b0c31 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_SECURE_BOOT This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_SECURE_BOOT defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
83f3d121 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_MM_COMM_TEE This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_MM_COMM_TEE defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
88df3634 |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: CTRL+S to save the boot order 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>
|
#
45f5319f |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
menu: remove CTRL+C to quit On the sandbox called without "--terminal raw" CTRL+C leaves U-Boot, "ESC/CTRL+C to quit" is misleading. Let's remove CTRL+C to quit key handling from bootmenu and eficonfig menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
|
#
8dbd0a0f |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add vertical scroll support The current eficonfig menu does not support vertical scroll, so it can not display the menu entries greater than the console row size. This commit add the vertial scroll support. The console size is retrieved by SIMPLE_TEXT_OUTPUT_PROTOCOL.QueryMode() service, then calculates the row size for menu entry by subtracting menu header and description row size from the console row size. "start" and "end" are added in the efimenu structure. "start" keeps the menu entry index at the top, "end" keeps the bottom menu entry index. item_data_print() menu function only draws the menu entry between "start" and "end". This commit also fixes the issue that "Save" and "Quit" entries can be moved by BKEY_PLUS in change boot order menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
0d590852 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation This commit removes the change boot order specific menu implementation. The change boot order implementation calls eficonfig_process_common() same as other menus. The change boot order menu requires own item_data_print and item_choice implementation, but display_statusline function can be a same function as other menus. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
cd160b27 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor eficonfig_process_common function Current change boot order implementation does not call eficonfig_process_common() and call own menu functions for display_statusline, item_data_print and item_choice. Change boot order functionality should call eficonfig_process_common() to improve maintenanceability. This commit is a preparation to remove the change boot order specific implementation. The menu functions (display_statusline, item_data_print and item_choice) are added as argument of eficonfig_process_common(). The menu description string displayed at the bottom of the menu is also added as argument. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
32bab0ea |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Make use of CLI character processing Avoid duplicating some of the escape-sequence processing here and use the CLI function instead. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
d0ca98db |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Update bootmenu_loop() to return the code Use the return value to save having to pass around a pointer. This also resolves any ambiguity about what *key contains when the function is called. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
2da4a15e |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Rename KEY_... to BKEY_... This enum values conflict with linux/input.h so rename them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
64550274 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: avoid SetVariable between GetNextVariableName calls The current code calls efi_set_variable_int() to delete the invalid boot option between calls to efi_get_next_variable_name_int(), it may produce unpredictable results. This commit moves removal of the invalid boot option outside of the efi_get_next_variable_name_int() calls. EFI_NOT_FOUND returned from efi_get_next_variable_name_int() indicates we retrieved all EFI variables, it should be treated as EFI_SUCEESS. To address the checkpatch warning of too many leading tabs, combine two if statement into one. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
ce327084 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: carve out efi_get_next_variable_name_int calls To retrieve the EFI variable name by efi_get_next_variable_name_int(), the sequence of alloc -> efi_get_next_variable_name_int -> realloc -> efi_get_next_variable_name_int is required. In current code, this sequence repeatedly appears in the several functions. It should be curved out a common function. This commit also fixes the missing free() of var_name16 in eficonfig_delete_invalid_boot_option(). Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
140a8959 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use efi_get_next_variable_name_int() eficonfig command reads all possible UEFI load options from 0x0000 to 0xFFFF to construct the menu. This takes too much time in some environment. This commit uses efi_get_next_variable_name_int() to read all existing UEFI load options to significantlly reduce the count of efi_get_var() call. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
78b1ccc4 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use u16_strsize() to get u16 string buffer size Use u16_strsize() to simplify the u16 string buffer size calculation. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c67d3c9e |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix going one directory up issue The directory name in eficonfig menu entry contains the '\' separator. strcmp() argument ".." is wrong and one directory up handling does not work correctly. strcmp() argument must include '\' separator. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c3b5af63 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add UEFI Secure Boot Key enrollment interface This commit adds the menu-driven UEFI Secure Boot Key enrollment interface. User can enroll PK, KEK, db and dbx by selecting file. Only the signed EFI Signature List(s) with an authenticated header, typically '.auth' file, is accepted. To clear the PK, KEK, db and dbx, user needs to enroll the null key signed by PK or KEK. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
21faf4ef |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use protocol interface for file selection EFI_SIMPLE_FILE_SYSTEM_PROTOCOL is not always provided by U-Boot. Use protocol interface functions instead of U-Boot internal functions. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d6566113 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose eficonfig_create_device_path() Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use eficonfig_create_device_path() to construct the full device path from device path of the volume and file path, so move it out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d571f9b2 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation All the eficonfig menus other than "Change Boot Order" use 'eficonfig_entry' structure for each menu entry. This commit refactors change boot order implementation to use 'eficonfig_entry' structure same as other menus to have consistent menu handling. This commit also simplifies the data->active handling when KEY_SPACE is pressed, and sizeof() parameter. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
8961e93e |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose append entry function Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use append_entry() and append_quit_entry() to construct the menu, so move them out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
a84040ab |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor file selection handling eficonfig_select_file_handler() is commonly used to select the file. eficonfig_display_select_file_option() adds an additional menu to clear the selected file. eficonfig_display_select_file_option() is not always necessary for the file selection process, so it must be outside of eficonfig_select_file_handler(). This commit also renames the following functions to avoid confusion. eficonfig_select_file_handler() -> eficonfig_process_select_file() eficonfig_select_file() -> eficonfig_show_file_selection() eficonfig_display_select_file_option() -> eficonfig_process_show_file_option() Finally, test_eficonfig.py need to be updated to get aligned with the above modification. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
1167e88a |
|
14-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix missing variable initialization The 'ret' variable must be initialized before use in eficonfig_delete_invalid_boot_option(). Fixes: c416f1c0bc ("bootmenu: add removable media entries") Addresses-Coverity: 376207 ("Uninitialized variables") Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
3d595ac5 |
|
09-Nov-2022 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: remove superfluous if in eficonfig_edit_boot_option Goto for an immediately succeeding label is superfluous. Fixes: 87d791423ac6 ("eficonfig: menu-driven addition of UEFI boot option") Addresses-Coverity: 376202 ("Identical code for different branches") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
2c0b0c31 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_SECURE_BOOT This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_SECURE_BOOT defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
83f3d121 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_MM_COMM_TEE This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_MM_COMM_TEE defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
88df3634 |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: CTRL+S to save the boot order 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>
|
#
45f5319f |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
menu: remove CTRL+C to quit On the sandbox called without "--terminal raw" CTRL+C leaves U-Boot, "ESC/CTRL+C to quit" is misleading. Let's remove CTRL+C to quit key handling from bootmenu and eficonfig menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
|
#
8dbd0a0f |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add vertical scroll support The current eficonfig menu does not support vertical scroll, so it can not display the menu entries greater than the console row size. This commit add the vertial scroll support. The console size is retrieved by SIMPLE_TEXT_OUTPUT_PROTOCOL.QueryMode() service, then calculates the row size for menu entry by subtracting menu header and description row size from the console row size. "start" and "end" are added in the efimenu structure. "start" keeps the menu entry index at the top, "end" keeps the bottom menu entry index. item_data_print() menu function only draws the menu entry between "start" and "end". This commit also fixes the issue that "Save" and "Quit" entries can be moved by BKEY_PLUS in change boot order menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
0d590852 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation This commit removes the change boot order specific menu implementation. The change boot order implementation calls eficonfig_process_common() same as other menus. The change boot order menu requires own item_data_print and item_choice implementation, but display_statusline function can be a same function as other menus. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
cd160b27 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor eficonfig_process_common function Current change boot order implementation does not call eficonfig_process_common() and call own menu functions for display_statusline, item_data_print and item_choice. Change boot order functionality should call eficonfig_process_common() to improve maintenanceability. This commit is a preparation to remove the change boot order specific implementation. The menu functions (display_statusline, item_data_print and item_choice) are added as argument of eficonfig_process_common(). The menu description string displayed at the bottom of the menu is also added as argument. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
32bab0ea |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Make use of CLI character processing Avoid duplicating some of the escape-sequence processing here and use the CLI function instead. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
d0ca98db |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Update bootmenu_loop() to return the code Use the return value to save having to pass around a pointer. This also resolves any ambiguity about what *key contains when the function is called. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
2da4a15e |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Rename KEY_... to BKEY_... This enum values conflict with linux/input.h so rename them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
64550274 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: avoid SetVariable between GetNextVariableName calls The current code calls efi_set_variable_int() to delete the invalid boot option between calls to efi_get_next_variable_name_int(), it may produce unpredictable results. This commit moves removal of the invalid boot option outside of the efi_get_next_variable_name_int() calls. EFI_NOT_FOUND returned from efi_get_next_variable_name_int() indicates we retrieved all EFI variables, it should be treated as EFI_SUCEESS. To address the checkpatch warning of too many leading tabs, combine two if statement into one. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
ce327084 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: carve out efi_get_next_variable_name_int calls To retrieve the EFI variable name by efi_get_next_variable_name_int(), the sequence of alloc -> efi_get_next_variable_name_int -> realloc -> efi_get_next_variable_name_int is required. In current code, this sequence repeatedly appears in the several functions. It should be curved out a common function. This commit also fixes the missing free() of var_name16 in eficonfig_delete_invalid_boot_option(). Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
140a8959 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use efi_get_next_variable_name_int() eficonfig command reads all possible UEFI load options from 0x0000 to 0xFFFF to construct the menu. This takes too much time in some environment. This commit uses efi_get_next_variable_name_int() to read all existing UEFI load options to significantlly reduce the count of efi_get_var() call. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
78b1ccc4 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use u16_strsize() to get u16 string buffer size Use u16_strsize() to simplify the u16 string buffer size calculation. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c67d3c9e |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix going one directory up issue The directory name in eficonfig menu entry contains the '\' separator. strcmp() argument ".." is wrong and one directory up handling does not work correctly. strcmp() argument must include '\' separator. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c3b5af63 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add UEFI Secure Boot Key enrollment interface This commit adds the menu-driven UEFI Secure Boot Key enrollment interface. User can enroll PK, KEK, db and dbx by selecting file. Only the signed EFI Signature List(s) with an authenticated header, typically '.auth' file, is accepted. To clear the PK, KEK, db and dbx, user needs to enroll the null key signed by PK or KEK. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
21faf4ef |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use protocol interface for file selection EFI_SIMPLE_FILE_SYSTEM_PROTOCOL is not always provided by U-Boot. Use protocol interface functions instead of U-Boot internal functions. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d6566113 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose eficonfig_create_device_path() Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use eficonfig_create_device_path() to construct the full device path from device path of the volume and file path, so move it out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d571f9b2 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation All the eficonfig menus other than "Change Boot Order" use 'eficonfig_entry' structure for each menu entry. This commit refactors change boot order implementation to use 'eficonfig_entry' structure same as other menus to have consistent menu handling. This commit also simplifies the data->active handling when KEY_SPACE is pressed, and sizeof() parameter. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
8961e93e |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose append entry function Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use append_entry() and append_quit_entry() to construct the menu, so move them out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
a84040ab |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor file selection handling eficonfig_select_file_handler() is commonly used to select the file. eficonfig_display_select_file_option() adds an additional menu to clear the selected file. eficonfig_display_select_file_option() is not always necessary for the file selection process, so it must be outside of eficonfig_select_file_handler(). This commit also renames the following functions to avoid confusion. eficonfig_select_file_handler() -> eficonfig_process_select_file() eficonfig_select_file() -> eficonfig_show_file_selection() eficonfig_display_select_file_option() -> eficonfig_process_show_file_option() Finally, test_eficonfig.py need to be updated to get aligned with the above modification. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
1167e88a |
|
14-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix missing variable initialization The 'ret' variable must be initialized before use in eficonfig_delete_invalid_boot_option(). Fixes: c416f1c0bc ("bootmenu: add removable media entries") Addresses-Coverity: 376207 ("Uninitialized variables") Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
3d595ac5 |
|
09-Nov-2022 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: remove superfluous if in eficonfig_edit_boot_option Goto for an immediately succeeding label is superfluous. Fixes: 87d791423ac6 ("eficonfig: menu-driven addition of UEFI boot option") Addresses-Coverity: 376202 ("Identical code for different branches") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
2c0b0c31 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_SECURE_BOOT This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_SECURE_BOOT defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
83f3d121 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_MM_COMM_TEE This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_MM_COMM_TEE defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
88df3634 |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: CTRL+S to save the boot order 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>
|
#
45f5319f |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
menu: remove CTRL+C to quit On the sandbox called without "--terminal raw" CTRL+C leaves U-Boot, "ESC/CTRL+C to quit" is misleading. Let's remove CTRL+C to quit key handling from bootmenu and eficonfig menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
|
#
8dbd0a0f |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add vertical scroll support The current eficonfig menu does not support vertical scroll, so it can not display the menu entries greater than the console row size. This commit add the vertial scroll support. The console size is retrieved by SIMPLE_TEXT_OUTPUT_PROTOCOL.QueryMode() service, then calculates the row size for menu entry by subtracting menu header and description row size from the console row size. "start" and "end" are added in the efimenu structure. "start" keeps the menu entry index at the top, "end" keeps the bottom menu entry index. item_data_print() menu function only draws the menu entry between "start" and "end". This commit also fixes the issue that "Save" and "Quit" entries can be moved by BKEY_PLUS in change boot order menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
0d590852 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation This commit removes the change boot order specific menu implementation. The change boot order implementation calls eficonfig_process_common() same as other menus. The change boot order menu requires own item_data_print and item_choice implementation, but display_statusline function can be a same function as other menus. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
cd160b27 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor eficonfig_process_common function Current change boot order implementation does not call eficonfig_process_common() and call own menu functions for display_statusline, item_data_print and item_choice. Change boot order functionality should call eficonfig_process_common() to improve maintenanceability. This commit is a preparation to remove the change boot order specific implementation. The menu functions (display_statusline, item_data_print and item_choice) are added as argument of eficonfig_process_common(). The menu description string displayed at the bottom of the menu is also added as argument. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
32bab0ea |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Make use of CLI character processing Avoid duplicating some of the escape-sequence processing here and use the CLI function instead. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
d0ca98db |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Update bootmenu_loop() to return the code Use the return value to save having to pass around a pointer. This also resolves any ambiguity about what *key contains when the function is called. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
2da4a15e |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Rename KEY_... to BKEY_... This enum values conflict with linux/input.h so rename them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
64550274 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: avoid SetVariable between GetNextVariableName calls The current code calls efi_set_variable_int() to delete the invalid boot option between calls to efi_get_next_variable_name_int(), it may produce unpredictable results. This commit moves removal of the invalid boot option outside of the efi_get_next_variable_name_int() calls. EFI_NOT_FOUND returned from efi_get_next_variable_name_int() indicates we retrieved all EFI variables, it should be treated as EFI_SUCEESS. To address the checkpatch warning of too many leading tabs, combine two if statement into one. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
ce327084 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: carve out efi_get_next_variable_name_int calls To retrieve the EFI variable name by efi_get_next_variable_name_int(), the sequence of alloc -> efi_get_next_variable_name_int -> realloc -> efi_get_next_variable_name_int is required. In current code, this sequence repeatedly appears in the several functions. It should be curved out a common function. This commit also fixes the missing free() of var_name16 in eficonfig_delete_invalid_boot_option(). Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
140a8959 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use efi_get_next_variable_name_int() eficonfig command reads all possible UEFI load options from 0x0000 to 0xFFFF to construct the menu. This takes too much time in some environment. This commit uses efi_get_next_variable_name_int() to read all existing UEFI load options to significantlly reduce the count of efi_get_var() call. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
78b1ccc4 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use u16_strsize() to get u16 string buffer size Use u16_strsize() to simplify the u16 string buffer size calculation. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c67d3c9e |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix going one directory up issue The directory name in eficonfig menu entry contains the '\' separator. strcmp() argument ".." is wrong and one directory up handling does not work correctly. strcmp() argument must include '\' separator. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c3b5af63 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add UEFI Secure Boot Key enrollment interface This commit adds the menu-driven UEFI Secure Boot Key enrollment interface. User can enroll PK, KEK, db and dbx by selecting file. Only the signed EFI Signature List(s) with an authenticated header, typically '.auth' file, is accepted. To clear the PK, KEK, db and dbx, user needs to enroll the null key signed by PK or KEK. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
21faf4ef |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use protocol interface for file selection EFI_SIMPLE_FILE_SYSTEM_PROTOCOL is not always provided by U-Boot. Use protocol interface functions instead of U-Boot internal functions. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d6566113 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose eficonfig_create_device_path() Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use eficonfig_create_device_path() to construct the full device path from device path of the volume and file path, so move it out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d571f9b2 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation All the eficonfig menus other than "Change Boot Order" use 'eficonfig_entry' structure for each menu entry. This commit refactors change boot order implementation to use 'eficonfig_entry' structure same as other menus to have consistent menu handling. This commit also simplifies the data->active handling when KEY_SPACE is pressed, and sizeof() parameter. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
8961e93e |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose append entry function Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use append_entry() and append_quit_entry() to construct the menu, so move them out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
a84040ab |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor file selection handling eficonfig_select_file_handler() is commonly used to select the file. eficonfig_display_select_file_option() adds an additional menu to clear the selected file. eficonfig_display_select_file_option() is not always necessary for the file selection process, so it must be outside of eficonfig_select_file_handler(). This commit also renames the following functions to avoid confusion. eficonfig_select_file_handler() -> eficonfig_process_select_file() eficonfig_select_file() -> eficonfig_show_file_selection() eficonfig_display_select_file_option() -> eficonfig_process_show_file_option() Finally, test_eficonfig.py need to be updated to get aligned with the above modification. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
1167e88a |
|
14-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix missing variable initialization The 'ret' variable must be initialized before use in eficonfig_delete_invalid_boot_option(). Fixes: c416f1c0bc ("bootmenu: add removable media entries") Addresses-Coverity: 376207 ("Uninitialized variables") Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
3d595ac5 |
|
09-Nov-2022 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: remove superfluous if in eficonfig_edit_boot_option Goto for an immediately succeeding label is superfluous. Fixes: 87d791423ac6 ("eficonfig: menu-driven addition of UEFI boot option") Addresses-Coverity: 376202 ("Identical code for different branches") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
2c0b0c31 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_SECURE_BOOT This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_SECURE_BOOT defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
83f3d121 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_MM_COMM_TEE This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_MM_COMM_TEE defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
88df3634 |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: CTRL+S to save the boot order 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>
|
#
45f5319f |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
menu: remove CTRL+C to quit On the sandbox called without "--terminal raw" CTRL+C leaves U-Boot, "ESC/CTRL+C to quit" is misleading. Let's remove CTRL+C to quit key handling from bootmenu and eficonfig menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
|
#
8dbd0a0f |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add vertical scroll support The current eficonfig menu does not support vertical scroll, so it can not display the menu entries greater than the console row size. This commit add the vertial scroll support. The console size is retrieved by SIMPLE_TEXT_OUTPUT_PROTOCOL.QueryMode() service, then calculates the row size for menu entry by subtracting menu header and description row size from the console row size. "start" and "end" are added in the efimenu structure. "start" keeps the menu entry index at the top, "end" keeps the bottom menu entry index. item_data_print() menu function only draws the menu entry between "start" and "end". This commit also fixes the issue that "Save" and "Quit" entries can be moved by BKEY_PLUS in change boot order menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
0d590852 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation This commit removes the change boot order specific menu implementation. The change boot order implementation calls eficonfig_process_common() same as other menus. The change boot order menu requires own item_data_print and item_choice implementation, but display_statusline function can be a same function as other menus. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
cd160b27 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor eficonfig_process_common function Current change boot order implementation does not call eficonfig_process_common() and call own menu functions for display_statusline, item_data_print and item_choice. Change boot order functionality should call eficonfig_process_common() to improve maintenanceability. This commit is a preparation to remove the change boot order specific implementation. The menu functions (display_statusline, item_data_print and item_choice) are added as argument of eficonfig_process_common(). The menu description string displayed at the bottom of the menu is also added as argument. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
32bab0ea |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Make use of CLI character processing Avoid duplicating some of the escape-sequence processing here and use the CLI function instead. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
d0ca98db |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Update bootmenu_loop() to return the code Use the return value to save having to pass around a pointer. This also resolves any ambiguity about what *key contains when the function is called. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
2da4a15e |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Rename KEY_... to BKEY_... This enum values conflict with linux/input.h so rename them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
64550274 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: avoid SetVariable between GetNextVariableName calls The current code calls efi_set_variable_int() to delete the invalid boot option between calls to efi_get_next_variable_name_int(), it may produce unpredictable results. This commit moves removal of the invalid boot option outside of the efi_get_next_variable_name_int() calls. EFI_NOT_FOUND returned from efi_get_next_variable_name_int() indicates we retrieved all EFI variables, it should be treated as EFI_SUCEESS. To address the checkpatch warning of too many leading tabs, combine two if statement into one. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
ce327084 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: carve out efi_get_next_variable_name_int calls To retrieve the EFI variable name by efi_get_next_variable_name_int(), the sequence of alloc -> efi_get_next_variable_name_int -> realloc -> efi_get_next_variable_name_int is required. In current code, this sequence repeatedly appears in the several functions. It should be curved out a common function. This commit also fixes the missing free() of var_name16 in eficonfig_delete_invalid_boot_option(). Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
140a8959 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use efi_get_next_variable_name_int() eficonfig command reads all possible UEFI load options from 0x0000 to 0xFFFF to construct the menu. This takes too much time in some environment. This commit uses efi_get_next_variable_name_int() to read all existing UEFI load options to significantlly reduce the count of efi_get_var() call. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
78b1ccc4 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use u16_strsize() to get u16 string buffer size Use u16_strsize() to simplify the u16 string buffer size calculation. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c67d3c9e |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix going one directory up issue The directory name in eficonfig menu entry contains the '\' separator. strcmp() argument ".." is wrong and one directory up handling does not work correctly. strcmp() argument must include '\' separator. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c3b5af63 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add UEFI Secure Boot Key enrollment interface This commit adds the menu-driven UEFI Secure Boot Key enrollment interface. User can enroll PK, KEK, db and dbx by selecting file. Only the signed EFI Signature List(s) with an authenticated header, typically '.auth' file, is accepted. To clear the PK, KEK, db and dbx, user needs to enroll the null key signed by PK or KEK. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
21faf4ef |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use protocol interface for file selection EFI_SIMPLE_FILE_SYSTEM_PROTOCOL is not always provided by U-Boot. Use protocol interface functions instead of U-Boot internal functions. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d6566113 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose eficonfig_create_device_path() Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use eficonfig_create_device_path() to construct the full device path from device path of the volume and file path, so move it out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d571f9b2 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation All the eficonfig menus other than "Change Boot Order" use 'eficonfig_entry' structure for each menu entry. This commit refactors change boot order implementation to use 'eficonfig_entry' structure same as other menus to have consistent menu handling. This commit also simplifies the data->active handling when KEY_SPACE is pressed, and sizeof() parameter. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
8961e93e |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose append entry function Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use append_entry() and append_quit_entry() to construct the menu, so move them out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
a84040ab |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor file selection handling eficonfig_select_file_handler() is commonly used to select the file. eficonfig_display_select_file_option() adds an additional menu to clear the selected file. eficonfig_display_select_file_option() is not always necessary for the file selection process, so it must be outside of eficonfig_select_file_handler(). This commit also renames the following functions to avoid confusion. eficonfig_select_file_handler() -> eficonfig_process_select_file() eficonfig_select_file() -> eficonfig_show_file_selection() eficonfig_display_select_file_option() -> eficonfig_process_show_file_option() Finally, test_eficonfig.py need to be updated to get aligned with the above modification. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
1167e88a |
|
14-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix missing variable initialization The 'ret' variable must be initialized before use in eficonfig_delete_invalid_boot_option(). Fixes: c416f1c0bc ("bootmenu: add removable media entries") Addresses-Coverity: 376207 ("Uninitialized variables") Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
3d595ac5 |
|
09-Nov-2022 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: remove superfluous if in eficonfig_edit_boot_option Goto for an immediately succeeding label is superfluous. Fixes: 87d791423ac6 ("eficonfig: menu-driven addition of UEFI boot option") Addresses-Coverity: 376202 ("Identical code for different branches") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
2c0b0c31 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_SECURE_BOOT This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_SECURE_BOOT defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
83f3d121 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_MM_COMM_TEE This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_MM_COMM_TEE defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
88df3634 |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: CTRL+S to save the boot order 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>
|
#
45f5319f |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
menu: remove CTRL+C to quit On the sandbox called without "--terminal raw" CTRL+C leaves U-Boot, "ESC/CTRL+C to quit" is misleading. Let's remove CTRL+C to quit key handling from bootmenu and eficonfig menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
|
#
8dbd0a0f |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add vertical scroll support The current eficonfig menu does not support vertical scroll, so it can not display the menu entries greater than the console row size. This commit add the vertial scroll support. The console size is retrieved by SIMPLE_TEXT_OUTPUT_PROTOCOL.QueryMode() service, then calculates the row size for menu entry by subtracting menu header and description row size from the console row size. "start" and "end" are added in the efimenu structure. "start" keeps the menu entry index at the top, "end" keeps the bottom menu entry index. item_data_print() menu function only draws the menu entry between "start" and "end". This commit also fixes the issue that "Save" and "Quit" entries can be moved by BKEY_PLUS in change boot order menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
0d590852 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation This commit removes the change boot order specific menu implementation. The change boot order implementation calls eficonfig_process_common() same as other menus. The change boot order menu requires own item_data_print and item_choice implementation, but display_statusline function can be a same function as other menus. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
cd160b27 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor eficonfig_process_common function Current change boot order implementation does not call eficonfig_process_common() and call own menu functions for display_statusline, item_data_print and item_choice. Change boot order functionality should call eficonfig_process_common() to improve maintenanceability. This commit is a preparation to remove the change boot order specific implementation. The menu functions (display_statusline, item_data_print and item_choice) are added as argument of eficonfig_process_common(). The menu description string displayed at the bottom of the menu is also added as argument. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
32bab0ea |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Make use of CLI character processing Avoid duplicating some of the escape-sequence processing here and use the CLI function instead. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
d0ca98db |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Update bootmenu_loop() to return the code Use the return value to save having to pass around a pointer. This also resolves any ambiguity about what *key contains when the function is called. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
2da4a15e |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Rename KEY_... to BKEY_... This enum values conflict with linux/input.h so rename them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
64550274 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: avoid SetVariable between GetNextVariableName calls The current code calls efi_set_variable_int() to delete the invalid boot option between calls to efi_get_next_variable_name_int(), it may produce unpredictable results. This commit moves removal of the invalid boot option outside of the efi_get_next_variable_name_int() calls. EFI_NOT_FOUND returned from efi_get_next_variable_name_int() indicates we retrieved all EFI variables, it should be treated as EFI_SUCEESS. To address the checkpatch warning of too many leading tabs, combine two if statement into one. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
ce327084 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: carve out efi_get_next_variable_name_int calls To retrieve the EFI variable name by efi_get_next_variable_name_int(), the sequence of alloc -> efi_get_next_variable_name_int -> realloc -> efi_get_next_variable_name_int is required. In current code, this sequence repeatedly appears in the several functions. It should be curved out a common function. This commit also fixes the missing free() of var_name16 in eficonfig_delete_invalid_boot_option(). Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
140a8959 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use efi_get_next_variable_name_int() eficonfig command reads all possible UEFI load options from 0x0000 to 0xFFFF to construct the menu. This takes too much time in some environment. This commit uses efi_get_next_variable_name_int() to read all existing UEFI load options to significantlly reduce the count of efi_get_var() call. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
78b1ccc4 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use u16_strsize() to get u16 string buffer size Use u16_strsize() to simplify the u16 string buffer size calculation. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c67d3c9e |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix going one directory up issue The directory name in eficonfig menu entry contains the '\' separator. strcmp() argument ".." is wrong and one directory up handling does not work correctly. strcmp() argument must include '\' separator. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c3b5af63 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add UEFI Secure Boot Key enrollment interface This commit adds the menu-driven UEFI Secure Boot Key enrollment interface. User can enroll PK, KEK, db and dbx by selecting file. Only the signed EFI Signature List(s) with an authenticated header, typically '.auth' file, is accepted. To clear the PK, KEK, db and dbx, user needs to enroll the null key signed by PK or KEK. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
21faf4ef |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use protocol interface for file selection EFI_SIMPLE_FILE_SYSTEM_PROTOCOL is not always provided by U-Boot. Use protocol interface functions instead of U-Boot internal functions. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d6566113 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose eficonfig_create_device_path() Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use eficonfig_create_device_path() to construct the full device path from device path of the volume and file path, so move it out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d571f9b2 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation All the eficonfig menus other than "Change Boot Order" use 'eficonfig_entry' structure for each menu entry. This commit refactors change boot order implementation to use 'eficonfig_entry' structure same as other menus to have consistent menu handling. This commit also simplifies the data->active handling when KEY_SPACE is pressed, and sizeof() parameter. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
8961e93e |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose append entry function Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use append_entry() and append_quit_entry() to construct the menu, so move them out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
a84040ab |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor file selection handling eficonfig_select_file_handler() is commonly used to select the file. eficonfig_display_select_file_option() adds an additional menu to clear the selected file. eficonfig_display_select_file_option() is not always necessary for the file selection process, so it must be outside of eficonfig_select_file_handler(). This commit also renames the following functions to avoid confusion. eficonfig_select_file_handler() -> eficonfig_process_select_file() eficonfig_select_file() -> eficonfig_show_file_selection() eficonfig_display_select_file_option() -> eficonfig_process_show_file_option() Finally, test_eficonfig.py need to be updated to get aligned with the above modification. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
1167e88a |
|
14-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix missing variable initialization The 'ret' variable must be initialized before use in eficonfig_delete_invalid_boot_option(). Fixes: c416f1c0bc ("bootmenu: add removable media entries") Addresses-Coverity: 376207 ("Uninitialized variables") Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
3d595ac5 |
|
09-Nov-2022 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: remove superfluous if in eficonfig_edit_boot_option Goto for an immediately succeeding label is superfluous. Fixes: 87d791423ac6 ("eficonfig: menu-driven addition of UEFI boot option") Addresses-Coverity: 376202 ("Identical code for different branches") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
2c0b0c31 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_SECURE_BOOT This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_SECURE_BOOT defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
83f3d121 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_MM_COMM_TEE This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_MM_COMM_TEE defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
88df3634 |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: CTRL+S to save the boot order 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>
|
#
45f5319f |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
menu: remove CTRL+C to quit On the sandbox called without "--terminal raw" CTRL+C leaves U-Boot, "ESC/CTRL+C to quit" is misleading. Let's remove CTRL+C to quit key handling from bootmenu and eficonfig menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
|
#
8dbd0a0f |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add vertical scroll support The current eficonfig menu does not support vertical scroll, so it can not display the menu entries greater than the console row size. This commit add the vertial scroll support. The console size is retrieved by SIMPLE_TEXT_OUTPUT_PROTOCOL.QueryMode() service, then calculates the row size for menu entry by subtracting menu header and description row size from the console row size. "start" and "end" are added in the efimenu structure. "start" keeps the menu entry index at the top, "end" keeps the bottom menu entry index. item_data_print() menu function only draws the menu entry between "start" and "end". This commit also fixes the issue that "Save" and "Quit" entries can be moved by BKEY_PLUS in change boot order menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
0d590852 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation This commit removes the change boot order specific menu implementation. The change boot order implementation calls eficonfig_process_common() same as other menus. The change boot order menu requires own item_data_print and item_choice implementation, but display_statusline function can be a same function as other menus. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
cd160b27 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor eficonfig_process_common function Current change boot order implementation does not call eficonfig_process_common() and call own menu functions for display_statusline, item_data_print and item_choice. Change boot order functionality should call eficonfig_process_common() to improve maintenanceability. This commit is a preparation to remove the change boot order specific implementation. The menu functions (display_statusline, item_data_print and item_choice) are added as argument of eficonfig_process_common(). The menu description string displayed at the bottom of the menu is also added as argument. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
32bab0ea |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Make use of CLI character processing Avoid duplicating some of the escape-sequence processing here and use the CLI function instead. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
d0ca98db |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Update bootmenu_loop() to return the code Use the return value to save having to pass around a pointer. This also resolves any ambiguity about what *key contains when the function is called. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
2da4a15e |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Rename KEY_... to BKEY_... This enum values conflict with linux/input.h so rename them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
64550274 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: avoid SetVariable between GetNextVariableName calls The current code calls efi_set_variable_int() to delete the invalid boot option between calls to efi_get_next_variable_name_int(), it may produce unpredictable results. This commit moves removal of the invalid boot option outside of the efi_get_next_variable_name_int() calls. EFI_NOT_FOUND returned from efi_get_next_variable_name_int() indicates we retrieved all EFI variables, it should be treated as EFI_SUCEESS. To address the checkpatch warning of too many leading tabs, combine two if statement into one. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
ce327084 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: carve out efi_get_next_variable_name_int calls To retrieve the EFI variable name by efi_get_next_variable_name_int(), the sequence of alloc -> efi_get_next_variable_name_int -> realloc -> efi_get_next_variable_name_int is required. In current code, this sequence repeatedly appears in the several functions. It should be curved out a common function. This commit also fixes the missing free() of var_name16 in eficonfig_delete_invalid_boot_option(). Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
140a8959 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use efi_get_next_variable_name_int() eficonfig command reads all possible UEFI load options from 0x0000 to 0xFFFF to construct the menu. This takes too much time in some environment. This commit uses efi_get_next_variable_name_int() to read all existing UEFI load options to significantlly reduce the count of efi_get_var() call. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
78b1ccc4 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use u16_strsize() to get u16 string buffer size Use u16_strsize() to simplify the u16 string buffer size calculation. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c67d3c9e |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix going one directory up issue The directory name in eficonfig menu entry contains the '\' separator. strcmp() argument ".." is wrong and one directory up handling does not work correctly. strcmp() argument must include '\' separator. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c3b5af63 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add UEFI Secure Boot Key enrollment interface This commit adds the menu-driven UEFI Secure Boot Key enrollment interface. User can enroll PK, KEK, db and dbx by selecting file. Only the signed EFI Signature List(s) with an authenticated header, typically '.auth' file, is accepted. To clear the PK, KEK, db and dbx, user needs to enroll the null key signed by PK or KEK. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
21faf4ef |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use protocol interface for file selection EFI_SIMPLE_FILE_SYSTEM_PROTOCOL is not always provided by U-Boot. Use protocol interface functions instead of U-Boot internal functions. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d6566113 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose eficonfig_create_device_path() Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use eficonfig_create_device_path() to construct the full device path from device path of the volume and file path, so move it out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d571f9b2 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation All the eficonfig menus other than "Change Boot Order" use 'eficonfig_entry' structure for each menu entry. This commit refactors change boot order implementation to use 'eficonfig_entry' structure same as other menus to have consistent menu handling. This commit also simplifies the data->active handling when KEY_SPACE is pressed, and sizeof() parameter. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
8961e93e |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose append entry function Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use append_entry() and append_quit_entry() to construct the menu, so move them out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
a84040ab |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor file selection handling eficonfig_select_file_handler() is commonly used to select the file. eficonfig_display_select_file_option() adds an additional menu to clear the selected file. eficonfig_display_select_file_option() is not always necessary for the file selection process, so it must be outside of eficonfig_select_file_handler(). This commit also renames the following functions to avoid confusion. eficonfig_select_file_handler() -> eficonfig_process_select_file() eficonfig_select_file() -> eficonfig_show_file_selection() eficonfig_display_select_file_option() -> eficonfig_process_show_file_option() Finally, test_eficonfig.py need to be updated to get aligned with the above modification. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
1167e88a |
|
14-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix missing variable initialization The 'ret' variable must be initialized before use in eficonfig_delete_invalid_boot_option(). Fixes: c416f1c0bc ("bootmenu: add removable media entries") Addresses-Coverity: 376207 ("Uninitialized variables") Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
3d595ac5 |
|
09-Nov-2022 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: remove superfluous if in eficonfig_edit_boot_option Goto for an immediately succeeding label is superfluous. Fixes: 87d791423ac6 ("eficonfig: menu-driven addition of UEFI boot option") Addresses-Coverity: 376202 ("Identical code for different branches") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
2c0b0c31 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_SECURE_BOOT This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_SECURE_BOOT defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
83f3d121 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_MM_COMM_TEE This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_MM_COMM_TEE defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
88df3634 |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: CTRL+S to save the boot order 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>
|
#
45f5319f |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
menu: remove CTRL+C to quit On the sandbox called without "--terminal raw" CTRL+C leaves U-Boot, "ESC/CTRL+C to quit" is misleading. Let's remove CTRL+C to quit key handling from bootmenu and eficonfig menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
|
#
8dbd0a0f |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add vertical scroll support The current eficonfig menu does not support vertical scroll, so it can not display the menu entries greater than the console row size. This commit add the vertial scroll support. The console size is retrieved by SIMPLE_TEXT_OUTPUT_PROTOCOL.QueryMode() service, then calculates the row size for menu entry by subtracting menu header and description row size from the console row size. "start" and "end" are added in the efimenu structure. "start" keeps the menu entry index at the top, "end" keeps the bottom menu entry index. item_data_print() menu function only draws the menu entry between "start" and "end". This commit also fixes the issue that "Save" and "Quit" entries can be moved by BKEY_PLUS in change boot order menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
0d590852 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation This commit removes the change boot order specific menu implementation. The change boot order implementation calls eficonfig_process_common() same as other menus. The change boot order menu requires own item_data_print and item_choice implementation, but display_statusline function can be a same function as other menus. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
cd160b27 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor eficonfig_process_common function Current change boot order implementation does not call eficonfig_process_common() and call own menu functions for display_statusline, item_data_print and item_choice. Change boot order functionality should call eficonfig_process_common() to improve maintenanceability. This commit is a preparation to remove the change boot order specific implementation. The menu functions (display_statusline, item_data_print and item_choice) are added as argument of eficonfig_process_common(). The menu description string displayed at the bottom of the menu is also added as argument. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
32bab0ea |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Make use of CLI character processing Avoid duplicating some of the escape-sequence processing here and use the CLI function instead. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
d0ca98db |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Update bootmenu_loop() to return the code Use the return value to save having to pass around a pointer. This also resolves any ambiguity about what *key contains when the function is called. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
2da4a15e |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Rename KEY_... to BKEY_... This enum values conflict with linux/input.h so rename them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
64550274 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: avoid SetVariable between GetNextVariableName calls The current code calls efi_set_variable_int() to delete the invalid boot option between calls to efi_get_next_variable_name_int(), it may produce unpredictable results. This commit moves removal of the invalid boot option outside of the efi_get_next_variable_name_int() calls. EFI_NOT_FOUND returned from efi_get_next_variable_name_int() indicates we retrieved all EFI variables, it should be treated as EFI_SUCEESS. To address the checkpatch warning of too many leading tabs, combine two if statement into one. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
ce327084 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: carve out efi_get_next_variable_name_int calls To retrieve the EFI variable name by efi_get_next_variable_name_int(), the sequence of alloc -> efi_get_next_variable_name_int -> realloc -> efi_get_next_variable_name_int is required. In current code, this sequence repeatedly appears in the several functions. It should be curved out a common function. This commit also fixes the missing free() of var_name16 in eficonfig_delete_invalid_boot_option(). Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
140a8959 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use efi_get_next_variable_name_int() eficonfig command reads all possible UEFI load options from 0x0000 to 0xFFFF to construct the menu. This takes too much time in some environment. This commit uses efi_get_next_variable_name_int() to read all existing UEFI load options to significantlly reduce the count of efi_get_var() call. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
78b1ccc4 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use u16_strsize() to get u16 string buffer size Use u16_strsize() to simplify the u16 string buffer size calculation. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c67d3c9e |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix going one directory up issue The directory name in eficonfig menu entry contains the '\' separator. strcmp() argument ".." is wrong and one directory up handling does not work correctly. strcmp() argument must include '\' separator. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c3b5af63 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add UEFI Secure Boot Key enrollment interface This commit adds the menu-driven UEFI Secure Boot Key enrollment interface. User can enroll PK, KEK, db and dbx by selecting file. Only the signed EFI Signature List(s) with an authenticated header, typically '.auth' file, is accepted. To clear the PK, KEK, db and dbx, user needs to enroll the null key signed by PK or KEK. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
21faf4ef |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use protocol interface for file selection EFI_SIMPLE_FILE_SYSTEM_PROTOCOL is not always provided by U-Boot. Use protocol interface functions instead of U-Boot internal functions. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d6566113 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose eficonfig_create_device_path() Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use eficonfig_create_device_path() to construct the full device path from device path of the volume and file path, so move it out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d571f9b2 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation All the eficonfig menus other than "Change Boot Order" use 'eficonfig_entry' structure for each menu entry. This commit refactors change boot order implementation to use 'eficonfig_entry' structure same as other menus to have consistent menu handling. This commit also simplifies the data->active handling when KEY_SPACE is pressed, and sizeof() parameter. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
8961e93e |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose append entry function Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use append_entry() and append_quit_entry() to construct the menu, so move them out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
a84040ab |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor file selection handling eficonfig_select_file_handler() is commonly used to select the file. eficonfig_display_select_file_option() adds an additional menu to clear the selected file. eficonfig_display_select_file_option() is not always necessary for the file selection process, so it must be outside of eficonfig_select_file_handler(). This commit also renames the following functions to avoid confusion. eficonfig_select_file_handler() -> eficonfig_process_select_file() eficonfig_select_file() -> eficonfig_show_file_selection() eficonfig_display_select_file_option() -> eficonfig_process_show_file_option() Finally, test_eficonfig.py need to be updated to get aligned with the above modification. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
1167e88a |
|
14-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix missing variable initialization The 'ret' variable must be initialized before use in eficonfig_delete_invalid_boot_option(). Fixes: c416f1c0bc ("bootmenu: add removable media entries") Addresses-Coverity: 376207 ("Uninitialized variables") Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
3d595ac5 |
|
09-Nov-2022 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: remove superfluous if in eficonfig_edit_boot_option Goto for an immediately succeeding label is superfluous. Fixes: 87d791423ac6 ("eficonfig: menu-driven addition of UEFI boot option") Addresses-Coverity: 376202 ("Identical code for different branches") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
2c0b0c31 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_SECURE_BOOT This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_SECURE_BOOT defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
83f3d121 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_MM_COMM_TEE This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_MM_COMM_TEE defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
88df3634 |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: CTRL+S to save the boot order 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>
|
#
45f5319f |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
menu: remove CTRL+C to quit On the sandbox called without "--terminal raw" CTRL+C leaves U-Boot, "ESC/CTRL+C to quit" is misleading. Let's remove CTRL+C to quit key handling from bootmenu and eficonfig menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
|
#
8dbd0a0f |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add vertical scroll support The current eficonfig menu does not support vertical scroll, so it can not display the menu entries greater than the console row size. This commit add the vertial scroll support. The console size is retrieved by SIMPLE_TEXT_OUTPUT_PROTOCOL.QueryMode() service, then calculates the row size for menu entry by subtracting menu header and description row size from the console row size. "start" and "end" are added in the efimenu structure. "start" keeps the menu entry index at the top, "end" keeps the bottom menu entry index. item_data_print() menu function only draws the menu entry between "start" and "end". This commit also fixes the issue that "Save" and "Quit" entries can be moved by BKEY_PLUS in change boot order menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
0d590852 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation This commit removes the change boot order specific menu implementation. The change boot order implementation calls eficonfig_process_common() same as other menus. The change boot order menu requires own item_data_print and item_choice implementation, but display_statusline function can be a same function as other menus. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
cd160b27 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor eficonfig_process_common function Current change boot order implementation does not call eficonfig_process_common() and call own menu functions for display_statusline, item_data_print and item_choice. Change boot order functionality should call eficonfig_process_common() to improve maintenanceability. This commit is a preparation to remove the change boot order specific implementation. The menu functions (display_statusline, item_data_print and item_choice) are added as argument of eficonfig_process_common(). The menu description string displayed at the bottom of the menu is also added as argument. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
32bab0ea |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Make use of CLI character processing Avoid duplicating some of the escape-sequence processing here and use the CLI function instead. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
d0ca98db |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Update bootmenu_loop() to return the code Use the return value to save having to pass around a pointer. This also resolves any ambiguity about what *key contains when the function is called. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
2da4a15e |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Rename KEY_... to BKEY_... This enum values conflict with linux/input.h so rename them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
64550274 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: avoid SetVariable between GetNextVariableName calls The current code calls efi_set_variable_int() to delete the invalid boot option between calls to efi_get_next_variable_name_int(), it may produce unpredictable results. This commit moves removal of the invalid boot option outside of the efi_get_next_variable_name_int() calls. EFI_NOT_FOUND returned from efi_get_next_variable_name_int() indicates we retrieved all EFI variables, it should be treated as EFI_SUCEESS. To address the checkpatch warning of too many leading tabs, combine two if statement into one. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
ce327084 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: carve out efi_get_next_variable_name_int calls To retrieve the EFI variable name by efi_get_next_variable_name_int(), the sequence of alloc -> efi_get_next_variable_name_int -> realloc -> efi_get_next_variable_name_int is required. In current code, this sequence repeatedly appears in the several functions. It should be curved out a common function. This commit also fixes the missing free() of var_name16 in eficonfig_delete_invalid_boot_option(). Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
140a8959 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use efi_get_next_variable_name_int() eficonfig command reads all possible UEFI load options from 0x0000 to 0xFFFF to construct the menu. This takes too much time in some environment. This commit uses efi_get_next_variable_name_int() to read all existing UEFI load options to significantlly reduce the count of efi_get_var() call. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
78b1ccc4 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use u16_strsize() to get u16 string buffer size Use u16_strsize() to simplify the u16 string buffer size calculation. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c67d3c9e |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix going one directory up issue The directory name in eficonfig menu entry contains the '\' separator. strcmp() argument ".." is wrong and one directory up handling does not work correctly. strcmp() argument must include '\' separator. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c3b5af63 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add UEFI Secure Boot Key enrollment interface This commit adds the menu-driven UEFI Secure Boot Key enrollment interface. User can enroll PK, KEK, db and dbx by selecting file. Only the signed EFI Signature List(s) with an authenticated header, typically '.auth' file, is accepted. To clear the PK, KEK, db and dbx, user needs to enroll the null key signed by PK or KEK. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
21faf4ef |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use protocol interface for file selection EFI_SIMPLE_FILE_SYSTEM_PROTOCOL is not always provided by U-Boot. Use protocol interface functions instead of U-Boot internal functions. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d6566113 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose eficonfig_create_device_path() Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use eficonfig_create_device_path() to construct the full device path from device path of the volume and file path, so move it out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d571f9b2 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation All the eficonfig menus other than "Change Boot Order" use 'eficonfig_entry' structure for each menu entry. This commit refactors change boot order implementation to use 'eficonfig_entry' structure same as other menus to have consistent menu handling. This commit also simplifies the data->active handling when KEY_SPACE is pressed, and sizeof() parameter. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
8961e93e |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose append entry function Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use append_entry() and append_quit_entry() to construct the menu, so move them out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
a84040ab |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor file selection handling eficonfig_select_file_handler() is commonly used to select the file. eficonfig_display_select_file_option() adds an additional menu to clear the selected file. eficonfig_display_select_file_option() is not always necessary for the file selection process, so it must be outside of eficonfig_select_file_handler(). This commit also renames the following functions to avoid confusion. eficonfig_select_file_handler() -> eficonfig_process_select_file() eficonfig_select_file() -> eficonfig_show_file_selection() eficonfig_display_select_file_option() -> eficonfig_process_show_file_option() Finally, test_eficonfig.py need to be updated to get aligned with the above modification. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
1167e88a |
|
14-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix missing variable initialization The 'ret' variable must be initialized before use in eficonfig_delete_invalid_boot_option(). Fixes: c416f1c0bc ("bootmenu: add removable media entries") Addresses-Coverity: 376207 ("Uninitialized variables") Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
3d595ac5 |
|
09-Nov-2022 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: remove superfluous if in eficonfig_edit_boot_option Goto for an immediately succeeding label is superfluous. Fixes: 87d791423ac6 ("eficonfig: menu-driven addition of UEFI boot option") Addresses-Coverity: 376202 ("Identical code for different branches") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
2c0b0c31 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_SECURE_BOOT This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_SECURE_BOOT defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
83f3d121 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_MM_COMM_TEE This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_MM_COMM_TEE defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
88df3634 |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: CTRL+S to save the boot order 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>
|
#
45f5319f |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
menu: remove CTRL+C to quit On the sandbox called without "--terminal raw" CTRL+C leaves U-Boot, "ESC/CTRL+C to quit" is misleading. Let's remove CTRL+C to quit key handling from bootmenu and eficonfig menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
|
#
8dbd0a0f |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add vertical scroll support The current eficonfig menu does not support vertical scroll, so it can not display the menu entries greater than the console row size. This commit add the vertial scroll support. The console size is retrieved by SIMPLE_TEXT_OUTPUT_PROTOCOL.QueryMode() service, then calculates the row size for menu entry by subtracting menu header and description row size from the console row size. "start" and "end" are added in the efimenu structure. "start" keeps the menu entry index at the top, "end" keeps the bottom menu entry index. item_data_print() menu function only draws the menu entry between "start" and "end". This commit also fixes the issue that "Save" and "Quit" entries can be moved by BKEY_PLUS in change boot order menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
0d590852 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation This commit removes the change boot order specific menu implementation. The change boot order implementation calls eficonfig_process_common() same as other menus. The change boot order menu requires own item_data_print and item_choice implementation, but display_statusline function can be a same function as other menus. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
cd160b27 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor eficonfig_process_common function Current change boot order implementation does not call eficonfig_process_common() and call own menu functions for display_statusline, item_data_print and item_choice. Change boot order functionality should call eficonfig_process_common() to improve maintenanceability. This commit is a preparation to remove the change boot order specific implementation. The menu functions (display_statusline, item_data_print and item_choice) are added as argument of eficonfig_process_common(). The menu description string displayed at the bottom of the menu is also added as argument. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
32bab0ea |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Make use of CLI character processing Avoid duplicating some of the escape-sequence processing here and use the CLI function instead. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
d0ca98db |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Update bootmenu_loop() to return the code Use the return value to save having to pass around a pointer. This also resolves any ambiguity about what *key contains when the function is called. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
2da4a15e |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Rename KEY_... to BKEY_... This enum values conflict with linux/input.h so rename them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
64550274 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: avoid SetVariable between GetNextVariableName calls The current code calls efi_set_variable_int() to delete the invalid boot option between calls to efi_get_next_variable_name_int(), it may produce unpredictable results. This commit moves removal of the invalid boot option outside of the efi_get_next_variable_name_int() calls. EFI_NOT_FOUND returned from efi_get_next_variable_name_int() indicates we retrieved all EFI variables, it should be treated as EFI_SUCEESS. To address the checkpatch warning of too many leading tabs, combine two if statement into one. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
ce327084 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: carve out efi_get_next_variable_name_int calls To retrieve the EFI variable name by efi_get_next_variable_name_int(), the sequence of alloc -> efi_get_next_variable_name_int -> realloc -> efi_get_next_variable_name_int is required. In current code, this sequence repeatedly appears in the several functions. It should be curved out a common function. This commit also fixes the missing free() of var_name16 in eficonfig_delete_invalid_boot_option(). Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
140a8959 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use efi_get_next_variable_name_int() eficonfig command reads all possible UEFI load options from 0x0000 to 0xFFFF to construct the menu. This takes too much time in some environment. This commit uses efi_get_next_variable_name_int() to read all existing UEFI load options to significantlly reduce the count of efi_get_var() call. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
78b1ccc4 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use u16_strsize() to get u16 string buffer size Use u16_strsize() to simplify the u16 string buffer size calculation. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c67d3c9e |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix going one directory up issue The directory name in eficonfig menu entry contains the '\' separator. strcmp() argument ".." is wrong and one directory up handling does not work correctly. strcmp() argument must include '\' separator. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c3b5af63 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add UEFI Secure Boot Key enrollment interface This commit adds the menu-driven UEFI Secure Boot Key enrollment interface. User can enroll PK, KEK, db and dbx by selecting file. Only the signed EFI Signature List(s) with an authenticated header, typically '.auth' file, is accepted. To clear the PK, KEK, db and dbx, user needs to enroll the null key signed by PK or KEK. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
21faf4ef |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use protocol interface for file selection EFI_SIMPLE_FILE_SYSTEM_PROTOCOL is not always provided by U-Boot. Use protocol interface functions instead of U-Boot internal functions. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d6566113 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose eficonfig_create_device_path() Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use eficonfig_create_device_path() to construct the full device path from device path of the volume and file path, so move it out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d571f9b2 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation All the eficonfig menus other than "Change Boot Order" use 'eficonfig_entry' structure for each menu entry. This commit refactors change boot order implementation to use 'eficonfig_entry' structure same as other menus to have consistent menu handling. This commit also simplifies the data->active handling when KEY_SPACE is pressed, and sizeof() parameter. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
8961e93e |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose append entry function Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use append_entry() and append_quit_entry() to construct the menu, so move them out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
a84040ab |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor file selection handling eficonfig_select_file_handler() is commonly used to select the file. eficonfig_display_select_file_option() adds an additional menu to clear the selected file. eficonfig_display_select_file_option() is not always necessary for the file selection process, so it must be outside of eficonfig_select_file_handler(). This commit also renames the following functions to avoid confusion. eficonfig_select_file_handler() -> eficonfig_process_select_file() eficonfig_select_file() -> eficonfig_show_file_selection() eficonfig_display_select_file_option() -> eficonfig_process_show_file_option() Finally, test_eficonfig.py need to be updated to get aligned with the above modification. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
1167e88a |
|
14-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix missing variable initialization The 'ret' variable must be initialized before use in eficonfig_delete_invalid_boot_option(). Fixes: c416f1c0bc ("bootmenu: add removable media entries") Addresses-Coverity: 376207 ("Uninitialized variables") Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
3d595ac5 |
|
09-Nov-2022 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: remove superfluous if in eficonfig_edit_boot_option Goto for an immediately succeeding label is superfluous. Fixes: 87d791423ac6 ("eficonfig: menu-driven addition of UEFI boot option") Addresses-Coverity: 376202 ("Identical code for different branches") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
2c0b0c31 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_SECURE_BOOT This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_SECURE_BOOT defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
83f3d121 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_MM_COMM_TEE This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_MM_COMM_TEE defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
88df3634 |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: CTRL+S to save the boot order 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>
|
#
45f5319f |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
menu: remove CTRL+C to quit On the sandbox called without "--terminal raw" CTRL+C leaves U-Boot, "ESC/CTRL+C to quit" is misleading. Let's remove CTRL+C to quit key handling from bootmenu and eficonfig menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
|
#
8dbd0a0f |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add vertical scroll support The current eficonfig menu does not support vertical scroll, so it can not display the menu entries greater than the console row size. This commit add the vertial scroll support. The console size is retrieved by SIMPLE_TEXT_OUTPUT_PROTOCOL.QueryMode() service, then calculates the row size for menu entry by subtracting menu header and description row size from the console row size. "start" and "end" are added in the efimenu structure. "start" keeps the menu entry index at the top, "end" keeps the bottom menu entry index. item_data_print() menu function only draws the menu entry between "start" and "end". This commit also fixes the issue that "Save" and "Quit" entries can be moved by BKEY_PLUS in change boot order menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
0d590852 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation This commit removes the change boot order specific menu implementation. The change boot order implementation calls eficonfig_process_common() same as other menus. The change boot order menu requires own item_data_print and item_choice implementation, but display_statusline function can be a same function as other menus. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
cd160b27 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor eficonfig_process_common function Current change boot order implementation does not call eficonfig_process_common() and call own menu functions for display_statusline, item_data_print and item_choice. Change boot order functionality should call eficonfig_process_common() to improve maintenanceability. This commit is a preparation to remove the change boot order specific implementation. The menu functions (display_statusline, item_data_print and item_choice) are added as argument of eficonfig_process_common(). The menu description string displayed at the bottom of the menu is also added as argument. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
32bab0ea |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Make use of CLI character processing Avoid duplicating some of the escape-sequence processing here and use the CLI function instead. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
d0ca98db |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Update bootmenu_loop() to return the code Use the return value to save having to pass around a pointer. This also resolves any ambiguity about what *key contains when the function is called. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
2da4a15e |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Rename KEY_... to BKEY_... This enum values conflict with linux/input.h so rename them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
64550274 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: avoid SetVariable between GetNextVariableName calls The current code calls efi_set_variable_int() to delete the invalid boot option between calls to efi_get_next_variable_name_int(), it may produce unpredictable results. This commit moves removal of the invalid boot option outside of the efi_get_next_variable_name_int() calls. EFI_NOT_FOUND returned from efi_get_next_variable_name_int() indicates we retrieved all EFI variables, it should be treated as EFI_SUCEESS. To address the checkpatch warning of too many leading tabs, combine two if statement into one. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
ce327084 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: carve out efi_get_next_variable_name_int calls To retrieve the EFI variable name by efi_get_next_variable_name_int(), the sequence of alloc -> efi_get_next_variable_name_int -> realloc -> efi_get_next_variable_name_int is required. In current code, this sequence repeatedly appears in the several functions. It should be curved out a common function. This commit also fixes the missing free() of var_name16 in eficonfig_delete_invalid_boot_option(). Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
140a8959 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use efi_get_next_variable_name_int() eficonfig command reads all possible UEFI load options from 0x0000 to 0xFFFF to construct the menu. This takes too much time in some environment. This commit uses efi_get_next_variable_name_int() to read all existing UEFI load options to significantlly reduce the count of efi_get_var() call. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
78b1ccc4 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use u16_strsize() to get u16 string buffer size Use u16_strsize() to simplify the u16 string buffer size calculation. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c67d3c9e |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix going one directory up issue The directory name in eficonfig menu entry contains the '\' separator. strcmp() argument ".." is wrong and one directory up handling does not work correctly. strcmp() argument must include '\' separator. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c3b5af63 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add UEFI Secure Boot Key enrollment interface This commit adds the menu-driven UEFI Secure Boot Key enrollment interface. User can enroll PK, KEK, db and dbx by selecting file. Only the signed EFI Signature List(s) with an authenticated header, typically '.auth' file, is accepted. To clear the PK, KEK, db and dbx, user needs to enroll the null key signed by PK or KEK. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
21faf4ef |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use protocol interface for file selection EFI_SIMPLE_FILE_SYSTEM_PROTOCOL is not always provided by U-Boot. Use protocol interface functions instead of U-Boot internal functions. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d6566113 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose eficonfig_create_device_path() Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use eficonfig_create_device_path() to construct the full device path from device path of the volume and file path, so move it out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d571f9b2 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation All the eficonfig menus other than "Change Boot Order" use 'eficonfig_entry' structure for each menu entry. This commit refactors change boot order implementation to use 'eficonfig_entry' structure same as other menus to have consistent menu handling. This commit also simplifies the data->active handling when KEY_SPACE is pressed, and sizeof() parameter. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
8961e93e |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose append entry function Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use append_entry() and append_quit_entry() to construct the menu, so move them out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
a84040ab |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor file selection handling eficonfig_select_file_handler() is commonly used to select the file. eficonfig_display_select_file_option() adds an additional menu to clear the selected file. eficonfig_display_select_file_option() is not always necessary for the file selection process, so it must be outside of eficonfig_select_file_handler(). This commit also renames the following functions to avoid confusion. eficonfig_select_file_handler() -> eficonfig_process_select_file() eficonfig_select_file() -> eficonfig_show_file_selection() eficonfig_display_select_file_option() -> eficonfig_process_show_file_option() Finally, test_eficonfig.py need to be updated to get aligned with the above modification. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
1167e88a |
|
14-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix missing variable initialization The 'ret' variable must be initialized before use in eficonfig_delete_invalid_boot_option(). Fixes: c416f1c0bc ("bootmenu: add removable media entries") Addresses-Coverity: 376207 ("Uninitialized variables") Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
3d595ac5 |
|
09-Nov-2022 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: remove superfluous if in eficonfig_edit_boot_option Goto for an immediately succeeding label is superfluous. Fixes: 87d791423ac6 ("eficonfig: menu-driven addition of UEFI boot option") Addresses-Coverity: 376202 ("Identical code for different branches") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
2c0b0c31 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_SECURE_BOOT This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_SECURE_BOOT defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
83f3d121 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_MM_COMM_TEE This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_MM_COMM_TEE defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
88df3634 |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: CTRL+S to save the boot order 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>
|
#
45f5319f |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
menu: remove CTRL+C to quit On the sandbox called without "--terminal raw" CTRL+C leaves U-Boot, "ESC/CTRL+C to quit" is misleading. Let's remove CTRL+C to quit key handling from bootmenu and eficonfig menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
|
#
8dbd0a0f |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add vertical scroll support The current eficonfig menu does not support vertical scroll, so it can not display the menu entries greater than the console row size. This commit add the vertial scroll support. The console size is retrieved by SIMPLE_TEXT_OUTPUT_PROTOCOL.QueryMode() service, then calculates the row size for menu entry by subtracting menu header and description row size from the console row size. "start" and "end" are added in the efimenu structure. "start" keeps the menu entry index at the top, "end" keeps the bottom menu entry index. item_data_print() menu function only draws the menu entry between "start" and "end". This commit also fixes the issue that "Save" and "Quit" entries can be moved by BKEY_PLUS in change boot order menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
0d590852 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation This commit removes the change boot order specific menu implementation. The change boot order implementation calls eficonfig_process_common() same as other menus. The change boot order menu requires own item_data_print and item_choice implementation, but display_statusline function can be a same function as other menus. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
cd160b27 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor eficonfig_process_common function Current change boot order implementation does not call eficonfig_process_common() and call own menu functions for display_statusline, item_data_print and item_choice. Change boot order functionality should call eficonfig_process_common() to improve maintenanceability. This commit is a preparation to remove the change boot order specific implementation. The menu functions (display_statusline, item_data_print and item_choice) are added as argument of eficonfig_process_common(). The menu description string displayed at the bottom of the menu is also added as argument. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
32bab0ea |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Make use of CLI character processing Avoid duplicating some of the escape-sequence processing here and use the CLI function instead. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
d0ca98db |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Update bootmenu_loop() to return the code Use the return value to save having to pass around a pointer. This also resolves any ambiguity about what *key contains when the function is called. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
2da4a15e |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Rename KEY_... to BKEY_... This enum values conflict with linux/input.h so rename them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
64550274 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: avoid SetVariable between GetNextVariableName calls The current code calls efi_set_variable_int() to delete the invalid boot option between calls to efi_get_next_variable_name_int(), it may produce unpredictable results. This commit moves removal of the invalid boot option outside of the efi_get_next_variable_name_int() calls. EFI_NOT_FOUND returned from efi_get_next_variable_name_int() indicates we retrieved all EFI variables, it should be treated as EFI_SUCEESS. To address the checkpatch warning of too many leading tabs, combine two if statement into one. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
ce327084 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: carve out efi_get_next_variable_name_int calls To retrieve the EFI variable name by efi_get_next_variable_name_int(), the sequence of alloc -> efi_get_next_variable_name_int -> realloc -> efi_get_next_variable_name_int is required. In current code, this sequence repeatedly appears in the several functions. It should be curved out a common function. This commit also fixes the missing free() of var_name16 in eficonfig_delete_invalid_boot_option(). Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
140a8959 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use efi_get_next_variable_name_int() eficonfig command reads all possible UEFI load options from 0x0000 to 0xFFFF to construct the menu. This takes too much time in some environment. This commit uses efi_get_next_variable_name_int() to read all existing UEFI load options to significantlly reduce the count of efi_get_var() call. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
78b1ccc4 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use u16_strsize() to get u16 string buffer size Use u16_strsize() to simplify the u16 string buffer size calculation. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c67d3c9e |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix going one directory up issue The directory name in eficonfig menu entry contains the '\' separator. strcmp() argument ".." is wrong and one directory up handling does not work correctly. strcmp() argument must include '\' separator. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c3b5af63 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add UEFI Secure Boot Key enrollment interface This commit adds the menu-driven UEFI Secure Boot Key enrollment interface. User can enroll PK, KEK, db and dbx by selecting file. Only the signed EFI Signature List(s) with an authenticated header, typically '.auth' file, is accepted. To clear the PK, KEK, db and dbx, user needs to enroll the null key signed by PK or KEK. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
21faf4ef |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use protocol interface for file selection EFI_SIMPLE_FILE_SYSTEM_PROTOCOL is not always provided by U-Boot. Use protocol interface functions instead of U-Boot internal functions. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d6566113 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose eficonfig_create_device_path() Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use eficonfig_create_device_path() to construct the full device path from device path of the volume and file path, so move it out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d571f9b2 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation All the eficonfig menus other than "Change Boot Order" use 'eficonfig_entry' structure for each menu entry. This commit refactors change boot order implementation to use 'eficonfig_entry' structure same as other menus to have consistent menu handling. This commit also simplifies the data->active handling when KEY_SPACE is pressed, and sizeof() parameter. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
8961e93e |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose append entry function Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use append_entry() and append_quit_entry() to construct the menu, so move them out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
a84040ab |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor file selection handling eficonfig_select_file_handler() is commonly used to select the file. eficonfig_display_select_file_option() adds an additional menu to clear the selected file. eficonfig_display_select_file_option() is not always necessary for the file selection process, so it must be outside of eficonfig_select_file_handler(). This commit also renames the following functions to avoid confusion. eficonfig_select_file_handler() -> eficonfig_process_select_file() eficonfig_select_file() -> eficonfig_show_file_selection() eficonfig_display_select_file_option() -> eficonfig_process_show_file_option() Finally, test_eficonfig.py need to be updated to get aligned with the above modification. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
1167e88a |
|
14-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix missing variable initialization The 'ret' variable must be initialized before use in eficonfig_delete_invalid_boot_option(). Fixes: c416f1c0bc ("bootmenu: add removable media entries") Addresses-Coverity: 376207 ("Uninitialized variables") Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
3d595ac5 |
|
09-Nov-2022 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: remove superfluous if in eficonfig_edit_boot_option Goto for an immediately succeeding label is superfluous. Fixes: 87d791423ac6 ("eficonfig: menu-driven addition of UEFI boot option") Addresses-Coverity: 376202 ("Identical code for different branches") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
2c0b0c31 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_SECURE_BOOT This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_SECURE_BOOT defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
83f3d121 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_MM_COMM_TEE This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_MM_COMM_TEE defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
88df3634 |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: CTRL+S to save the boot order 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>
|
#
45f5319f |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
menu: remove CTRL+C to quit On the sandbox called without "--terminal raw" CTRL+C leaves U-Boot, "ESC/CTRL+C to quit" is misleading. Let's remove CTRL+C to quit key handling from bootmenu and eficonfig menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
|
#
8dbd0a0f |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add vertical scroll support The current eficonfig menu does not support vertical scroll, so it can not display the menu entries greater than the console row size. This commit add the vertial scroll support. The console size is retrieved by SIMPLE_TEXT_OUTPUT_PROTOCOL.QueryMode() service, then calculates the row size for menu entry by subtracting menu header and description row size from the console row size. "start" and "end" are added in the efimenu structure. "start" keeps the menu entry index at the top, "end" keeps the bottom menu entry index. item_data_print() menu function only draws the menu entry between "start" and "end". This commit also fixes the issue that "Save" and "Quit" entries can be moved by BKEY_PLUS in change boot order menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
0d590852 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation This commit removes the change boot order specific menu implementation. The change boot order implementation calls eficonfig_process_common() same as other menus. The change boot order menu requires own item_data_print and item_choice implementation, but display_statusline function can be a same function as other menus. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
cd160b27 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor eficonfig_process_common function Current change boot order implementation does not call eficonfig_process_common() and call own menu functions for display_statusline, item_data_print and item_choice. Change boot order functionality should call eficonfig_process_common() to improve maintenanceability. This commit is a preparation to remove the change boot order specific implementation. The menu functions (display_statusline, item_data_print and item_choice) are added as argument of eficonfig_process_common(). The menu description string displayed at the bottom of the menu is also added as argument. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
32bab0ea |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Make use of CLI character processing Avoid duplicating some of the escape-sequence processing here and use the CLI function instead. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
d0ca98db |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Update bootmenu_loop() to return the code Use the return value to save having to pass around a pointer. This also resolves any ambiguity about what *key contains when the function is called. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
2da4a15e |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Rename KEY_... to BKEY_... This enum values conflict with linux/input.h so rename them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
64550274 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: avoid SetVariable between GetNextVariableName calls The current code calls efi_set_variable_int() to delete the invalid boot option between calls to efi_get_next_variable_name_int(), it may produce unpredictable results. This commit moves removal of the invalid boot option outside of the efi_get_next_variable_name_int() calls. EFI_NOT_FOUND returned from efi_get_next_variable_name_int() indicates we retrieved all EFI variables, it should be treated as EFI_SUCEESS. To address the checkpatch warning of too many leading tabs, combine two if statement into one. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
ce327084 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: carve out efi_get_next_variable_name_int calls To retrieve the EFI variable name by efi_get_next_variable_name_int(), the sequence of alloc -> efi_get_next_variable_name_int -> realloc -> efi_get_next_variable_name_int is required. In current code, this sequence repeatedly appears in the several functions. It should be curved out a common function. This commit also fixes the missing free() of var_name16 in eficonfig_delete_invalid_boot_option(). Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
140a8959 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use efi_get_next_variable_name_int() eficonfig command reads all possible UEFI load options from 0x0000 to 0xFFFF to construct the menu. This takes too much time in some environment. This commit uses efi_get_next_variable_name_int() to read all existing UEFI load options to significantlly reduce the count of efi_get_var() call. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
78b1ccc4 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use u16_strsize() to get u16 string buffer size Use u16_strsize() to simplify the u16 string buffer size calculation. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c67d3c9e |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix going one directory up issue The directory name in eficonfig menu entry contains the '\' separator. strcmp() argument ".." is wrong and one directory up handling does not work correctly. strcmp() argument must include '\' separator. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c3b5af63 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add UEFI Secure Boot Key enrollment interface This commit adds the menu-driven UEFI Secure Boot Key enrollment interface. User can enroll PK, KEK, db and dbx by selecting file. Only the signed EFI Signature List(s) with an authenticated header, typically '.auth' file, is accepted. To clear the PK, KEK, db and dbx, user needs to enroll the null key signed by PK or KEK. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
21faf4ef |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use protocol interface for file selection EFI_SIMPLE_FILE_SYSTEM_PROTOCOL is not always provided by U-Boot. Use protocol interface functions instead of U-Boot internal functions. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d6566113 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose eficonfig_create_device_path() Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use eficonfig_create_device_path() to construct the full device path from device path of the volume and file path, so move it out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d571f9b2 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation All the eficonfig menus other than "Change Boot Order" use 'eficonfig_entry' structure for each menu entry. This commit refactors change boot order implementation to use 'eficonfig_entry' structure same as other menus to have consistent menu handling. This commit also simplifies the data->active handling when KEY_SPACE is pressed, and sizeof() parameter. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
8961e93e |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose append entry function Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use append_entry() and append_quit_entry() to construct the menu, so move them out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
a84040ab |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor file selection handling eficonfig_select_file_handler() is commonly used to select the file. eficonfig_display_select_file_option() adds an additional menu to clear the selected file. eficonfig_display_select_file_option() is not always necessary for the file selection process, so it must be outside of eficonfig_select_file_handler(). This commit also renames the following functions to avoid confusion. eficonfig_select_file_handler() -> eficonfig_process_select_file() eficonfig_select_file() -> eficonfig_show_file_selection() eficonfig_display_select_file_option() -> eficonfig_process_show_file_option() Finally, test_eficonfig.py need to be updated to get aligned with the above modification. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
1167e88a |
|
14-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix missing variable initialization The 'ret' variable must be initialized before use in eficonfig_delete_invalid_boot_option(). Fixes: c416f1c0bc ("bootmenu: add removable media entries") Addresses-Coverity: 376207 ("Uninitialized variables") Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
3d595ac5 |
|
09-Nov-2022 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: remove superfluous if in eficonfig_edit_boot_option Goto for an immediately succeeding label is superfluous. Fixes: 87d791423ac6 ("eficonfig: menu-driven addition of UEFI boot option") Addresses-Coverity: 376202 ("Identical code for different branches") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
2c0b0c31 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_SECURE_BOOT This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_SECURE_BOOT defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
83f3d121 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_MM_COMM_TEE This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_MM_COMM_TEE defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
88df3634 |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: CTRL+S to save the boot order 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>
|
#
45f5319f |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
menu: remove CTRL+C to quit On the sandbox called without "--terminal raw" CTRL+C leaves U-Boot, "ESC/CTRL+C to quit" is misleading. Let's remove CTRL+C to quit key handling from bootmenu and eficonfig menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
|
#
8dbd0a0f |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add vertical scroll support The current eficonfig menu does not support vertical scroll, so it can not display the menu entries greater than the console row size. This commit add the vertial scroll support. The console size is retrieved by SIMPLE_TEXT_OUTPUT_PROTOCOL.QueryMode() service, then calculates the row size for menu entry by subtracting menu header and description row size from the console row size. "start" and "end" are added in the efimenu structure. "start" keeps the menu entry index at the top, "end" keeps the bottom menu entry index. item_data_print() menu function only draws the menu entry between "start" and "end". This commit also fixes the issue that "Save" and "Quit" entries can be moved by BKEY_PLUS in change boot order menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
0d590852 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation This commit removes the change boot order specific menu implementation. The change boot order implementation calls eficonfig_process_common() same as other menus. The change boot order menu requires own item_data_print and item_choice implementation, but display_statusline function can be a same function as other menus. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
cd160b27 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor eficonfig_process_common function Current change boot order implementation does not call eficonfig_process_common() and call own menu functions for display_statusline, item_data_print and item_choice. Change boot order functionality should call eficonfig_process_common() to improve maintenanceability. This commit is a preparation to remove the change boot order specific implementation. The menu functions (display_statusline, item_data_print and item_choice) are added as argument of eficonfig_process_common(). The menu description string displayed at the bottom of the menu is also added as argument. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
32bab0ea |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Make use of CLI character processing Avoid duplicating some of the escape-sequence processing here and use the CLI function instead. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
d0ca98db |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Update bootmenu_loop() to return the code Use the return value to save having to pass around a pointer. This also resolves any ambiguity about what *key contains when the function is called. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
2da4a15e |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Rename KEY_... to BKEY_... This enum values conflict with linux/input.h so rename them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
64550274 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: avoid SetVariable between GetNextVariableName calls The current code calls efi_set_variable_int() to delete the invalid boot option between calls to efi_get_next_variable_name_int(), it may produce unpredictable results. This commit moves removal of the invalid boot option outside of the efi_get_next_variable_name_int() calls. EFI_NOT_FOUND returned from efi_get_next_variable_name_int() indicates we retrieved all EFI variables, it should be treated as EFI_SUCEESS. To address the checkpatch warning of too many leading tabs, combine two if statement into one. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
ce327084 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: carve out efi_get_next_variable_name_int calls To retrieve the EFI variable name by efi_get_next_variable_name_int(), the sequence of alloc -> efi_get_next_variable_name_int -> realloc -> efi_get_next_variable_name_int is required. In current code, this sequence repeatedly appears in the several functions. It should be curved out a common function. This commit also fixes the missing free() of var_name16 in eficonfig_delete_invalid_boot_option(). Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
140a8959 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use efi_get_next_variable_name_int() eficonfig command reads all possible UEFI load options from 0x0000 to 0xFFFF to construct the menu. This takes too much time in some environment. This commit uses efi_get_next_variable_name_int() to read all existing UEFI load options to significantlly reduce the count of efi_get_var() call. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
78b1ccc4 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use u16_strsize() to get u16 string buffer size Use u16_strsize() to simplify the u16 string buffer size calculation. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c67d3c9e |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix going one directory up issue The directory name in eficonfig menu entry contains the '\' separator. strcmp() argument ".." is wrong and one directory up handling does not work correctly. strcmp() argument must include '\' separator. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c3b5af63 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add UEFI Secure Boot Key enrollment interface This commit adds the menu-driven UEFI Secure Boot Key enrollment interface. User can enroll PK, KEK, db and dbx by selecting file. Only the signed EFI Signature List(s) with an authenticated header, typically '.auth' file, is accepted. To clear the PK, KEK, db and dbx, user needs to enroll the null key signed by PK or KEK. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
21faf4ef |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use protocol interface for file selection EFI_SIMPLE_FILE_SYSTEM_PROTOCOL is not always provided by U-Boot. Use protocol interface functions instead of U-Boot internal functions. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d6566113 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose eficonfig_create_device_path() Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use eficonfig_create_device_path() to construct the full device path from device path of the volume and file path, so move it out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d571f9b2 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation All the eficonfig menus other than "Change Boot Order" use 'eficonfig_entry' structure for each menu entry. This commit refactors change boot order implementation to use 'eficonfig_entry' structure same as other menus to have consistent menu handling. This commit also simplifies the data->active handling when KEY_SPACE is pressed, and sizeof() parameter. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
8961e93e |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose append entry function Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use append_entry() and append_quit_entry() to construct the menu, so move them out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
a84040ab |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor file selection handling eficonfig_select_file_handler() is commonly used to select the file. eficonfig_display_select_file_option() adds an additional menu to clear the selected file. eficonfig_display_select_file_option() is not always necessary for the file selection process, so it must be outside of eficonfig_select_file_handler(). This commit also renames the following functions to avoid confusion. eficonfig_select_file_handler() -> eficonfig_process_select_file() eficonfig_select_file() -> eficonfig_show_file_selection() eficonfig_display_select_file_option() -> eficonfig_process_show_file_option() Finally, test_eficonfig.py need to be updated to get aligned with the above modification. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
1167e88a |
|
14-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix missing variable initialization The 'ret' variable must be initialized before use in eficonfig_delete_invalid_boot_option(). Fixes: c416f1c0bc ("bootmenu: add removable media entries") Addresses-Coverity: 376207 ("Uninitialized variables") Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
3d595ac5 |
|
09-Nov-2022 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: remove superfluous if in eficonfig_edit_boot_option Goto for an immediately succeeding label is superfluous. Fixes: 87d791423ac6 ("eficonfig: menu-driven addition of UEFI boot option") Addresses-Coverity: 376202 ("Identical code for different branches") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
2c0b0c31 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_SECURE_BOOT This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_SECURE_BOOT defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
83f3d121 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_MM_COMM_TEE This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_MM_COMM_TEE defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
88df3634 |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: CTRL+S to save the boot order 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>
|
#
45f5319f |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
menu: remove CTRL+C to quit On the sandbox called without "--terminal raw" CTRL+C leaves U-Boot, "ESC/CTRL+C to quit" is misleading. Let's remove CTRL+C to quit key handling from bootmenu and eficonfig menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
|
#
8dbd0a0f |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add vertical scroll support The current eficonfig menu does not support vertical scroll, so it can not display the menu entries greater than the console row size. This commit add the vertial scroll support. The console size is retrieved by SIMPLE_TEXT_OUTPUT_PROTOCOL.QueryMode() service, then calculates the row size for menu entry by subtracting menu header and description row size from the console row size. "start" and "end" are added in the efimenu structure. "start" keeps the menu entry index at the top, "end" keeps the bottom menu entry index. item_data_print() menu function only draws the menu entry between "start" and "end". This commit also fixes the issue that "Save" and "Quit" entries can be moved by BKEY_PLUS in change boot order menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
0d590852 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation This commit removes the change boot order specific menu implementation. The change boot order implementation calls eficonfig_process_common() same as other menus. The change boot order menu requires own item_data_print and item_choice implementation, but display_statusline function can be a same function as other menus. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
cd160b27 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor eficonfig_process_common function Current change boot order implementation does not call eficonfig_process_common() and call own menu functions for display_statusline, item_data_print and item_choice. Change boot order functionality should call eficonfig_process_common() to improve maintenanceability. This commit is a preparation to remove the change boot order specific implementation. The menu functions (display_statusline, item_data_print and item_choice) are added as argument of eficonfig_process_common(). The menu description string displayed at the bottom of the menu is also added as argument. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
32bab0ea |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Make use of CLI character processing Avoid duplicating some of the escape-sequence processing here and use the CLI function instead. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
d0ca98db |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Update bootmenu_loop() to return the code Use the return value to save having to pass around a pointer. This also resolves any ambiguity about what *key contains when the function is called. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
2da4a15e |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Rename KEY_... to BKEY_... This enum values conflict with linux/input.h so rename them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
64550274 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: avoid SetVariable between GetNextVariableName calls The current code calls efi_set_variable_int() to delete the invalid boot option between calls to efi_get_next_variable_name_int(), it may produce unpredictable results. This commit moves removal of the invalid boot option outside of the efi_get_next_variable_name_int() calls. EFI_NOT_FOUND returned from efi_get_next_variable_name_int() indicates we retrieved all EFI variables, it should be treated as EFI_SUCEESS. To address the checkpatch warning of too many leading tabs, combine two if statement into one. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
ce327084 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: carve out efi_get_next_variable_name_int calls To retrieve the EFI variable name by efi_get_next_variable_name_int(), the sequence of alloc -> efi_get_next_variable_name_int -> realloc -> efi_get_next_variable_name_int is required. In current code, this sequence repeatedly appears in the several functions. It should be curved out a common function. This commit also fixes the missing free() of var_name16 in eficonfig_delete_invalid_boot_option(). Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
140a8959 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use efi_get_next_variable_name_int() eficonfig command reads all possible UEFI load options from 0x0000 to 0xFFFF to construct the menu. This takes too much time in some environment. This commit uses efi_get_next_variable_name_int() to read all existing UEFI load options to significantlly reduce the count of efi_get_var() call. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
78b1ccc4 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use u16_strsize() to get u16 string buffer size Use u16_strsize() to simplify the u16 string buffer size calculation. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c67d3c9e |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix going one directory up issue The directory name in eficonfig menu entry contains the '\' separator. strcmp() argument ".." is wrong and one directory up handling does not work correctly. strcmp() argument must include '\' separator. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c3b5af63 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add UEFI Secure Boot Key enrollment interface This commit adds the menu-driven UEFI Secure Boot Key enrollment interface. User can enroll PK, KEK, db and dbx by selecting file. Only the signed EFI Signature List(s) with an authenticated header, typically '.auth' file, is accepted. To clear the PK, KEK, db and dbx, user needs to enroll the null key signed by PK or KEK. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
21faf4ef |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use protocol interface for file selection EFI_SIMPLE_FILE_SYSTEM_PROTOCOL is not always provided by U-Boot. Use protocol interface functions instead of U-Boot internal functions. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d6566113 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose eficonfig_create_device_path() Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use eficonfig_create_device_path() to construct the full device path from device path of the volume and file path, so move it out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d571f9b2 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation All the eficonfig menus other than "Change Boot Order" use 'eficonfig_entry' structure for each menu entry. This commit refactors change boot order implementation to use 'eficonfig_entry' structure same as other menus to have consistent menu handling. This commit also simplifies the data->active handling when KEY_SPACE is pressed, and sizeof() parameter. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
8961e93e |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose append entry function Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use append_entry() and append_quit_entry() to construct the menu, so move them out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
a84040ab |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor file selection handling eficonfig_select_file_handler() is commonly used to select the file. eficonfig_display_select_file_option() adds an additional menu to clear the selected file. eficonfig_display_select_file_option() is not always necessary for the file selection process, so it must be outside of eficonfig_select_file_handler(). This commit also renames the following functions to avoid confusion. eficonfig_select_file_handler() -> eficonfig_process_select_file() eficonfig_select_file() -> eficonfig_show_file_selection() eficonfig_display_select_file_option() -> eficonfig_process_show_file_option() Finally, test_eficonfig.py need to be updated to get aligned with the above modification. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
1167e88a |
|
14-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix missing variable initialization The 'ret' variable must be initialized before use in eficonfig_delete_invalid_boot_option(). Fixes: c416f1c0bc ("bootmenu: add removable media entries") Addresses-Coverity: 376207 ("Uninitialized variables") Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
3d595ac5 |
|
09-Nov-2022 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: remove superfluous if in eficonfig_edit_boot_option Goto for an immediately succeeding label is superfluous. Fixes: 87d791423ac6 ("eficonfig: menu-driven addition of UEFI boot option") Addresses-Coverity: 376202 ("Identical code for different branches") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
2c0b0c31 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_SECURE_BOOT This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_SECURE_BOOT defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
83f3d121 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_MM_COMM_TEE This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_MM_COMM_TEE defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
88df3634 |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: CTRL+S to save the boot order 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>
|
#
45f5319f |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
menu: remove CTRL+C to quit On the sandbox called without "--terminal raw" CTRL+C leaves U-Boot, "ESC/CTRL+C to quit" is misleading. Let's remove CTRL+C to quit key handling from bootmenu and eficonfig menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
|
#
8dbd0a0f |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add vertical scroll support The current eficonfig menu does not support vertical scroll, so it can not display the menu entries greater than the console row size. This commit add the vertial scroll support. The console size is retrieved by SIMPLE_TEXT_OUTPUT_PROTOCOL.QueryMode() service, then calculates the row size for menu entry by subtracting menu header and description row size from the console row size. "start" and "end" are added in the efimenu structure. "start" keeps the menu entry index at the top, "end" keeps the bottom menu entry index. item_data_print() menu function only draws the menu entry between "start" and "end". This commit also fixes the issue that "Save" and "Quit" entries can be moved by BKEY_PLUS in change boot order menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
0d590852 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation This commit removes the change boot order specific menu implementation. The change boot order implementation calls eficonfig_process_common() same as other menus. The change boot order menu requires own item_data_print and item_choice implementation, but display_statusline function can be a same function as other menus. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
cd160b27 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor eficonfig_process_common function Current change boot order implementation does not call eficonfig_process_common() and call own menu functions for display_statusline, item_data_print and item_choice. Change boot order functionality should call eficonfig_process_common() to improve maintenanceability. This commit is a preparation to remove the change boot order specific implementation. The menu functions (display_statusline, item_data_print and item_choice) are added as argument of eficonfig_process_common(). The menu description string displayed at the bottom of the menu is also added as argument. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
32bab0ea |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Make use of CLI character processing Avoid duplicating some of the escape-sequence processing here and use the CLI function instead. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
d0ca98db |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Update bootmenu_loop() to return the code Use the return value to save having to pass around a pointer. This also resolves any ambiguity about what *key contains when the function is called. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
2da4a15e |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Rename KEY_... to BKEY_... This enum values conflict with linux/input.h so rename them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
64550274 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: avoid SetVariable between GetNextVariableName calls The current code calls efi_set_variable_int() to delete the invalid boot option between calls to efi_get_next_variable_name_int(), it may produce unpredictable results. This commit moves removal of the invalid boot option outside of the efi_get_next_variable_name_int() calls. EFI_NOT_FOUND returned from efi_get_next_variable_name_int() indicates we retrieved all EFI variables, it should be treated as EFI_SUCEESS. To address the checkpatch warning of too many leading tabs, combine two if statement into one. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
ce327084 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: carve out efi_get_next_variable_name_int calls To retrieve the EFI variable name by efi_get_next_variable_name_int(), the sequence of alloc -> efi_get_next_variable_name_int -> realloc -> efi_get_next_variable_name_int is required. In current code, this sequence repeatedly appears in the several functions. It should be curved out a common function. This commit also fixes the missing free() of var_name16 in eficonfig_delete_invalid_boot_option(). Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
140a8959 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use efi_get_next_variable_name_int() eficonfig command reads all possible UEFI load options from 0x0000 to 0xFFFF to construct the menu. This takes too much time in some environment. This commit uses efi_get_next_variable_name_int() to read all existing UEFI load options to significantlly reduce the count of efi_get_var() call. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
78b1ccc4 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use u16_strsize() to get u16 string buffer size Use u16_strsize() to simplify the u16 string buffer size calculation. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c67d3c9e |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix going one directory up issue The directory name in eficonfig menu entry contains the '\' separator. strcmp() argument ".." is wrong and one directory up handling does not work correctly. strcmp() argument must include '\' separator. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c3b5af63 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add UEFI Secure Boot Key enrollment interface This commit adds the menu-driven UEFI Secure Boot Key enrollment interface. User can enroll PK, KEK, db and dbx by selecting file. Only the signed EFI Signature List(s) with an authenticated header, typically '.auth' file, is accepted. To clear the PK, KEK, db and dbx, user needs to enroll the null key signed by PK or KEK. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
21faf4ef |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use protocol interface for file selection EFI_SIMPLE_FILE_SYSTEM_PROTOCOL is not always provided by U-Boot. Use protocol interface functions instead of U-Boot internal functions. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d6566113 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose eficonfig_create_device_path() Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use eficonfig_create_device_path() to construct the full device path from device path of the volume and file path, so move it out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d571f9b2 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation All the eficonfig menus other than "Change Boot Order" use 'eficonfig_entry' structure for each menu entry. This commit refactors change boot order implementation to use 'eficonfig_entry' structure same as other menus to have consistent menu handling. This commit also simplifies the data->active handling when KEY_SPACE is pressed, and sizeof() parameter. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
8961e93e |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose append entry function Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use append_entry() and append_quit_entry() to construct the menu, so move them out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
a84040ab |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor file selection handling eficonfig_select_file_handler() is commonly used to select the file. eficonfig_display_select_file_option() adds an additional menu to clear the selected file. eficonfig_display_select_file_option() is not always necessary for the file selection process, so it must be outside of eficonfig_select_file_handler(). This commit also renames the following functions to avoid confusion. eficonfig_select_file_handler() -> eficonfig_process_select_file() eficonfig_select_file() -> eficonfig_show_file_selection() eficonfig_display_select_file_option() -> eficonfig_process_show_file_option() Finally, test_eficonfig.py need to be updated to get aligned with the above modification. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
1167e88a |
|
14-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix missing variable initialization The 'ret' variable must be initialized before use in eficonfig_delete_invalid_boot_option(). Fixes: c416f1c0bc ("bootmenu: add removable media entries") Addresses-Coverity: 376207 ("Uninitialized variables") Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
3d595ac5 |
|
09-Nov-2022 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: remove superfluous if in eficonfig_edit_boot_option Goto for an immediately succeeding label is superfluous. Fixes: 87d791423ac6 ("eficonfig: menu-driven addition of UEFI boot option") Addresses-Coverity: 376202 ("Identical code for different branches") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
2c0b0c31 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_SECURE_BOOT This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_SECURE_BOOT defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
83f3d121 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_MM_COMM_TEE This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_MM_COMM_TEE defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
88df3634 |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: CTRL+S to save the boot order 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>
|
#
45f5319f |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
menu: remove CTRL+C to quit On the sandbox called without "--terminal raw" CTRL+C leaves U-Boot, "ESC/CTRL+C to quit" is misleading. Let's remove CTRL+C to quit key handling from bootmenu and eficonfig menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
|
#
8dbd0a0f |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add vertical scroll support The current eficonfig menu does not support vertical scroll, so it can not display the menu entries greater than the console row size. This commit add the vertial scroll support. The console size is retrieved by SIMPLE_TEXT_OUTPUT_PROTOCOL.QueryMode() service, then calculates the row size for menu entry by subtracting menu header and description row size from the console row size. "start" and "end" are added in the efimenu structure. "start" keeps the menu entry index at the top, "end" keeps the bottom menu entry index. item_data_print() menu function only draws the menu entry between "start" and "end". This commit also fixes the issue that "Save" and "Quit" entries can be moved by BKEY_PLUS in change boot order menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
0d590852 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation This commit removes the change boot order specific menu implementation. The change boot order implementation calls eficonfig_process_common() same as other menus. The change boot order menu requires own item_data_print and item_choice implementation, but display_statusline function can be a same function as other menus. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
cd160b27 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor eficonfig_process_common function Current change boot order implementation does not call eficonfig_process_common() and call own menu functions for display_statusline, item_data_print and item_choice. Change boot order functionality should call eficonfig_process_common() to improve maintenanceability. This commit is a preparation to remove the change boot order specific implementation. The menu functions (display_statusline, item_data_print and item_choice) are added as argument of eficonfig_process_common(). The menu description string displayed at the bottom of the menu is also added as argument. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
32bab0ea |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Make use of CLI character processing Avoid duplicating some of the escape-sequence processing here and use the CLI function instead. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
d0ca98db |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Update bootmenu_loop() to return the code Use the return value to save having to pass around a pointer. This also resolves any ambiguity about what *key contains when the function is called. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
2da4a15e |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Rename KEY_... to BKEY_... This enum values conflict with linux/input.h so rename them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
64550274 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: avoid SetVariable between GetNextVariableName calls The current code calls efi_set_variable_int() to delete the invalid boot option between calls to efi_get_next_variable_name_int(), it may produce unpredictable results. This commit moves removal of the invalid boot option outside of the efi_get_next_variable_name_int() calls. EFI_NOT_FOUND returned from efi_get_next_variable_name_int() indicates we retrieved all EFI variables, it should be treated as EFI_SUCEESS. To address the checkpatch warning of too many leading tabs, combine two if statement into one. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
ce327084 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: carve out efi_get_next_variable_name_int calls To retrieve the EFI variable name by efi_get_next_variable_name_int(), the sequence of alloc -> efi_get_next_variable_name_int -> realloc -> efi_get_next_variable_name_int is required. In current code, this sequence repeatedly appears in the several functions. It should be curved out a common function. This commit also fixes the missing free() of var_name16 in eficonfig_delete_invalid_boot_option(). Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
140a8959 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use efi_get_next_variable_name_int() eficonfig command reads all possible UEFI load options from 0x0000 to 0xFFFF to construct the menu. This takes too much time in some environment. This commit uses efi_get_next_variable_name_int() to read all existing UEFI load options to significantlly reduce the count of efi_get_var() call. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
78b1ccc4 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use u16_strsize() to get u16 string buffer size Use u16_strsize() to simplify the u16 string buffer size calculation. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c67d3c9e |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix going one directory up issue The directory name in eficonfig menu entry contains the '\' separator. strcmp() argument ".." is wrong and one directory up handling does not work correctly. strcmp() argument must include '\' separator. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c3b5af63 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add UEFI Secure Boot Key enrollment interface This commit adds the menu-driven UEFI Secure Boot Key enrollment interface. User can enroll PK, KEK, db and dbx by selecting file. Only the signed EFI Signature List(s) with an authenticated header, typically '.auth' file, is accepted. To clear the PK, KEK, db and dbx, user needs to enroll the null key signed by PK or KEK. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
21faf4ef |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use protocol interface for file selection EFI_SIMPLE_FILE_SYSTEM_PROTOCOL is not always provided by U-Boot. Use protocol interface functions instead of U-Boot internal functions. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d6566113 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose eficonfig_create_device_path() Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use eficonfig_create_device_path() to construct the full device path from device path of the volume and file path, so move it out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d571f9b2 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation All the eficonfig menus other than "Change Boot Order" use 'eficonfig_entry' structure for each menu entry. This commit refactors change boot order implementation to use 'eficonfig_entry' structure same as other menus to have consistent menu handling. This commit also simplifies the data->active handling when KEY_SPACE is pressed, and sizeof() parameter. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
8961e93e |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose append entry function Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use append_entry() and append_quit_entry() to construct the menu, so move them out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
a84040ab |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor file selection handling eficonfig_select_file_handler() is commonly used to select the file. eficonfig_display_select_file_option() adds an additional menu to clear the selected file. eficonfig_display_select_file_option() is not always necessary for the file selection process, so it must be outside of eficonfig_select_file_handler(). This commit also renames the following functions to avoid confusion. eficonfig_select_file_handler() -> eficonfig_process_select_file() eficonfig_select_file() -> eficonfig_show_file_selection() eficonfig_display_select_file_option() -> eficonfig_process_show_file_option() Finally, test_eficonfig.py need to be updated to get aligned with the above modification. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
1167e88a |
|
14-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix missing variable initialization The 'ret' variable must be initialized before use in eficonfig_delete_invalid_boot_option(). Fixes: c416f1c0bc ("bootmenu: add removable media entries") Addresses-Coverity: 376207 ("Uninitialized variables") Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
3d595ac5 |
|
09-Nov-2022 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: remove superfluous if in eficonfig_edit_boot_option Goto for an immediately succeeding label is superfluous. Fixes: 87d791423ac6 ("eficonfig: menu-driven addition of UEFI boot option") Addresses-Coverity: 376202 ("Identical code for different branches") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
2c0b0c31 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_SECURE_BOOT This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_SECURE_BOOT defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
83f3d121 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_MM_COMM_TEE This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_MM_COMM_TEE defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
88df3634 |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: CTRL+S to save the boot order 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>
|
#
45f5319f |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
menu: remove CTRL+C to quit On the sandbox called without "--terminal raw" CTRL+C leaves U-Boot, "ESC/CTRL+C to quit" is misleading. Let's remove CTRL+C to quit key handling from bootmenu and eficonfig menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
|
#
8dbd0a0f |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add vertical scroll support The current eficonfig menu does not support vertical scroll, so it can not display the menu entries greater than the console row size. This commit add the vertial scroll support. The console size is retrieved by SIMPLE_TEXT_OUTPUT_PROTOCOL.QueryMode() service, then calculates the row size for menu entry by subtracting menu header and description row size from the console row size. "start" and "end" are added in the efimenu structure. "start" keeps the menu entry index at the top, "end" keeps the bottom menu entry index. item_data_print() menu function only draws the menu entry between "start" and "end". This commit also fixes the issue that "Save" and "Quit" entries can be moved by BKEY_PLUS in change boot order menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
0d590852 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation This commit removes the change boot order specific menu implementation. The change boot order implementation calls eficonfig_process_common() same as other menus. The change boot order menu requires own item_data_print and item_choice implementation, but display_statusline function can be a same function as other menus. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
cd160b27 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor eficonfig_process_common function Current change boot order implementation does not call eficonfig_process_common() and call own menu functions for display_statusline, item_data_print and item_choice. Change boot order functionality should call eficonfig_process_common() to improve maintenanceability. This commit is a preparation to remove the change boot order specific implementation. The menu functions (display_statusline, item_data_print and item_choice) are added as argument of eficonfig_process_common(). The menu description string displayed at the bottom of the menu is also added as argument. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
32bab0ea |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Make use of CLI character processing Avoid duplicating some of the escape-sequence processing here and use the CLI function instead. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
d0ca98db |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Update bootmenu_loop() to return the code Use the return value to save having to pass around a pointer. This also resolves any ambiguity about what *key contains when the function is called. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
2da4a15e |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Rename KEY_... to BKEY_... This enum values conflict with linux/input.h so rename them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
64550274 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: avoid SetVariable between GetNextVariableName calls The current code calls efi_set_variable_int() to delete the invalid boot option between calls to efi_get_next_variable_name_int(), it may produce unpredictable results. This commit moves removal of the invalid boot option outside of the efi_get_next_variable_name_int() calls. EFI_NOT_FOUND returned from efi_get_next_variable_name_int() indicates we retrieved all EFI variables, it should be treated as EFI_SUCEESS. To address the checkpatch warning of too many leading tabs, combine two if statement into one. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
ce327084 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: carve out efi_get_next_variable_name_int calls To retrieve the EFI variable name by efi_get_next_variable_name_int(), the sequence of alloc -> efi_get_next_variable_name_int -> realloc -> efi_get_next_variable_name_int is required. In current code, this sequence repeatedly appears in the several functions. It should be curved out a common function. This commit also fixes the missing free() of var_name16 in eficonfig_delete_invalid_boot_option(). Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
140a8959 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use efi_get_next_variable_name_int() eficonfig command reads all possible UEFI load options from 0x0000 to 0xFFFF to construct the menu. This takes too much time in some environment. This commit uses efi_get_next_variable_name_int() to read all existing UEFI load options to significantlly reduce the count of efi_get_var() call. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
78b1ccc4 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use u16_strsize() to get u16 string buffer size Use u16_strsize() to simplify the u16 string buffer size calculation. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c67d3c9e |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix going one directory up issue The directory name in eficonfig menu entry contains the '\' separator. strcmp() argument ".." is wrong and one directory up handling does not work correctly. strcmp() argument must include '\' separator. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c3b5af63 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add UEFI Secure Boot Key enrollment interface This commit adds the menu-driven UEFI Secure Boot Key enrollment interface. User can enroll PK, KEK, db and dbx by selecting file. Only the signed EFI Signature List(s) with an authenticated header, typically '.auth' file, is accepted. To clear the PK, KEK, db and dbx, user needs to enroll the null key signed by PK or KEK. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
21faf4ef |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use protocol interface for file selection EFI_SIMPLE_FILE_SYSTEM_PROTOCOL is not always provided by U-Boot. Use protocol interface functions instead of U-Boot internal functions. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d6566113 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose eficonfig_create_device_path() Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use eficonfig_create_device_path() to construct the full device path from device path of the volume and file path, so move it out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d571f9b2 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation All the eficonfig menus other than "Change Boot Order" use 'eficonfig_entry' structure for each menu entry. This commit refactors change boot order implementation to use 'eficonfig_entry' structure same as other menus to have consistent menu handling. This commit also simplifies the data->active handling when KEY_SPACE is pressed, and sizeof() parameter. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
8961e93e |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose append entry function Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use append_entry() and append_quit_entry() to construct the menu, so move them out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
a84040ab |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor file selection handling eficonfig_select_file_handler() is commonly used to select the file. eficonfig_display_select_file_option() adds an additional menu to clear the selected file. eficonfig_display_select_file_option() is not always necessary for the file selection process, so it must be outside of eficonfig_select_file_handler(). This commit also renames the following functions to avoid confusion. eficonfig_select_file_handler() -> eficonfig_process_select_file() eficonfig_select_file() -> eficonfig_show_file_selection() eficonfig_display_select_file_option() -> eficonfig_process_show_file_option() Finally, test_eficonfig.py need to be updated to get aligned with the above modification. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
1167e88a |
|
14-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix missing variable initialization The 'ret' variable must be initialized before use in eficonfig_delete_invalid_boot_option(). Fixes: c416f1c0bc ("bootmenu: add removable media entries") Addresses-Coverity: 376207 ("Uninitialized variables") Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
3d595ac5 |
|
09-Nov-2022 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: remove superfluous if in eficonfig_edit_boot_option Goto for an immediately succeeding label is superfluous. Fixes: 87d791423ac6 ("eficonfig: menu-driven addition of UEFI boot option") Addresses-Coverity: 376202 ("Identical code for different branches") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
2c0b0c31 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_SECURE_BOOT This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_SECURE_BOOT defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
83f3d121 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_MM_COMM_TEE This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_MM_COMM_TEE defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
88df3634 |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: CTRL+S to save the boot order 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>
|
#
45f5319f |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
menu: remove CTRL+C to quit On the sandbox called without "--terminal raw" CTRL+C leaves U-Boot, "ESC/CTRL+C to quit" is misleading. Let's remove CTRL+C to quit key handling from bootmenu and eficonfig menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
|
#
8dbd0a0f |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add vertical scroll support The current eficonfig menu does not support vertical scroll, so it can not display the menu entries greater than the console row size. This commit add the vertial scroll support. The console size is retrieved by SIMPLE_TEXT_OUTPUT_PROTOCOL.QueryMode() service, then calculates the row size for menu entry by subtracting menu header and description row size from the console row size. "start" and "end" are added in the efimenu structure. "start" keeps the menu entry index at the top, "end" keeps the bottom menu entry index. item_data_print() menu function only draws the menu entry between "start" and "end". This commit also fixes the issue that "Save" and "Quit" entries can be moved by BKEY_PLUS in change boot order menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
0d590852 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation This commit removes the change boot order specific menu implementation. The change boot order implementation calls eficonfig_process_common() same as other menus. The change boot order menu requires own item_data_print and item_choice implementation, but display_statusline function can be a same function as other menus. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
cd160b27 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor eficonfig_process_common function Current change boot order implementation does not call eficonfig_process_common() and call own menu functions for display_statusline, item_data_print and item_choice. Change boot order functionality should call eficonfig_process_common() to improve maintenanceability. This commit is a preparation to remove the change boot order specific implementation. The menu functions (display_statusline, item_data_print and item_choice) are added as argument of eficonfig_process_common(). The menu description string displayed at the bottom of the menu is also added as argument. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
32bab0ea |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Make use of CLI character processing Avoid duplicating some of the escape-sequence processing here and use the CLI function instead. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
d0ca98db |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Update bootmenu_loop() to return the code Use the return value to save having to pass around a pointer. This also resolves any ambiguity about what *key contains when the function is called. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
2da4a15e |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Rename KEY_... to BKEY_... This enum values conflict with linux/input.h so rename them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
64550274 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: avoid SetVariable between GetNextVariableName calls The current code calls efi_set_variable_int() to delete the invalid boot option between calls to efi_get_next_variable_name_int(), it may produce unpredictable results. This commit moves removal of the invalid boot option outside of the efi_get_next_variable_name_int() calls. EFI_NOT_FOUND returned from efi_get_next_variable_name_int() indicates we retrieved all EFI variables, it should be treated as EFI_SUCEESS. To address the checkpatch warning of too many leading tabs, combine two if statement into one. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
ce327084 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: carve out efi_get_next_variable_name_int calls To retrieve the EFI variable name by efi_get_next_variable_name_int(), the sequence of alloc -> efi_get_next_variable_name_int -> realloc -> efi_get_next_variable_name_int is required. In current code, this sequence repeatedly appears in the several functions. It should be curved out a common function. This commit also fixes the missing free() of var_name16 in eficonfig_delete_invalid_boot_option(). Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
140a8959 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use efi_get_next_variable_name_int() eficonfig command reads all possible UEFI load options from 0x0000 to 0xFFFF to construct the menu. This takes too much time in some environment. This commit uses efi_get_next_variable_name_int() to read all existing UEFI load options to significantlly reduce the count of efi_get_var() call. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
78b1ccc4 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use u16_strsize() to get u16 string buffer size Use u16_strsize() to simplify the u16 string buffer size calculation. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c67d3c9e |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix going one directory up issue The directory name in eficonfig menu entry contains the '\' separator. strcmp() argument ".." is wrong and one directory up handling does not work correctly. strcmp() argument must include '\' separator. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c3b5af63 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add UEFI Secure Boot Key enrollment interface This commit adds the menu-driven UEFI Secure Boot Key enrollment interface. User can enroll PK, KEK, db and dbx by selecting file. Only the signed EFI Signature List(s) with an authenticated header, typically '.auth' file, is accepted. To clear the PK, KEK, db and dbx, user needs to enroll the null key signed by PK or KEK. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
21faf4ef |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use protocol interface for file selection EFI_SIMPLE_FILE_SYSTEM_PROTOCOL is not always provided by U-Boot. Use protocol interface functions instead of U-Boot internal functions. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d6566113 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose eficonfig_create_device_path() Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use eficonfig_create_device_path() to construct the full device path from device path of the volume and file path, so move it out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d571f9b2 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation All the eficonfig menus other than "Change Boot Order" use 'eficonfig_entry' structure for each menu entry. This commit refactors change boot order implementation to use 'eficonfig_entry' structure same as other menus to have consistent menu handling. This commit also simplifies the data->active handling when KEY_SPACE is pressed, and sizeof() parameter. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
8961e93e |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose append entry function Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use append_entry() and append_quit_entry() to construct the menu, so move them out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
a84040ab |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor file selection handling eficonfig_select_file_handler() is commonly used to select the file. eficonfig_display_select_file_option() adds an additional menu to clear the selected file. eficonfig_display_select_file_option() is not always necessary for the file selection process, so it must be outside of eficonfig_select_file_handler(). This commit also renames the following functions to avoid confusion. eficonfig_select_file_handler() -> eficonfig_process_select_file() eficonfig_select_file() -> eficonfig_show_file_selection() eficonfig_display_select_file_option() -> eficonfig_process_show_file_option() Finally, test_eficonfig.py need to be updated to get aligned with the above modification. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
1167e88a |
|
14-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix missing variable initialization The 'ret' variable must be initialized before use in eficonfig_delete_invalid_boot_option(). Fixes: c416f1c0bc ("bootmenu: add removable media entries") Addresses-Coverity: 376207 ("Uninitialized variables") Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
3d595ac5 |
|
09-Nov-2022 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: remove superfluous if in eficonfig_edit_boot_option Goto for an immediately succeeding label is superfluous. Fixes: 87d791423ac6 ("eficonfig: menu-driven addition of UEFI boot option") Addresses-Coverity: 376202 ("Identical code for different branches") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
2c0b0c31 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_SECURE_BOOT This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_SECURE_BOOT defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
83f3d121 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_MM_COMM_TEE This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_MM_COMM_TEE defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
88df3634 |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: CTRL+S to save the boot order 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>
|
#
45f5319f |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
menu: remove CTRL+C to quit On the sandbox called without "--terminal raw" CTRL+C leaves U-Boot, "ESC/CTRL+C to quit" is misleading. Let's remove CTRL+C to quit key handling from bootmenu and eficonfig menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
|
#
8dbd0a0f |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add vertical scroll support The current eficonfig menu does not support vertical scroll, so it can not display the menu entries greater than the console row size. This commit add the vertial scroll support. The console size is retrieved by SIMPLE_TEXT_OUTPUT_PROTOCOL.QueryMode() service, then calculates the row size for menu entry by subtracting menu header and description row size from the console row size. "start" and "end" are added in the efimenu structure. "start" keeps the menu entry index at the top, "end" keeps the bottom menu entry index. item_data_print() menu function only draws the menu entry between "start" and "end". This commit also fixes the issue that "Save" and "Quit" entries can be moved by BKEY_PLUS in change boot order menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
0d590852 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation This commit removes the change boot order specific menu implementation. The change boot order implementation calls eficonfig_process_common() same as other menus. The change boot order menu requires own item_data_print and item_choice implementation, but display_statusline function can be a same function as other menus. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
cd160b27 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor eficonfig_process_common function Current change boot order implementation does not call eficonfig_process_common() and call own menu functions for display_statusline, item_data_print and item_choice. Change boot order functionality should call eficonfig_process_common() to improve maintenanceability. This commit is a preparation to remove the change boot order specific implementation. The menu functions (display_statusline, item_data_print and item_choice) are added as argument of eficonfig_process_common(). The menu description string displayed at the bottom of the menu is also added as argument. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
32bab0ea |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Make use of CLI character processing Avoid duplicating some of the escape-sequence processing here and use the CLI function instead. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
d0ca98db |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Update bootmenu_loop() to return the code Use the return value to save having to pass around a pointer. This also resolves any ambiguity about what *key contains when the function is called. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
2da4a15e |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Rename KEY_... to BKEY_... This enum values conflict with linux/input.h so rename them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
64550274 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: avoid SetVariable between GetNextVariableName calls The current code calls efi_set_variable_int() to delete the invalid boot option between calls to efi_get_next_variable_name_int(), it may produce unpredictable results. This commit moves removal of the invalid boot option outside of the efi_get_next_variable_name_int() calls. EFI_NOT_FOUND returned from efi_get_next_variable_name_int() indicates we retrieved all EFI variables, it should be treated as EFI_SUCEESS. To address the checkpatch warning of too many leading tabs, combine two if statement into one. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
ce327084 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: carve out efi_get_next_variable_name_int calls To retrieve the EFI variable name by efi_get_next_variable_name_int(), the sequence of alloc -> efi_get_next_variable_name_int -> realloc -> efi_get_next_variable_name_int is required. In current code, this sequence repeatedly appears in the several functions. It should be curved out a common function. This commit also fixes the missing free() of var_name16 in eficonfig_delete_invalid_boot_option(). Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
140a8959 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use efi_get_next_variable_name_int() eficonfig command reads all possible UEFI load options from 0x0000 to 0xFFFF to construct the menu. This takes too much time in some environment. This commit uses efi_get_next_variable_name_int() to read all existing UEFI load options to significantlly reduce the count of efi_get_var() call. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
78b1ccc4 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use u16_strsize() to get u16 string buffer size Use u16_strsize() to simplify the u16 string buffer size calculation. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c67d3c9e |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix going one directory up issue The directory name in eficonfig menu entry contains the '\' separator. strcmp() argument ".." is wrong and one directory up handling does not work correctly. strcmp() argument must include '\' separator. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c3b5af63 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add UEFI Secure Boot Key enrollment interface This commit adds the menu-driven UEFI Secure Boot Key enrollment interface. User can enroll PK, KEK, db and dbx by selecting file. Only the signed EFI Signature List(s) with an authenticated header, typically '.auth' file, is accepted. To clear the PK, KEK, db and dbx, user needs to enroll the null key signed by PK or KEK. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
21faf4ef |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use protocol interface for file selection EFI_SIMPLE_FILE_SYSTEM_PROTOCOL is not always provided by U-Boot. Use protocol interface functions instead of U-Boot internal functions. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d6566113 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose eficonfig_create_device_path() Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use eficonfig_create_device_path() to construct the full device path from device path of the volume and file path, so move it out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d571f9b2 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation All the eficonfig menus other than "Change Boot Order" use 'eficonfig_entry' structure for each menu entry. This commit refactors change boot order implementation to use 'eficonfig_entry' structure same as other menus to have consistent menu handling. This commit also simplifies the data->active handling when KEY_SPACE is pressed, and sizeof() parameter. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
8961e93e |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose append entry function Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use append_entry() and append_quit_entry() to construct the menu, so move them out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
a84040ab |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor file selection handling eficonfig_select_file_handler() is commonly used to select the file. eficonfig_display_select_file_option() adds an additional menu to clear the selected file. eficonfig_display_select_file_option() is not always necessary for the file selection process, so it must be outside of eficonfig_select_file_handler(). This commit also renames the following functions to avoid confusion. eficonfig_select_file_handler() -> eficonfig_process_select_file() eficonfig_select_file() -> eficonfig_show_file_selection() eficonfig_display_select_file_option() -> eficonfig_process_show_file_option() Finally, test_eficonfig.py need to be updated to get aligned with the above modification. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
1167e88a |
|
14-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix missing variable initialization The 'ret' variable must be initialized before use in eficonfig_delete_invalid_boot_option(). Fixes: c416f1c0bc ("bootmenu: add removable media entries") Addresses-Coverity: 376207 ("Uninitialized variables") Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
3d595ac5 |
|
09-Nov-2022 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: remove superfluous if in eficonfig_edit_boot_option Goto for an immediately succeeding label is superfluous. Fixes: 87d791423ac6 ("eficonfig: menu-driven addition of UEFI boot option") Addresses-Coverity: 376202 ("Identical code for different branches") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
2c0b0c31 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_SECURE_BOOT This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_SECURE_BOOT defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
83f3d121 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_MM_COMM_TEE This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_MM_COMM_TEE defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
88df3634 |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: CTRL+S to save the boot order 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>
|
#
45f5319f |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
menu: remove CTRL+C to quit On the sandbox called without "--terminal raw" CTRL+C leaves U-Boot, "ESC/CTRL+C to quit" is misleading. Let's remove CTRL+C to quit key handling from bootmenu and eficonfig menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
|
#
8dbd0a0f |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add vertical scroll support The current eficonfig menu does not support vertical scroll, so it can not display the menu entries greater than the console row size. This commit add the vertial scroll support. The console size is retrieved by SIMPLE_TEXT_OUTPUT_PROTOCOL.QueryMode() service, then calculates the row size for menu entry by subtracting menu header and description row size from the console row size. "start" and "end" are added in the efimenu structure. "start" keeps the menu entry index at the top, "end" keeps the bottom menu entry index. item_data_print() menu function only draws the menu entry between "start" and "end". This commit also fixes the issue that "Save" and "Quit" entries can be moved by BKEY_PLUS in change boot order menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
0d590852 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation This commit removes the change boot order specific menu implementation. The change boot order implementation calls eficonfig_process_common() same as other menus. The change boot order menu requires own item_data_print and item_choice implementation, but display_statusline function can be a same function as other menus. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
cd160b27 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor eficonfig_process_common function Current change boot order implementation does not call eficonfig_process_common() and call own menu functions for display_statusline, item_data_print and item_choice. Change boot order functionality should call eficonfig_process_common() to improve maintenanceability. This commit is a preparation to remove the change boot order specific implementation. The menu functions (display_statusline, item_data_print and item_choice) are added as argument of eficonfig_process_common(). The menu description string displayed at the bottom of the menu is also added as argument. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
32bab0ea |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Make use of CLI character processing Avoid duplicating some of the escape-sequence processing here and use the CLI function instead. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
d0ca98db |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Update bootmenu_loop() to return the code Use the return value to save having to pass around a pointer. This also resolves any ambiguity about what *key contains when the function is called. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
2da4a15e |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Rename KEY_... to BKEY_... This enum values conflict with linux/input.h so rename them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
64550274 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: avoid SetVariable between GetNextVariableName calls The current code calls efi_set_variable_int() to delete the invalid boot option between calls to efi_get_next_variable_name_int(), it may produce unpredictable results. This commit moves removal of the invalid boot option outside of the efi_get_next_variable_name_int() calls. EFI_NOT_FOUND returned from efi_get_next_variable_name_int() indicates we retrieved all EFI variables, it should be treated as EFI_SUCEESS. To address the checkpatch warning of too many leading tabs, combine two if statement into one. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
ce327084 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: carve out efi_get_next_variable_name_int calls To retrieve the EFI variable name by efi_get_next_variable_name_int(), the sequence of alloc -> efi_get_next_variable_name_int -> realloc -> efi_get_next_variable_name_int is required. In current code, this sequence repeatedly appears in the several functions. It should be curved out a common function. This commit also fixes the missing free() of var_name16 in eficonfig_delete_invalid_boot_option(). Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
140a8959 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use efi_get_next_variable_name_int() eficonfig command reads all possible UEFI load options from 0x0000 to 0xFFFF to construct the menu. This takes too much time in some environment. This commit uses efi_get_next_variable_name_int() to read all existing UEFI load options to significantlly reduce the count of efi_get_var() call. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
78b1ccc4 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use u16_strsize() to get u16 string buffer size Use u16_strsize() to simplify the u16 string buffer size calculation. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c67d3c9e |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix going one directory up issue The directory name in eficonfig menu entry contains the '\' separator. strcmp() argument ".." is wrong and one directory up handling does not work correctly. strcmp() argument must include '\' separator. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c3b5af63 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add UEFI Secure Boot Key enrollment interface This commit adds the menu-driven UEFI Secure Boot Key enrollment interface. User can enroll PK, KEK, db and dbx by selecting file. Only the signed EFI Signature List(s) with an authenticated header, typically '.auth' file, is accepted. To clear the PK, KEK, db and dbx, user needs to enroll the null key signed by PK or KEK. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
21faf4ef |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use protocol interface for file selection EFI_SIMPLE_FILE_SYSTEM_PROTOCOL is not always provided by U-Boot. Use protocol interface functions instead of U-Boot internal functions. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d6566113 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose eficonfig_create_device_path() Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use eficonfig_create_device_path() to construct the full device path from device path of the volume and file path, so move it out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d571f9b2 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation All the eficonfig menus other than "Change Boot Order" use 'eficonfig_entry' structure for each menu entry. This commit refactors change boot order implementation to use 'eficonfig_entry' structure same as other menus to have consistent menu handling. This commit also simplifies the data->active handling when KEY_SPACE is pressed, and sizeof() parameter. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
8961e93e |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose append entry function Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use append_entry() and append_quit_entry() to construct the menu, so move them out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
a84040ab |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor file selection handling eficonfig_select_file_handler() is commonly used to select the file. eficonfig_display_select_file_option() adds an additional menu to clear the selected file. eficonfig_display_select_file_option() is not always necessary for the file selection process, so it must be outside of eficonfig_select_file_handler(). This commit also renames the following functions to avoid confusion. eficonfig_select_file_handler() -> eficonfig_process_select_file() eficonfig_select_file() -> eficonfig_show_file_selection() eficonfig_display_select_file_option() -> eficonfig_process_show_file_option() Finally, test_eficonfig.py need to be updated to get aligned with the above modification. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
1167e88a |
|
14-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix missing variable initialization The 'ret' variable must be initialized before use in eficonfig_delete_invalid_boot_option(). Fixes: c416f1c0bc ("bootmenu: add removable media entries") Addresses-Coverity: 376207 ("Uninitialized variables") Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
3d595ac5 |
|
09-Nov-2022 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: remove superfluous if in eficonfig_edit_boot_option Goto for an immediately succeeding label is superfluous. Fixes: 87d791423ac6 ("eficonfig: menu-driven addition of UEFI boot option") Addresses-Coverity: 376202 ("Identical code for different branches") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
2c0b0c31 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_SECURE_BOOT This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_SECURE_BOOT defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
83f3d121 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_MM_COMM_TEE This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_MM_COMM_TEE defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
88df3634 |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: CTRL+S to save the boot order 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>
|
#
45f5319f |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
menu: remove CTRL+C to quit On the sandbox called without "--terminal raw" CTRL+C leaves U-Boot, "ESC/CTRL+C to quit" is misleading. Let's remove CTRL+C to quit key handling from bootmenu and eficonfig menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
|
#
8dbd0a0f |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add vertical scroll support The current eficonfig menu does not support vertical scroll, so it can not display the menu entries greater than the console row size. This commit add the vertial scroll support. The console size is retrieved by SIMPLE_TEXT_OUTPUT_PROTOCOL.QueryMode() service, then calculates the row size for menu entry by subtracting menu header and description row size from the console row size. "start" and "end" are added in the efimenu structure. "start" keeps the menu entry index at the top, "end" keeps the bottom menu entry index. item_data_print() menu function only draws the menu entry between "start" and "end". This commit also fixes the issue that "Save" and "Quit" entries can be moved by BKEY_PLUS in change boot order menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
0d590852 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation This commit removes the change boot order specific menu implementation. The change boot order implementation calls eficonfig_process_common() same as other menus. The change boot order menu requires own item_data_print and item_choice implementation, but display_statusline function can be a same function as other menus. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
cd160b27 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor eficonfig_process_common function Current change boot order implementation does not call eficonfig_process_common() and call own menu functions for display_statusline, item_data_print and item_choice. Change boot order functionality should call eficonfig_process_common() to improve maintenanceability. This commit is a preparation to remove the change boot order specific implementation. The menu functions (display_statusline, item_data_print and item_choice) are added as argument of eficonfig_process_common(). The menu description string displayed at the bottom of the menu is also added as argument. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
32bab0ea |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Make use of CLI character processing Avoid duplicating some of the escape-sequence processing here and use the CLI function instead. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
d0ca98db |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Update bootmenu_loop() to return the code Use the return value to save having to pass around a pointer. This also resolves any ambiguity about what *key contains when the function is called. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
2da4a15e |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Rename KEY_... to BKEY_... This enum values conflict with linux/input.h so rename them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
64550274 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: avoid SetVariable between GetNextVariableName calls The current code calls efi_set_variable_int() to delete the invalid boot option between calls to efi_get_next_variable_name_int(), it may produce unpredictable results. This commit moves removal of the invalid boot option outside of the efi_get_next_variable_name_int() calls. EFI_NOT_FOUND returned from efi_get_next_variable_name_int() indicates we retrieved all EFI variables, it should be treated as EFI_SUCEESS. To address the checkpatch warning of too many leading tabs, combine two if statement into one. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
ce327084 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: carve out efi_get_next_variable_name_int calls To retrieve the EFI variable name by efi_get_next_variable_name_int(), the sequence of alloc -> efi_get_next_variable_name_int -> realloc -> efi_get_next_variable_name_int is required. In current code, this sequence repeatedly appears in the several functions. It should be curved out a common function. This commit also fixes the missing free() of var_name16 in eficonfig_delete_invalid_boot_option(). Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
140a8959 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use efi_get_next_variable_name_int() eficonfig command reads all possible UEFI load options from 0x0000 to 0xFFFF to construct the menu. This takes too much time in some environment. This commit uses efi_get_next_variable_name_int() to read all existing UEFI load options to significantlly reduce the count of efi_get_var() call. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
78b1ccc4 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use u16_strsize() to get u16 string buffer size Use u16_strsize() to simplify the u16 string buffer size calculation. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c67d3c9e |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix going one directory up issue The directory name in eficonfig menu entry contains the '\' separator. strcmp() argument ".." is wrong and one directory up handling does not work correctly. strcmp() argument must include '\' separator. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c3b5af63 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add UEFI Secure Boot Key enrollment interface This commit adds the menu-driven UEFI Secure Boot Key enrollment interface. User can enroll PK, KEK, db and dbx by selecting file. Only the signed EFI Signature List(s) with an authenticated header, typically '.auth' file, is accepted. To clear the PK, KEK, db and dbx, user needs to enroll the null key signed by PK or KEK. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
21faf4ef |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use protocol interface for file selection EFI_SIMPLE_FILE_SYSTEM_PROTOCOL is not always provided by U-Boot. Use protocol interface functions instead of U-Boot internal functions. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d6566113 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose eficonfig_create_device_path() Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use eficonfig_create_device_path() to construct the full device path from device path of the volume and file path, so move it out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d571f9b2 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation All the eficonfig menus other than "Change Boot Order" use 'eficonfig_entry' structure for each menu entry. This commit refactors change boot order implementation to use 'eficonfig_entry' structure same as other menus to have consistent menu handling. This commit also simplifies the data->active handling when KEY_SPACE is pressed, and sizeof() parameter. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
8961e93e |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose append entry function Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use append_entry() and append_quit_entry() to construct the menu, so move them out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
a84040ab |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor file selection handling eficonfig_select_file_handler() is commonly used to select the file. eficonfig_display_select_file_option() adds an additional menu to clear the selected file. eficonfig_display_select_file_option() is not always necessary for the file selection process, so it must be outside of eficonfig_select_file_handler(). This commit also renames the following functions to avoid confusion. eficonfig_select_file_handler() -> eficonfig_process_select_file() eficonfig_select_file() -> eficonfig_show_file_selection() eficonfig_display_select_file_option() -> eficonfig_process_show_file_option() Finally, test_eficonfig.py need to be updated to get aligned with the above modification. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
1167e88a |
|
14-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix missing variable initialization The 'ret' variable must be initialized before use in eficonfig_delete_invalid_boot_option(). Fixes: c416f1c0bc ("bootmenu: add removable media entries") Addresses-Coverity: 376207 ("Uninitialized variables") Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
3d595ac5 |
|
09-Nov-2022 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: remove superfluous if in eficonfig_edit_boot_option Goto for an immediately succeeding label is superfluous. Fixes: 87d791423ac6 ("eficonfig: menu-driven addition of UEFI boot option") Addresses-Coverity: 376202 ("Identical code for different branches") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
2c0b0c31 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_SECURE_BOOT This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_SECURE_BOOT defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
83f3d121 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_MM_COMM_TEE This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_MM_COMM_TEE defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
88df3634 |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: CTRL+S to save the boot order 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>
|
#
45f5319f |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
menu: remove CTRL+C to quit On the sandbox called without "--terminal raw" CTRL+C leaves U-Boot, "ESC/CTRL+C to quit" is misleading. Let's remove CTRL+C to quit key handling from bootmenu and eficonfig menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
|
#
8dbd0a0f |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add vertical scroll support The current eficonfig menu does not support vertical scroll, so it can not display the menu entries greater than the console row size. This commit add the vertial scroll support. The console size is retrieved by SIMPLE_TEXT_OUTPUT_PROTOCOL.QueryMode() service, then calculates the row size for menu entry by subtracting menu header and description row size from the console row size. "start" and "end" are added in the efimenu structure. "start" keeps the menu entry index at the top, "end" keeps the bottom menu entry index. item_data_print() menu function only draws the menu entry between "start" and "end". This commit also fixes the issue that "Save" and "Quit" entries can be moved by BKEY_PLUS in change boot order menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
0d590852 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation This commit removes the change boot order specific menu implementation. The change boot order implementation calls eficonfig_process_common() same as other menus. The change boot order menu requires own item_data_print and item_choice implementation, but display_statusline function can be a same function as other menus. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
cd160b27 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor eficonfig_process_common function Current change boot order implementation does not call eficonfig_process_common() and call own menu functions for display_statusline, item_data_print and item_choice. Change boot order functionality should call eficonfig_process_common() to improve maintenanceability. This commit is a preparation to remove the change boot order specific implementation. The menu functions (display_statusline, item_data_print and item_choice) are added as argument of eficonfig_process_common(). The menu description string displayed at the bottom of the menu is also added as argument. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
32bab0ea |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Make use of CLI character processing Avoid duplicating some of the escape-sequence processing here and use the CLI function instead. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
d0ca98db |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Update bootmenu_loop() to return the code Use the return value to save having to pass around a pointer. This also resolves any ambiguity about what *key contains when the function is called. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
2da4a15e |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Rename KEY_... to BKEY_... This enum values conflict with linux/input.h so rename them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
64550274 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: avoid SetVariable between GetNextVariableName calls The current code calls efi_set_variable_int() to delete the invalid boot option between calls to efi_get_next_variable_name_int(), it may produce unpredictable results. This commit moves removal of the invalid boot option outside of the efi_get_next_variable_name_int() calls. EFI_NOT_FOUND returned from efi_get_next_variable_name_int() indicates we retrieved all EFI variables, it should be treated as EFI_SUCEESS. To address the checkpatch warning of too many leading tabs, combine two if statement into one. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
ce327084 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: carve out efi_get_next_variable_name_int calls To retrieve the EFI variable name by efi_get_next_variable_name_int(), the sequence of alloc -> efi_get_next_variable_name_int -> realloc -> efi_get_next_variable_name_int is required. In current code, this sequence repeatedly appears in the several functions. It should be curved out a common function. This commit also fixes the missing free() of var_name16 in eficonfig_delete_invalid_boot_option(). Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
140a8959 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use efi_get_next_variable_name_int() eficonfig command reads all possible UEFI load options from 0x0000 to 0xFFFF to construct the menu. This takes too much time in some environment. This commit uses efi_get_next_variable_name_int() to read all existing UEFI load options to significantlly reduce the count of efi_get_var() call. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
78b1ccc4 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use u16_strsize() to get u16 string buffer size Use u16_strsize() to simplify the u16 string buffer size calculation. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c67d3c9e |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix going one directory up issue The directory name in eficonfig menu entry contains the '\' separator. strcmp() argument ".." is wrong and one directory up handling does not work correctly. strcmp() argument must include '\' separator. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c3b5af63 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add UEFI Secure Boot Key enrollment interface This commit adds the menu-driven UEFI Secure Boot Key enrollment interface. User can enroll PK, KEK, db and dbx by selecting file. Only the signed EFI Signature List(s) with an authenticated header, typically '.auth' file, is accepted. To clear the PK, KEK, db and dbx, user needs to enroll the null key signed by PK or KEK. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
21faf4ef |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use protocol interface for file selection EFI_SIMPLE_FILE_SYSTEM_PROTOCOL is not always provided by U-Boot. Use protocol interface functions instead of U-Boot internal functions. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d6566113 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose eficonfig_create_device_path() Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use eficonfig_create_device_path() to construct the full device path from device path of the volume and file path, so move it out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d571f9b2 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation All the eficonfig menus other than "Change Boot Order" use 'eficonfig_entry' structure for each menu entry. This commit refactors change boot order implementation to use 'eficonfig_entry' structure same as other menus to have consistent menu handling. This commit also simplifies the data->active handling when KEY_SPACE is pressed, and sizeof() parameter. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
8961e93e |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose append entry function Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use append_entry() and append_quit_entry() to construct the menu, so move them out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
a84040ab |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor file selection handling eficonfig_select_file_handler() is commonly used to select the file. eficonfig_display_select_file_option() adds an additional menu to clear the selected file. eficonfig_display_select_file_option() is not always necessary for the file selection process, so it must be outside of eficonfig_select_file_handler(). This commit also renames the following functions to avoid confusion. eficonfig_select_file_handler() -> eficonfig_process_select_file() eficonfig_select_file() -> eficonfig_show_file_selection() eficonfig_display_select_file_option() -> eficonfig_process_show_file_option() Finally, test_eficonfig.py need to be updated to get aligned with the above modification. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
1167e88a |
|
14-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix missing variable initialization The 'ret' variable must be initialized before use in eficonfig_delete_invalid_boot_option(). Fixes: c416f1c0bc ("bootmenu: add removable media entries") Addresses-Coverity: 376207 ("Uninitialized variables") Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
3d595ac5 |
|
09-Nov-2022 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: remove superfluous if in eficonfig_edit_boot_option Goto for an immediately succeeding label is superfluous. Fixes: 87d791423ac6 ("eficonfig: menu-driven addition of UEFI boot option") Addresses-Coverity: 376202 ("Identical code for different branches") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
2c0b0c31 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_SECURE_BOOT This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_SECURE_BOOT defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
83f3d121 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_MM_COMM_TEE This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_MM_COMM_TEE defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
88df3634 |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: CTRL+S to save the boot order 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>
|
#
45f5319f |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
menu: remove CTRL+C to quit On the sandbox called without "--terminal raw" CTRL+C leaves U-Boot, "ESC/CTRL+C to quit" is misleading. Let's remove CTRL+C to quit key handling from bootmenu and eficonfig menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
|
#
8dbd0a0f |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add vertical scroll support The current eficonfig menu does not support vertical scroll, so it can not display the menu entries greater than the console row size. This commit add the vertial scroll support. The console size is retrieved by SIMPLE_TEXT_OUTPUT_PROTOCOL.QueryMode() service, then calculates the row size for menu entry by subtracting menu header and description row size from the console row size. "start" and "end" are added in the efimenu structure. "start" keeps the menu entry index at the top, "end" keeps the bottom menu entry index. item_data_print() menu function only draws the menu entry between "start" and "end". This commit also fixes the issue that "Save" and "Quit" entries can be moved by BKEY_PLUS in change boot order menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
0d590852 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation This commit removes the change boot order specific menu implementation. The change boot order implementation calls eficonfig_process_common() same as other menus. The change boot order menu requires own item_data_print and item_choice implementation, but display_statusline function can be a same function as other menus. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
cd160b27 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor eficonfig_process_common function Current change boot order implementation does not call eficonfig_process_common() and call own menu functions for display_statusline, item_data_print and item_choice. Change boot order functionality should call eficonfig_process_common() to improve maintenanceability. This commit is a preparation to remove the change boot order specific implementation. The menu functions (display_statusline, item_data_print and item_choice) are added as argument of eficonfig_process_common(). The menu description string displayed at the bottom of the menu is also added as argument. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
32bab0ea |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Make use of CLI character processing Avoid duplicating some of the escape-sequence processing here and use the CLI function instead. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
d0ca98db |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Update bootmenu_loop() to return the code Use the return value to save having to pass around a pointer. This also resolves any ambiguity about what *key contains when the function is called. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
2da4a15e |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Rename KEY_... to BKEY_... This enum values conflict with linux/input.h so rename them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
64550274 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: avoid SetVariable between GetNextVariableName calls The current code calls efi_set_variable_int() to delete the invalid boot option between calls to efi_get_next_variable_name_int(), it may produce unpredictable results. This commit moves removal of the invalid boot option outside of the efi_get_next_variable_name_int() calls. EFI_NOT_FOUND returned from efi_get_next_variable_name_int() indicates we retrieved all EFI variables, it should be treated as EFI_SUCEESS. To address the checkpatch warning of too many leading tabs, combine two if statement into one. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
ce327084 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: carve out efi_get_next_variable_name_int calls To retrieve the EFI variable name by efi_get_next_variable_name_int(), the sequence of alloc -> efi_get_next_variable_name_int -> realloc -> efi_get_next_variable_name_int is required. In current code, this sequence repeatedly appears in the several functions. It should be curved out a common function. This commit also fixes the missing free() of var_name16 in eficonfig_delete_invalid_boot_option(). Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
140a8959 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use efi_get_next_variable_name_int() eficonfig command reads all possible UEFI load options from 0x0000 to 0xFFFF to construct the menu. This takes too much time in some environment. This commit uses efi_get_next_variable_name_int() to read all existing UEFI load options to significantlly reduce the count of efi_get_var() call. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
78b1ccc4 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use u16_strsize() to get u16 string buffer size Use u16_strsize() to simplify the u16 string buffer size calculation. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c67d3c9e |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix going one directory up issue The directory name in eficonfig menu entry contains the '\' separator. strcmp() argument ".." is wrong and one directory up handling does not work correctly. strcmp() argument must include '\' separator. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c3b5af63 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add UEFI Secure Boot Key enrollment interface This commit adds the menu-driven UEFI Secure Boot Key enrollment interface. User can enroll PK, KEK, db and dbx by selecting file. Only the signed EFI Signature List(s) with an authenticated header, typically '.auth' file, is accepted. To clear the PK, KEK, db and dbx, user needs to enroll the null key signed by PK or KEK. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
21faf4ef |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use protocol interface for file selection EFI_SIMPLE_FILE_SYSTEM_PROTOCOL is not always provided by U-Boot. Use protocol interface functions instead of U-Boot internal functions. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d6566113 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose eficonfig_create_device_path() Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use eficonfig_create_device_path() to construct the full device path from device path of the volume and file path, so move it out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d571f9b2 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation All the eficonfig menus other than "Change Boot Order" use 'eficonfig_entry' structure for each menu entry. This commit refactors change boot order implementation to use 'eficonfig_entry' structure same as other menus to have consistent menu handling. This commit also simplifies the data->active handling when KEY_SPACE is pressed, and sizeof() parameter. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
8961e93e |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose append entry function Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use append_entry() and append_quit_entry() to construct the menu, so move them out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
a84040ab |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor file selection handling eficonfig_select_file_handler() is commonly used to select the file. eficonfig_display_select_file_option() adds an additional menu to clear the selected file. eficonfig_display_select_file_option() is not always necessary for the file selection process, so it must be outside of eficonfig_select_file_handler(). This commit also renames the following functions to avoid confusion. eficonfig_select_file_handler() -> eficonfig_process_select_file() eficonfig_select_file() -> eficonfig_show_file_selection() eficonfig_display_select_file_option() -> eficonfig_process_show_file_option() Finally, test_eficonfig.py need to be updated to get aligned with the above modification. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
1167e88a |
|
14-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix missing variable initialization The 'ret' variable must be initialized before use in eficonfig_delete_invalid_boot_option(). Fixes: c416f1c0bc ("bootmenu: add removable media entries") Addresses-Coverity: 376207 ("Uninitialized variables") Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
3d595ac5 |
|
09-Nov-2022 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: remove superfluous if in eficonfig_edit_boot_option Goto for an immediately succeeding label is superfluous. Fixes: 87d791423ac6 ("eficonfig: menu-driven addition of UEFI boot option") Addresses-Coverity: 376202 ("Identical code for different branches") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
2c0b0c31 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_SECURE_BOOT This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_SECURE_BOOT defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
83f3d121 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_MM_COMM_TEE This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_MM_COMM_TEE defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
88df3634 |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: CTRL+S to save the boot order 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>
|
#
45f5319f |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
menu: remove CTRL+C to quit On the sandbox called without "--terminal raw" CTRL+C leaves U-Boot, "ESC/CTRL+C to quit" is misleading. Let's remove CTRL+C to quit key handling from bootmenu and eficonfig menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
|
#
8dbd0a0f |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add vertical scroll support The current eficonfig menu does not support vertical scroll, so it can not display the menu entries greater than the console row size. This commit add the vertial scroll support. The console size is retrieved by SIMPLE_TEXT_OUTPUT_PROTOCOL.QueryMode() service, then calculates the row size for menu entry by subtracting menu header and description row size from the console row size. "start" and "end" are added in the efimenu structure. "start" keeps the menu entry index at the top, "end" keeps the bottom menu entry index. item_data_print() menu function only draws the menu entry between "start" and "end". This commit also fixes the issue that "Save" and "Quit" entries can be moved by BKEY_PLUS in change boot order menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
0d590852 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation This commit removes the change boot order specific menu implementation. The change boot order implementation calls eficonfig_process_common() same as other menus. The change boot order menu requires own item_data_print and item_choice implementation, but display_statusline function can be a same function as other menus. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
cd160b27 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor eficonfig_process_common function Current change boot order implementation does not call eficonfig_process_common() and call own menu functions for display_statusline, item_data_print and item_choice. Change boot order functionality should call eficonfig_process_common() to improve maintenanceability. This commit is a preparation to remove the change boot order specific implementation. The menu functions (display_statusline, item_data_print and item_choice) are added as argument of eficonfig_process_common(). The menu description string displayed at the bottom of the menu is also added as argument. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
32bab0ea |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Make use of CLI character processing Avoid duplicating some of the escape-sequence processing here and use the CLI function instead. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
d0ca98db |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Update bootmenu_loop() to return the code Use the return value to save having to pass around a pointer. This also resolves any ambiguity about what *key contains when the function is called. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
2da4a15e |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Rename KEY_... to BKEY_... This enum values conflict with linux/input.h so rename them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
64550274 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: avoid SetVariable between GetNextVariableName calls The current code calls efi_set_variable_int() to delete the invalid boot option between calls to efi_get_next_variable_name_int(), it may produce unpredictable results. This commit moves removal of the invalid boot option outside of the efi_get_next_variable_name_int() calls. EFI_NOT_FOUND returned from efi_get_next_variable_name_int() indicates we retrieved all EFI variables, it should be treated as EFI_SUCEESS. To address the checkpatch warning of too many leading tabs, combine two if statement into one. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
ce327084 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: carve out efi_get_next_variable_name_int calls To retrieve the EFI variable name by efi_get_next_variable_name_int(), the sequence of alloc -> efi_get_next_variable_name_int -> realloc -> efi_get_next_variable_name_int is required. In current code, this sequence repeatedly appears in the several functions. It should be curved out a common function. This commit also fixes the missing free() of var_name16 in eficonfig_delete_invalid_boot_option(). Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
140a8959 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use efi_get_next_variable_name_int() eficonfig command reads all possible UEFI load options from 0x0000 to 0xFFFF to construct the menu. This takes too much time in some environment. This commit uses efi_get_next_variable_name_int() to read all existing UEFI load options to significantlly reduce the count of efi_get_var() call. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
78b1ccc4 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use u16_strsize() to get u16 string buffer size Use u16_strsize() to simplify the u16 string buffer size calculation. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c67d3c9e |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix going one directory up issue The directory name in eficonfig menu entry contains the '\' separator. strcmp() argument ".." is wrong and one directory up handling does not work correctly. strcmp() argument must include '\' separator. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c3b5af63 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add UEFI Secure Boot Key enrollment interface This commit adds the menu-driven UEFI Secure Boot Key enrollment interface. User can enroll PK, KEK, db and dbx by selecting file. Only the signed EFI Signature List(s) with an authenticated header, typically '.auth' file, is accepted. To clear the PK, KEK, db and dbx, user needs to enroll the null key signed by PK or KEK. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
21faf4ef |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use protocol interface for file selection EFI_SIMPLE_FILE_SYSTEM_PROTOCOL is not always provided by U-Boot. Use protocol interface functions instead of U-Boot internal functions. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d6566113 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose eficonfig_create_device_path() Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use eficonfig_create_device_path() to construct the full device path from device path of the volume and file path, so move it out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d571f9b2 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation All the eficonfig menus other than "Change Boot Order" use 'eficonfig_entry' structure for each menu entry. This commit refactors change boot order implementation to use 'eficonfig_entry' structure same as other menus to have consistent menu handling. This commit also simplifies the data->active handling when KEY_SPACE is pressed, and sizeof() parameter. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
8961e93e |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose append entry function Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use append_entry() and append_quit_entry() to construct the menu, so move them out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
a84040ab |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor file selection handling eficonfig_select_file_handler() is commonly used to select the file. eficonfig_display_select_file_option() adds an additional menu to clear the selected file. eficonfig_display_select_file_option() is not always necessary for the file selection process, so it must be outside of eficonfig_select_file_handler(). This commit also renames the following functions to avoid confusion. eficonfig_select_file_handler() -> eficonfig_process_select_file() eficonfig_select_file() -> eficonfig_show_file_selection() eficonfig_display_select_file_option() -> eficonfig_process_show_file_option() Finally, test_eficonfig.py need to be updated to get aligned with the above modification. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
1167e88a |
|
14-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix missing variable initialization The 'ret' variable must be initialized before use in eficonfig_delete_invalid_boot_option(). Fixes: c416f1c0bc ("bootmenu: add removable media entries") Addresses-Coverity: 376207 ("Uninitialized variables") Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
3d595ac5 |
|
09-Nov-2022 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: remove superfluous if in eficonfig_edit_boot_option Goto for an immediately succeeding label is superfluous. Fixes: 87d791423ac6 ("eficonfig: menu-driven addition of UEFI boot option") Addresses-Coverity: 376202 ("Identical code for different branches") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
2c0b0c31 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_SECURE_BOOT This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_SECURE_BOOT defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
83f3d121 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_MM_COMM_TEE This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_MM_COMM_TEE defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
88df3634 |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: CTRL+S to save the boot order 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>
|
#
45f5319f |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
menu: remove CTRL+C to quit On the sandbox called without "--terminal raw" CTRL+C leaves U-Boot, "ESC/CTRL+C to quit" is misleading. Let's remove CTRL+C to quit key handling from bootmenu and eficonfig menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
|
#
8dbd0a0f |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add vertical scroll support The current eficonfig menu does not support vertical scroll, so it can not display the menu entries greater than the console row size. This commit add the vertial scroll support. The console size is retrieved by SIMPLE_TEXT_OUTPUT_PROTOCOL.QueryMode() service, then calculates the row size for menu entry by subtracting menu header and description row size from the console row size. "start" and "end" are added in the efimenu structure. "start" keeps the menu entry index at the top, "end" keeps the bottom menu entry index. item_data_print() menu function only draws the menu entry between "start" and "end". This commit also fixes the issue that "Save" and "Quit" entries can be moved by BKEY_PLUS in change boot order menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
0d590852 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation This commit removes the change boot order specific menu implementation. The change boot order implementation calls eficonfig_process_common() same as other menus. The change boot order menu requires own item_data_print and item_choice implementation, but display_statusline function can be a same function as other menus. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
cd160b27 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor eficonfig_process_common function Current change boot order implementation does not call eficonfig_process_common() and call own menu functions for display_statusline, item_data_print and item_choice. Change boot order functionality should call eficonfig_process_common() to improve maintenanceability. This commit is a preparation to remove the change boot order specific implementation. The menu functions (display_statusline, item_data_print and item_choice) are added as argument of eficonfig_process_common(). The menu description string displayed at the bottom of the menu is also added as argument. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
32bab0ea |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Make use of CLI character processing Avoid duplicating some of the escape-sequence processing here and use the CLI function instead. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
d0ca98db |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Update bootmenu_loop() to return the code Use the return value to save having to pass around a pointer. This also resolves any ambiguity about what *key contains when the function is called. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
2da4a15e |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Rename KEY_... to BKEY_... This enum values conflict with linux/input.h so rename them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
64550274 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: avoid SetVariable between GetNextVariableName calls The current code calls efi_set_variable_int() to delete the invalid boot option between calls to efi_get_next_variable_name_int(), it may produce unpredictable results. This commit moves removal of the invalid boot option outside of the efi_get_next_variable_name_int() calls. EFI_NOT_FOUND returned from efi_get_next_variable_name_int() indicates we retrieved all EFI variables, it should be treated as EFI_SUCEESS. To address the checkpatch warning of too many leading tabs, combine two if statement into one. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
ce327084 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: carve out efi_get_next_variable_name_int calls To retrieve the EFI variable name by efi_get_next_variable_name_int(), the sequence of alloc -> efi_get_next_variable_name_int -> realloc -> efi_get_next_variable_name_int is required. In current code, this sequence repeatedly appears in the several functions. It should be curved out a common function. This commit also fixes the missing free() of var_name16 in eficonfig_delete_invalid_boot_option(). Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
140a8959 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use efi_get_next_variable_name_int() eficonfig command reads all possible UEFI load options from 0x0000 to 0xFFFF to construct the menu. This takes too much time in some environment. This commit uses efi_get_next_variable_name_int() to read all existing UEFI load options to significantlly reduce the count of efi_get_var() call. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
78b1ccc4 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use u16_strsize() to get u16 string buffer size Use u16_strsize() to simplify the u16 string buffer size calculation. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c67d3c9e |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix going one directory up issue The directory name in eficonfig menu entry contains the '\' separator. strcmp() argument ".." is wrong and one directory up handling does not work correctly. strcmp() argument must include '\' separator. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c3b5af63 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add UEFI Secure Boot Key enrollment interface This commit adds the menu-driven UEFI Secure Boot Key enrollment interface. User can enroll PK, KEK, db and dbx by selecting file. Only the signed EFI Signature List(s) with an authenticated header, typically '.auth' file, is accepted. To clear the PK, KEK, db and dbx, user needs to enroll the null key signed by PK or KEK. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
21faf4ef |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use protocol interface for file selection EFI_SIMPLE_FILE_SYSTEM_PROTOCOL is not always provided by U-Boot. Use protocol interface functions instead of U-Boot internal functions. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d6566113 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose eficonfig_create_device_path() Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use eficonfig_create_device_path() to construct the full device path from device path of the volume and file path, so move it out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d571f9b2 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation All the eficonfig menus other than "Change Boot Order" use 'eficonfig_entry' structure for each menu entry. This commit refactors change boot order implementation to use 'eficonfig_entry' structure same as other menus to have consistent menu handling. This commit also simplifies the data->active handling when KEY_SPACE is pressed, and sizeof() parameter. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
8961e93e |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose append entry function Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use append_entry() and append_quit_entry() to construct the menu, so move them out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
a84040ab |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor file selection handling eficonfig_select_file_handler() is commonly used to select the file. eficonfig_display_select_file_option() adds an additional menu to clear the selected file. eficonfig_display_select_file_option() is not always necessary for the file selection process, so it must be outside of eficonfig_select_file_handler(). This commit also renames the following functions to avoid confusion. eficonfig_select_file_handler() -> eficonfig_process_select_file() eficonfig_select_file() -> eficonfig_show_file_selection() eficonfig_display_select_file_option() -> eficonfig_process_show_file_option() Finally, test_eficonfig.py need to be updated to get aligned with the above modification. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
1167e88a |
|
14-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix missing variable initialization The 'ret' variable must be initialized before use in eficonfig_delete_invalid_boot_option(). Fixes: c416f1c0bc ("bootmenu: add removable media entries") Addresses-Coverity: 376207 ("Uninitialized variables") Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
3d595ac5 |
|
09-Nov-2022 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: remove superfluous if in eficonfig_edit_boot_option Goto for an immediately succeeding label is superfluous. Fixes: 87d791423ac6 ("eficonfig: menu-driven addition of UEFI boot option") Addresses-Coverity: 376202 ("Identical code for different branches") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
2c0b0c31 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_SECURE_BOOT This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_SECURE_BOOT defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
83f3d121 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_MM_COMM_TEE This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_MM_COMM_TEE defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
88df3634 |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: CTRL+S to save the boot order 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>
|
#
45f5319f |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
menu: remove CTRL+C to quit On the sandbox called without "--terminal raw" CTRL+C leaves U-Boot, "ESC/CTRL+C to quit" is misleading. Let's remove CTRL+C to quit key handling from bootmenu and eficonfig menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
|
#
8dbd0a0f |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add vertical scroll support The current eficonfig menu does not support vertical scroll, so it can not display the menu entries greater than the console row size. This commit add the vertial scroll support. The console size is retrieved by SIMPLE_TEXT_OUTPUT_PROTOCOL.QueryMode() service, then calculates the row size for menu entry by subtracting menu header and description row size from the console row size. "start" and "end" are added in the efimenu structure. "start" keeps the menu entry index at the top, "end" keeps the bottom menu entry index. item_data_print() menu function only draws the menu entry between "start" and "end". This commit also fixes the issue that "Save" and "Quit" entries can be moved by BKEY_PLUS in change boot order menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
0d590852 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation This commit removes the change boot order specific menu implementation. The change boot order implementation calls eficonfig_process_common() same as other menus. The change boot order menu requires own item_data_print and item_choice implementation, but display_statusline function can be a same function as other menus. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
cd160b27 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor eficonfig_process_common function Current change boot order implementation does not call eficonfig_process_common() and call own menu functions for display_statusline, item_data_print and item_choice. Change boot order functionality should call eficonfig_process_common() to improve maintenanceability. This commit is a preparation to remove the change boot order specific implementation. The menu functions (display_statusline, item_data_print and item_choice) are added as argument of eficonfig_process_common(). The menu description string displayed at the bottom of the menu is also added as argument. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
32bab0ea |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Make use of CLI character processing Avoid duplicating some of the escape-sequence processing here and use the CLI function instead. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
d0ca98db |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Update bootmenu_loop() to return the code Use the return value to save having to pass around a pointer. This also resolves any ambiguity about what *key contains when the function is called. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
2da4a15e |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Rename KEY_... to BKEY_... This enum values conflict with linux/input.h so rename them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
64550274 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: avoid SetVariable between GetNextVariableName calls The current code calls efi_set_variable_int() to delete the invalid boot option between calls to efi_get_next_variable_name_int(), it may produce unpredictable results. This commit moves removal of the invalid boot option outside of the efi_get_next_variable_name_int() calls. EFI_NOT_FOUND returned from efi_get_next_variable_name_int() indicates we retrieved all EFI variables, it should be treated as EFI_SUCEESS. To address the checkpatch warning of too many leading tabs, combine two if statement into one. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
ce327084 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: carve out efi_get_next_variable_name_int calls To retrieve the EFI variable name by efi_get_next_variable_name_int(), the sequence of alloc -> efi_get_next_variable_name_int -> realloc -> efi_get_next_variable_name_int is required. In current code, this sequence repeatedly appears in the several functions. It should be curved out a common function. This commit also fixes the missing free() of var_name16 in eficonfig_delete_invalid_boot_option(). Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
140a8959 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use efi_get_next_variable_name_int() eficonfig command reads all possible UEFI load options from 0x0000 to 0xFFFF to construct the menu. This takes too much time in some environment. This commit uses efi_get_next_variable_name_int() to read all existing UEFI load options to significantlly reduce the count of efi_get_var() call. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
78b1ccc4 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use u16_strsize() to get u16 string buffer size Use u16_strsize() to simplify the u16 string buffer size calculation. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c67d3c9e |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix going one directory up issue The directory name in eficonfig menu entry contains the '\' separator. strcmp() argument ".." is wrong and one directory up handling does not work correctly. strcmp() argument must include '\' separator. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c3b5af63 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add UEFI Secure Boot Key enrollment interface This commit adds the menu-driven UEFI Secure Boot Key enrollment interface. User can enroll PK, KEK, db and dbx by selecting file. Only the signed EFI Signature List(s) with an authenticated header, typically '.auth' file, is accepted. To clear the PK, KEK, db and dbx, user needs to enroll the null key signed by PK or KEK. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
21faf4ef |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use protocol interface for file selection EFI_SIMPLE_FILE_SYSTEM_PROTOCOL is not always provided by U-Boot. Use protocol interface functions instead of U-Boot internal functions. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d6566113 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose eficonfig_create_device_path() Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use eficonfig_create_device_path() to construct the full device path from device path of the volume and file path, so move it out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d571f9b2 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation All the eficonfig menus other than "Change Boot Order" use 'eficonfig_entry' structure for each menu entry. This commit refactors change boot order implementation to use 'eficonfig_entry' structure same as other menus to have consistent menu handling. This commit also simplifies the data->active handling when KEY_SPACE is pressed, and sizeof() parameter. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
8961e93e |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose append entry function Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use append_entry() and append_quit_entry() to construct the menu, so move them out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
a84040ab |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor file selection handling eficonfig_select_file_handler() is commonly used to select the file. eficonfig_display_select_file_option() adds an additional menu to clear the selected file. eficonfig_display_select_file_option() is not always necessary for the file selection process, so it must be outside of eficonfig_select_file_handler(). This commit also renames the following functions to avoid confusion. eficonfig_select_file_handler() -> eficonfig_process_select_file() eficonfig_select_file() -> eficonfig_show_file_selection() eficonfig_display_select_file_option() -> eficonfig_process_show_file_option() Finally, test_eficonfig.py need to be updated to get aligned with the above modification. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
1167e88a |
|
14-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix missing variable initialization The 'ret' variable must be initialized before use in eficonfig_delete_invalid_boot_option(). Fixes: c416f1c0bc ("bootmenu: add removable media entries") Addresses-Coverity: 376207 ("Uninitialized variables") Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
3d595ac5 |
|
09-Nov-2022 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: remove superfluous if in eficonfig_edit_boot_option Goto for an immediately succeeding label is superfluous. Fixes: 87d791423ac6 ("eficonfig: menu-driven addition of UEFI boot option") Addresses-Coverity: 376202 ("Identical code for different branches") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
2c0b0c31 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_SECURE_BOOT This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_SECURE_BOOT defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
83f3d121 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_MM_COMM_TEE This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_MM_COMM_TEE defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
88df3634 |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: CTRL+S to save the boot order 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>
|
#
45f5319f |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
menu: remove CTRL+C to quit On the sandbox called without "--terminal raw" CTRL+C leaves U-Boot, "ESC/CTRL+C to quit" is misleading. Let's remove CTRL+C to quit key handling from bootmenu and eficonfig menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
|
#
8dbd0a0f |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add vertical scroll support The current eficonfig menu does not support vertical scroll, so it can not display the menu entries greater than the console row size. This commit add the vertial scroll support. The console size is retrieved by SIMPLE_TEXT_OUTPUT_PROTOCOL.QueryMode() service, then calculates the row size for menu entry by subtracting menu header and description row size from the console row size. "start" and "end" are added in the efimenu structure. "start" keeps the menu entry index at the top, "end" keeps the bottom menu entry index. item_data_print() menu function only draws the menu entry between "start" and "end". This commit also fixes the issue that "Save" and "Quit" entries can be moved by BKEY_PLUS in change boot order menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
0d590852 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation This commit removes the change boot order specific menu implementation. The change boot order implementation calls eficonfig_process_common() same as other menus. The change boot order menu requires own item_data_print and item_choice implementation, but display_statusline function can be a same function as other menus. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
cd160b27 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor eficonfig_process_common function Current change boot order implementation does not call eficonfig_process_common() and call own menu functions for display_statusline, item_data_print and item_choice. Change boot order functionality should call eficonfig_process_common() to improve maintenanceability. This commit is a preparation to remove the change boot order specific implementation. The menu functions (display_statusline, item_data_print and item_choice) are added as argument of eficonfig_process_common(). The menu description string displayed at the bottom of the menu is also added as argument. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
32bab0ea |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Make use of CLI character processing Avoid duplicating some of the escape-sequence processing here and use the CLI function instead. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
d0ca98db |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Update bootmenu_loop() to return the code Use the return value to save having to pass around a pointer. This also resolves any ambiguity about what *key contains when the function is called. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
2da4a15e |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Rename KEY_... to BKEY_... This enum values conflict with linux/input.h so rename them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
64550274 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: avoid SetVariable between GetNextVariableName calls The current code calls efi_set_variable_int() to delete the invalid boot option between calls to efi_get_next_variable_name_int(), it may produce unpredictable results. This commit moves removal of the invalid boot option outside of the efi_get_next_variable_name_int() calls. EFI_NOT_FOUND returned from efi_get_next_variable_name_int() indicates we retrieved all EFI variables, it should be treated as EFI_SUCEESS. To address the checkpatch warning of too many leading tabs, combine two if statement into one. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
ce327084 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: carve out efi_get_next_variable_name_int calls To retrieve the EFI variable name by efi_get_next_variable_name_int(), the sequence of alloc -> efi_get_next_variable_name_int -> realloc -> efi_get_next_variable_name_int is required. In current code, this sequence repeatedly appears in the several functions. It should be curved out a common function. This commit also fixes the missing free() of var_name16 in eficonfig_delete_invalid_boot_option(). Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
140a8959 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use efi_get_next_variable_name_int() eficonfig command reads all possible UEFI load options from 0x0000 to 0xFFFF to construct the menu. This takes too much time in some environment. This commit uses efi_get_next_variable_name_int() to read all existing UEFI load options to significantlly reduce the count of efi_get_var() call. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
78b1ccc4 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use u16_strsize() to get u16 string buffer size Use u16_strsize() to simplify the u16 string buffer size calculation. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c67d3c9e |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix going one directory up issue The directory name in eficonfig menu entry contains the '\' separator. strcmp() argument ".." is wrong and one directory up handling does not work correctly. strcmp() argument must include '\' separator. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c3b5af63 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add UEFI Secure Boot Key enrollment interface This commit adds the menu-driven UEFI Secure Boot Key enrollment interface. User can enroll PK, KEK, db and dbx by selecting file. Only the signed EFI Signature List(s) with an authenticated header, typically '.auth' file, is accepted. To clear the PK, KEK, db and dbx, user needs to enroll the null key signed by PK or KEK. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
21faf4ef |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use protocol interface for file selection EFI_SIMPLE_FILE_SYSTEM_PROTOCOL is not always provided by U-Boot. Use protocol interface functions instead of U-Boot internal functions. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d6566113 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose eficonfig_create_device_path() Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use eficonfig_create_device_path() to construct the full device path from device path of the volume and file path, so move it out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d571f9b2 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation All the eficonfig menus other than "Change Boot Order" use 'eficonfig_entry' structure for each menu entry. This commit refactors change boot order implementation to use 'eficonfig_entry' structure same as other menus to have consistent menu handling. This commit also simplifies the data->active handling when KEY_SPACE is pressed, and sizeof() parameter. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
8961e93e |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose append entry function Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use append_entry() and append_quit_entry() to construct the menu, so move them out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
a84040ab |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor file selection handling eficonfig_select_file_handler() is commonly used to select the file. eficonfig_display_select_file_option() adds an additional menu to clear the selected file. eficonfig_display_select_file_option() is not always necessary for the file selection process, so it must be outside of eficonfig_select_file_handler(). This commit also renames the following functions to avoid confusion. eficonfig_select_file_handler() -> eficonfig_process_select_file() eficonfig_select_file() -> eficonfig_show_file_selection() eficonfig_display_select_file_option() -> eficonfig_process_show_file_option() Finally, test_eficonfig.py need to be updated to get aligned with the above modification. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
1167e88a |
|
14-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix missing variable initialization The 'ret' variable must be initialized before use in eficonfig_delete_invalid_boot_option(). Fixes: c416f1c0bc ("bootmenu: add removable media entries") Addresses-Coverity: 376207 ("Uninitialized variables") Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
3d595ac5 |
|
09-Nov-2022 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: remove superfluous if in eficonfig_edit_boot_option Goto for an immediately succeeding label is superfluous. Fixes: 87d791423ac6 ("eficonfig: menu-driven addition of UEFI boot option") Addresses-Coverity: 376202 ("Identical code for different branches") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
2c0b0c31 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_SECURE_BOOT This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_SECURE_BOOT defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
83f3d121 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_MM_COMM_TEE This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_MM_COMM_TEE defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
88df3634 |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: CTRL+S to save the boot order 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>
|
#
45f5319f |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
menu: remove CTRL+C to quit On the sandbox called without "--terminal raw" CTRL+C leaves U-Boot, "ESC/CTRL+C to quit" is misleading. Let's remove CTRL+C to quit key handling from bootmenu and eficonfig menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
|
#
8dbd0a0f |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add vertical scroll support The current eficonfig menu does not support vertical scroll, so it can not display the menu entries greater than the console row size. This commit add the vertial scroll support. The console size is retrieved by SIMPLE_TEXT_OUTPUT_PROTOCOL.QueryMode() service, then calculates the row size for menu entry by subtracting menu header and description row size from the console row size. "start" and "end" are added in the efimenu structure. "start" keeps the menu entry index at the top, "end" keeps the bottom menu entry index. item_data_print() menu function only draws the menu entry between "start" and "end". This commit also fixes the issue that "Save" and "Quit" entries can be moved by BKEY_PLUS in change boot order menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
0d590852 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation This commit removes the change boot order specific menu implementation. The change boot order implementation calls eficonfig_process_common() same as other menus. The change boot order menu requires own item_data_print and item_choice implementation, but display_statusline function can be a same function as other menus. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
cd160b27 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor eficonfig_process_common function Current change boot order implementation does not call eficonfig_process_common() and call own menu functions for display_statusline, item_data_print and item_choice. Change boot order functionality should call eficonfig_process_common() to improve maintenanceability. This commit is a preparation to remove the change boot order specific implementation. The menu functions (display_statusline, item_data_print and item_choice) are added as argument of eficonfig_process_common(). The menu description string displayed at the bottom of the menu is also added as argument. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
32bab0ea |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Make use of CLI character processing Avoid duplicating some of the escape-sequence processing here and use the CLI function instead. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
d0ca98db |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Update bootmenu_loop() to return the code Use the return value to save having to pass around a pointer. This also resolves any ambiguity about what *key contains when the function is called. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
2da4a15e |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Rename KEY_... to BKEY_... This enum values conflict with linux/input.h so rename them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
64550274 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: avoid SetVariable between GetNextVariableName calls The current code calls efi_set_variable_int() to delete the invalid boot option between calls to efi_get_next_variable_name_int(), it may produce unpredictable results. This commit moves removal of the invalid boot option outside of the efi_get_next_variable_name_int() calls. EFI_NOT_FOUND returned from efi_get_next_variable_name_int() indicates we retrieved all EFI variables, it should be treated as EFI_SUCEESS. To address the checkpatch warning of too many leading tabs, combine two if statement into one. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
ce327084 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: carve out efi_get_next_variable_name_int calls To retrieve the EFI variable name by efi_get_next_variable_name_int(), the sequence of alloc -> efi_get_next_variable_name_int -> realloc -> efi_get_next_variable_name_int is required. In current code, this sequence repeatedly appears in the several functions. It should be curved out a common function. This commit also fixes the missing free() of var_name16 in eficonfig_delete_invalid_boot_option(). Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
140a8959 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use efi_get_next_variable_name_int() eficonfig command reads all possible UEFI load options from 0x0000 to 0xFFFF to construct the menu. This takes too much time in some environment. This commit uses efi_get_next_variable_name_int() to read all existing UEFI load options to significantlly reduce the count of efi_get_var() call. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
78b1ccc4 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use u16_strsize() to get u16 string buffer size Use u16_strsize() to simplify the u16 string buffer size calculation. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c67d3c9e |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix going one directory up issue The directory name in eficonfig menu entry contains the '\' separator. strcmp() argument ".." is wrong and one directory up handling does not work correctly. strcmp() argument must include '\' separator. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c3b5af63 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add UEFI Secure Boot Key enrollment interface This commit adds the menu-driven UEFI Secure Boot Key enrollment interface. User can enroll PK, KEK, db and dbx by selecting file. Only the signed EFI Signature List(s) with an authenticated header, typically '.auth' file, is accepted. To clear the PK, KEK, db and dbx, user needs to enroll the null key signed by PK or KEK. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
21faf4ef |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use protocol interface for file selection EFI_SIMPLE_FILE_SYSTEM_PROTOCOL is not always provided by U-Boot. Use protocol interface functions instead of U-Boot internal functions. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d6566113 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose eficonfig_create_device_path() Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use eficonfig_create_device_path() to construct the full device path from device path of the volume and file path, so move it out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d571f9b2 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation All the eficonfig menus other than "Change Boot Order" use 'eficonfig_entry' structure for each menu entry. This commit refactors change boot order implementation to use 'eficonfig_entry' structure same as other menus to have consistent menu handling. This commit also simplifies the data->active handling when KEY_SPACE is pressed, and sizeof() parameter. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
8961e93e |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose append entry function Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use append_entry() and append_quit_entry() to construct the menu, so move them out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
a84040ab |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor file selection handling eficonfig_select_file_handler() is commonly used to select the file. eficonfig_display_select_file_option() adds an additional menu to clear the selected file. eficonfig_display_select_file_option() is not always necessary for the file selection process, so it must be outside of eficonfig_select_file_handler(). This commit also renames the following functions to avoid confusion. eficonfig_select_file_handler() -> eficonfig_process_select_file() eficonfig_select_file() -> eficonfig_show_file_selection() eficonfig_display_select_file_option() -> eficonfig_process_show_file_option() Finally, test_eficonfig.py need to be updated to get aligned with the above modification. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
1167e88a |
|
14-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix missing variable initialization The 'ret' variable must be initialized before use in eficonfig_delete_invalid_boot_option(). Fixes: c416f1c0bc ("bootmenu: add removable media entries") Addresses-Coverity: 376207 ("Uninitialized variables") Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
3d595ac5 |
|
09-Nov-2022 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: remove superfluous if in eficonfig_edit_boot_option Goto for an immediately succeeding label is superfluous. Fixes: 87d791423ac6 ("eficonfig: menu-driven addition of UEFI boot option") Addresses-Coverity: 376202 ("Identical code for different branches") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
2c0b0c31 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_SECURE_BOOT This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_SECURE_BOOT defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
83f3d121 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_MM_COMM_TEE This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_MM_COMM_TEE defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
88df3634 |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: CTRL+S to save the boot order 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>
|
#
45f5319f |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
menu: remove CTRL+C to quit On the sandbox called without "--terminal raw" CTRL+C leaves U-Boot, "ESC/CTRL+C to quit" is misleading. Let's remove CTRL+C to quit key handling from bootmenu and eficonfig menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
|
#
8dbd0a0f |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add vertical scroll support The current eficonfig menu does not support vertical scroll, so it can not display the menu entries greater than the console row size. This commit add the vertial scroll support. The console size is retrieved by SIMPLE_TEXT_OUTPUT_PROTOCOL.QueryMode() service, then calculates the row size for menu entry by subtracting menu header and description row size from the console row size. "start" and "end" are added in the efimenu structure. "start" keeps the menu entry index at the top, "end" keeps the bottom menu entry index. item_data_print() menu function only draws the menu entry between "start" and "end". This commit also fixes the issue that "Save" and "Quit" entries can be moved by BKEY_PLUS in change boot order menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
0d590852 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation This commit removes the change boot order specific menu implementation. The change boot order implementation calls eficonfig_process_common() same as other menus. The change boot order menu requires own item_data_print and item_choice implementation, but display_statusline function can be a same function as other menus. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
cd160b27 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor eficonfig_process_common function Current change boot order implementation does not call eficonfig_process_common() and call own menu functions for display_statusline, item_data_print and item_choice. Change boot order functionality should call eficonfig_process_common() to improve maintenanceability. This commit is a preparation to remove the change boot order specific implementation. The menu functions (display_statusline, item_data_print and item_choice) are added as argument of eficonfig_process_common(). The menu description string displayed at the bottom of the menu is also added as argument. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
32bab0ea |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Make use of CLI character processing Avoid duplicating some of the escape-sequence processing here and use the CLI function instead. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
d0ca98db |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Update bootmenu_loop() to return the code Use the return value to save having to pass around a pointer. This also resolves any ambiguity about what *key contains when the function is called. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
2da4a15e |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Rename KEY_... to BKEY_... This enum values conflict with linux/input.h so rename them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
64550274 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: avoid SetVariable between GetNextVariableName calls The current code calls efi_set_variable_int() to delete the invalid boot option between calls to efi_get_next_variable_name_int(), it may produce unpredictable results. This commit moves removal of the invalid boot option outside of the efi_get_next_variable_name_int() calls. EFI_NOT_FOUND returned from efi_get_next_variable_name_int() indicates we retrieved all EFI variables, it should be treated as EFI_SUCEESS. To address the checkpatch warning of too many leading tabs, combine two if statement into one. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
ce327084 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: carve out efi_get_next_variable_name_int calls To retrieve the EFI variable name by efi_get_next_variable_name_int(), the sequence of alloc -> efi_get_next_variable_name_int -> realloc -> efi_get_next_variable_name_int is required. In current code, this sequence repeatedly appears in the several functions. It should be curved out a common function. This commit also fixes the missing free() of var_name16 in eficonfig_delete_invalid_boot_option(). Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
140a8959 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use efi_get_next_variable_name_int() eficonfig command reads all possible UEFI load options from 0x0000 to 0xFFFF to construct the menu. This takes too much time in some environment. This commit uses efi_get_next_variable_name_int() to read all existing UEFI load options to significantlly reduce the count of efi_get_var() call. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
78b1ccc4 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use u16_strsize() to get u16 string buffer size Use u16_strsize() to simplify the u16 string buffer size calculation. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c67d3c9e |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix going one directory up issue The directory name in eficonfig menu entry contains the '\' separator. strcmp() argument ".." is wrong and one directory up handling does not work correctly. strcmp() argument must include '\' separator. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c3b5af63 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add UEFI Secure Boot Key enrollment interface This commit adds the menu-driven UEFI Secure Boot Key enrollment interface. User can enroll PK, KEK, db and dbx by selecting file. Only the signed EFI Signature List(s) with an authenticated header, typically '.auth' file, is accepted. To clear the PK, KEK, db and dbx, user needs to enroll the null key signed by PK or KEK. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
21faf4ef |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use protocol interface for file selection EFI_SIMPLE_FILE_SYSTEM_PROTOCOL is not always provided by U-Boot. Use protocol interface functions instead of U-Boot internal functions. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d6566113 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose eficonfig_create_device_path() Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use eficonfig_create_device_path() to construct the full device path from device path of the volume and file path, so move it out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d571f9b2 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation All the eficonfig menus other than "Change Boot Order" use 'eficonfig_entry' structure for each menu entry. This commit refactors change boot order implementation to use 'eficonfig_entry' structure same as other menus to have consistent menu handling. This commit also simplifies the data->active handling when KEY_SPACE is pressed, and sizeof() parameter. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
8961e93e |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose append entry function Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use append_entry() and append_quit_entry() to construct the menu, so move them out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
a84040ab |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor file selection handling eficonfig_select_file_handler() is commonly used to select the file. eficonfig_display_select_file_option() adds an additional menu to clear the selected file. eficonfig_display_select_file_option() is not always necessary for the file selection process, so it must be outside of eficonfig_select_file_handler(). This commit also renames the following functions to avoid confusion. eficonfig_select_file_handler() -> eficonfig_process_select_file() eficonfig_select_file() -> eficonfig_show_file_selection() eficonfig_display_select_file_option() -> eficonfig_process_show_file_option() Finally, test_eficonfig.py need to be updated to get aligned with the above modification. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
1167e88a |
|
14-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix missing variable initialization The 'ret' variable must be initialized before use in eficonfig_delete_invalid_boot_option(). Fixes: c416f1c0bc ("bootmenu: add removable media entries") Addresses-Coverity: 376207 ("Uninitialized variables") Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
3d595ac5 |
|
09-Nov-2022 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: remove superfluous if in eficonfig_edit_boot_option Goto for an immediately succeeding label is superfluous. Fixes: 87d791423ac6 ("eficonfig: menu-driven addition of UEFI boot option") Addresses-Coverity: 376202 ("Identical code for different branches") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
2c0b0c31 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_SECURE_BOOT This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_SECURE_BOOT defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
83f3d121 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_MM_COMM_TEE This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_MM_COMM_TEE defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
88df3634 |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: CTRL+S to save the boot order 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>
|
#
45f5319f |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
menu: remove CTRL+C to quit On the sandbox called without "--terminal raw" CTRL+C leaves U-Boot, "ESC/CTRL+C to quit" is misleading. Let's remove CTRL+C to quit key handling from bootmenu and eficonfig menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
|
#
8dbd0a0f |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add vertical scroll support The current eficonfig menu does not support vertical scroll, so it can not display the menu entries greater than the console row size. This commit add the vertial scroll support. The console size is retrieved by SIMPLE_TEXT_OUTPUT_PROTOCOL.QueryMode() service, then calculates the row size for menu entry by subtracting menu header and description row size from the console row size. "start" and "end" are added in the efimenu structure. "start" keeps the menu entry index at the top, "end" keeps the bottom menu entry index. item_data_print() menu function only draws the menu entry between "start" and "end". This commit also fixes the issue that "Save" and "Quit" entries can be moved by BKEY_PLUS in change boot order menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
0d590852 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation This commit removes the change boot order specific menu implementation. The change boot order implementation calls eficonfig_process_common() same as other menus. The change boot order menu requires own item_data_print and item_choice implementation, but display_statusline function can be a same function as other menus. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
cd160b27 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor eficonfig_process_common function Current change boot order implementation does not call eficonfig_process_common() and call own menu functions for display_statusline, item_data_print and item_choice. Change boot order functionality should call eficonfig_process_common() to improve maintenanceability. This commit is a preparation to remove the change boot order specific implementation. The menu functions (display_statusline, item_data_print and item_choice) are added as argument of eficonfig_process_common(). The menu description string displayed at the bottom of the menu is also added as argument. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
32bab0ea |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Make use of CLI character processing Avoid duplicating some of the escape-sequence processing here and use the CLI function instead. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
d0ca98db |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Update bootmenu_loop() to return the code Use the return value to save having to pass around a pointer. This also resolves any ambiguity about what *key contains when the function is called. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
2da4a15e |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Rename KEY_... to BKEY_... This enum values conflict with linux/input.h so rename them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
64550274 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: avoid SetVariable between GetNextVariableName calls The current code calls efi_set_variable_int() to delete the invalid boot option between calls to efi_get_next_variable_name_int(), it may produce unpredictable results. This commit moves removal of the invalid boot option outside of the efi_get_next_variable_name_int() calls. EFI_NOT_FOUND returned from efi_get_next_variable_name_int() indicates we retrieved all EFI variables, it should be treated as EFI_SUCEESS. To address the checkpatch warning of too many leading tabs, combine two if statement into one. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
ce327084 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: carve out efi_get_next_variable_name_int calls To retrieve the EFI variable name by efi_get_next_variable_name_int(), the sequence of alloc -> efi_get_next_variable_name_int -> realloc -> efi_get_next_variable_name_int is required. In current code, this sequence repeatedly appears in the several functions. It should be curved out a common function. This commit also fixes the missing free() of var_name16 in eficonfig_delete_invalid_boot_option(). Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
140a8959 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use efi_get_next_variable_name_int() eficonfig command reads all possible UEFI load options from 0x0000 to 0xFFFF to construct the menu. This takes too much time in some environment. This commit uses efi_get_next_variable_name_int() to read all existing UEFI load options to significantlly reduce the count of efi_get_var() call. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
78b1ccc4 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use u16_strsize() to get u16 string buffer size Use u16_strsize() to simplify the u16 string buffer size calculation. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c67d3c9e |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix going one directory up issue The directory name in eficonfig menu entry contains the '\' separator. strcmp() argument ".." is wrong and one directory up handling does not work correctly. strcmp() argument must include '\' separator. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c3b5af63 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add UEFI Secure Boot Key enrollment interface This commit adds the menu-driven UEFI Secure Boot Key enrollment interface. User can enroll PK, KEK, db and dbx by selecting file. Only the signed EFI Signature List(s) with an authenticated header, typically '.auth' file, is accepted. To clear the PK, KEK, db and dbx, user needs to enroll the null key signed by PK or KEK. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
21faf4ef |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use protocol interface for file selection EFI_SIMPLE_FILE_SYSTEM_PROTOCOL is not always provided by U-Boot. Use protocol interface functions instead of U-Boot internal functions. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d6566113 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose eficonfig_create_device_path() Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use eficonfig_create_device_path() to construct the full device path from device path of the volume and file path, so move it out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d571f9b2 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation All the eficonfig menus other than "Change Boot Order" use 'eficonfig_entry' structure for each menu entry. This commit refactors change boot order implementation to use 'eficonfig_entry' structure same as other menus to have consistent menu handling. This commit also simplifies the data->active handling when KEY_SPACE is pressed, and sizeof() parameter. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
8961e93e |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose append entry function Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use append_entry() and append_quit_entry() to construct the menu, so move them out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
a84040ab |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor file selection handling eficonfig_select_file_handler() is commonly used to select the file. eficonfig_display_select_file_option() adds an additional menu to clear the selected file. eficonfig_display_select_file_option() is not always necessary for the file selection process, so it must be outside of eficonfig_select_file_handler(). This commit also renames the following functions to avoid confusion. eficonfig_select_file_handler() -> eficonfig_process_select_file() eficonfig_select_file() -> eficonfig_show_file_selection() eficonfig_display_select_file_option() -> eficonfig_process_show_file_option() Finally, test_eficonfig.py need to be updated to get aligned with the above modification. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
1167e88a |
|
14-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix missing variable initialization The 'ret' variable must be initialized before use in eficonfig_delete_invalid_boot_option(). Fixes: c416f1c0bc ("bootmenu: add removable media entries") Addresses-Coverity: 376207 ("Uninitialized variables") Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
3d595ac5 |
|
09-Nov-2022 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: remove superfluous if in eficonfig_edit_boot_option Goto for an immediately succeeding label is superfluous. Fixes: 87d791423ac6 ("eficonfig: menu-driven addition of UEFI boot option") Addresses-Coverity: 376202 ("Identical code for different branches") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
2c0b0c31 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_SECURE_BOOT This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_SECURE_BOOT defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
83f3d121 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_MM_COMM_TEE This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_MM_COMM_TEE defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
88df3634 |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: CTRL+S to save the boot order 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>
|
#
45f5319f |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
menu: remove CTRL+C to quit On the sandbox called without "--terminal raw" CTRL+C leaves U-Boot, "ESC/CTRL+C to quit" is misleading. Let's remove CTRL+C to quit key handling from bootmenu and eficonfig menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
|
#
8dbd0a0f |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add vertical scroll support The current eficonfig menu does not support vertical scroll, so it can not display the menu entries greater than the console row size. This commit add the vertial scroll support. The console size is retrieved by SIMPLE_TEXT_OUTPUT_PROTOCOL.QueryMode() service, then calculates the row size for menu entry by subtracting menu header and description row size from the console row size. "start" and "end" are added in the efimenu structure. "start" keeps the menu entry index at the top, "end" keeps the bottom menu entry index. item_data_print() menu function only draws the menu entry between "start" and "end". This commit also fixes the issue that "Save" and "Quit" entries can be moved by BKEY_PLUS in change boot order menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
0d590852 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation This commit removes the change boot order specific menu implementation. The change boot order implementation calls eficonfig_process_common() same as other menus. The change boot order menu requires own item_data_print and item_choice implementation, but display_statusline function can be a same function as other menus. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
cd160b27 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor eficonfig_process_common function Current change boot order implementation does not call eficonfig_process_common() and call own menu functions for display_statusline, item_data_print and item_choice. Change boot order functionality should call eficonfig_process_common() to improve maintenanceability. This commit is a preparation to remove the change boot order specific implementation. The menu functions (display_statusline, item_data_print and item_choice) are added as argument of eficonfig_process_common(). The menu description string displayed at the bottom of the menu is also added as argument. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
32bab0ea |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Make use of CLI character processing Avoid duplicating some of the escape-sequence processing here and use the CLI function instead. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
d0ca98db |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Update bootmenu_loop() to return the code Use the return value to save having to pass around a pointer. This also resolves any ambiguity about what *key contains when the function is called. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
2da4a15e |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Rename KEY_... to BKEY_... This enum values conflict with linux/input.h so rename them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
64550274 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: avoid SetVariable between GetNextVariableName calls The current code calls efi_set_variable_int() to delete the invalid boot option between calls to efi_get_next_variable_name_int(), it may produce unpredictable results. This commit moves removal of the invalid boot option outside of the efi_get_next_variable_name_int() calls. EFI_NOT_FOUND returned from efi_get_next_variable_name_int() indicates we retrieved all EFI variables, it should be treated as EFI_SUCEESS. To address the checkpatch warning of too many leading tabs, combine two if statement into one. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
ce327084 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: carve out efi_get_next_variable_name_int calls To retrieve the EFI variable name by efi_get_next_variable_name_int(), the sequence of alloc -> efi_get_next_variable_name_int -> realloc -> efi_get_next_variable_name_int is required. In current code, this sequence repeatedly appears in the several functions. It should be curved out a common function. This commit also fixes the missing free() of var_name16 in eficonfig_delete_invalid_boot_option(). Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
140a8959 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use efi_get_next_variable_name_int() eficonfig command reads all possible UEFI load options from 0x0000 to 0xFFFF to construct the menu. This takes too much time in some environment. This commit uses efi_get_next_variable_name_int() to read all existing UEFI load options to significantlly reduce the count of efi_get_var() call. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
78b1ccc4 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use u16_strsize() to get u16 string buffer size Use u16_strsize() to simplify the u16 string buffer size calculation. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c67d3c9e |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix going one directory up issue The directory name in eficonfig menu entry contains the '\' separator. strcmp() argument ".." is wrong and one directory up handling does not work correctly. strcmp() argument must include '\' separator. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c3b5af63 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add UEFI Secure Boot Key enrollment interface This commit adds the menu-driven UEFI Secure Boot Key enrollment interface. User can enroll PK, KEK, db and dbx by selecting file. Only the signed EFI Signature List(s) with an authenticated header, typically '.auth' file, is accepted. To clear the PK, KEK, db and dbx, user needs to enroll the null key signed by PK or KEK. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
21faf4ef |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use protocol interface for file selection EFI_SIMPLE_FILE_SYSTEM_PROTOCOL is not always provided by U-Boot. Use protocol interface functions instead of U-Boot internal functions. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d6566113 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose eficonfig_create_device_path() Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use eficonfig_create_device_path() to construct the full device path from device path of the volume and file path, so move it out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d571f9b2 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation All the eficonfig menus other than "Change Boot Order" use 'eficonfig_entry' structure for each menu entry. This commit refactors change boot order implementation to use 'eficonfig_entry' structure same as other menus to have consistent menu handling. This commit also simplifies the data->active handling when KEY_SPACE is pressed, and sizeof() parameter. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
8961e93e |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose append entry function Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use append_entry() and append_quit_entry() to construct the menu, so move them out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
a84040ab |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor file selection handling eficonfig_select_file_handler() is commonly used to select the file. eficonfig_display_select_file_option() adds an additional menu to clear the selected file. eficonfig_display_select_file_option() is not always necessary for the file selection process, so it must be outside of eficonfig_select_file_handler(). This commit also renames the following functions to avoid confusion. eficonfig_select_file_handler() -> eficonfig_process_select_file() eficonfig_select_file() -> eficonfig_show_file_selection() eficonfig_display_select_file_option() -> eficonfig_process_show_file_option() Finally, test_eficonfig.py need to be updated to get aligned with the above modification. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
1167e88a |
|
14-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix missing variable initialization The 'ret' variable must be initialized before use in eficonfig_delete_invalid_boot_option(). Fixes: c416f1c0bc ("bootmenu: add removable media entries") Addresses-Coverity: 376207 ("Uninitialized variables") Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
3d595ac5 |
|
09-Nov-2022 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: remove superfluous if in eficonfig_edit_boot_option Goto for an immediately succeeding label is superfluous. Fixes: 87d791423ac6 ("eficonfig: menu-driven addition of UEFI boot option") Addresses-Coverity: 376202 ("Identical code for different branches") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
2c0b0c31 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_SECURE_BOOT This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_SECURE_BOOT defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
83f3d121 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_MM_COMM_TEE This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_MM_COMM_TEE defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
88df3634 |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: CTRL+S to save the boot order 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>
|
#
45f5319f |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
menu: remove CTRL+C to quit On the sandbox called without "--terminal raw" CTRL+C leaves U-Boot, "ESC/CTRL+C to quit" is misleading. Let's remove CTRL+C to quit key handling from bootmenu and eficonfig menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
|
#
8dbd0a0f |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add vertical scroll support The current eficonfig menu does not support vertical scroll, so it can not display the menu entries greater than the console row size. This commit add the vertial scroll support. The console size is retrieved by SIMPLE_TEXT_OUTPUT_PROTOCOL.QueryMode() service, then calculates the row size for menu entry by subtracting menu header and description row size from the console row size. "start" and "end" are added in the efimenu structure. "start" keeps the menu entry index at the top, "end" keeps the bottom menu entry index. item_data_print() menu function only draws the menu entry between "start" and "end". This commit also fixes the issue that "Save" and "Quit" entries can be moved by BKEY_PLUS in change boot order menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
0d590852 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation This commit removes the change boot order specific menu implementation. The change boot order implementation calls eficonfig_process_common() same as other menus. The change boot order menu requires own item_data_print and item_choice implementation, but display_statusline function can be a same function as other menus. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
cd160b27 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor eficonfig_process_common function Current change boot order implementation does not call eficonfig_process_common() and call own menu functions for display_statusline, item_data_print and item_choice. Change boot order functionality should call eficonfig_process_common() to improve maintenanceability. This commit is a preparation to remove the change boot order specific implementation. The menu functions (display_statusline, item_data_print and item_choice) are added as argument of eficonfig_process_common(). The menu description string displayed at the bottom of the menu is also added as argument. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
32bab0ea |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Make use of CLI character processing Avoid duplicating some of the escape-sequence processing here and use the CLI function instead. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
d0ca98db |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Update bootmenu_loop() to return the code Use the return value to save having to pass around a pointer. This also resolves any ambiguity about what *key contains when the function is called. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
2da4a15e |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Rename KEY_... to BKEY_... This enum values conflict with linux/input.h so rename them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
64550274 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: avoid SetVariable between GetNextVariableName calls The current code calls efi_set_variable_int() to delete the invalid boot option between calls to efi_get_next_variable_name_int(), it may produce unpredictable results. This commit moves removal of the invalid boot option outside of the efi_get_next_variable_name_int() calls. EFI_NOT_FOUND returned from efi_get_next_variable_name_int() indicates we retrieved all EFI variables, it should be treated as EFI_SUCEESS. To address the checkpatch warning of too many leading tabs, combine two if statement into one. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
ce327084 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: carve out efi_get_next_variable_name_int calls To retrieve the EFI variable name by efi_get_next_variable_name_int(), the sequence of alloc -> efi_get_next_variable_name_int -> realloc -> efi_get_next_variable_name_int is required. In current code, this sequence repeatedly appears in the several functions. It should be curved out a common function. This commit also fixes the missing free() of var_name16 in eficonfig_delete_invalid_boot_option(). Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
140a8959 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use efi_get_next_variable_name_int() eficonfig command reads all possible UEFI load options from 0x0000 to 0xFFFF to construct the menu. This takes too much time in some environment. This commit uses efi_get_next_variable_name_int() to read all existing UEFI load options to significantlly reduce the count of efi_get_var() call. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
78b1ccc4 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use u16_strsize() to get u16 string buffer size Use u16_strsize() to simplify the u16 string buffer size calculation. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c67d3c9e |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix going one directory up issue The directory name in eficonfig menu entry contains the '\' separator. strcmp() argument ".." is wrong and one directory up handling does not work correctly. strcmp() argument must include '\' separator. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c3b5af63 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add UEFI Secure Boot Key enrollment interface This commit adds the menu-driven UEFI Secure Boot Key enrollment interface. User can enroll PK, KEK, db and dbx by selecting file. Only the signed EFI Signature List(s) with an authenticated header, typically '.auth' file, is accepted. To clear the PK, KEK, db and dbx, user needs to enroll the null key signed by PK or KEK. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
21faf4ef |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use protocol interface for file selection EFI_SIMPLE_FILE_SYSTEM_PROTOCOL is not always provided by U-Boot. Use protocol interface functions instead of U-Boot internal functions. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d6566113 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose eficonfig_create_device_path() Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use eficonfig_create_device_path() to construct the full device path from device path of the volume and file path, so move it out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d571f9b2 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation All the eficonfig menus other than "Change Boot Order" use 'eficonfig_entry' structure for each menu entry. This commit refactors change boot order implementation to use 'eficonfig_entry' structure same as other menus to have consistent menu handling. This commit also simplifies the data->active handling when KEY_SPACE is pressed, and sizeof() parameter. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
8961e93e |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose append entry function Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use append_entry() and append_quit_entry() to construct the menu, so move them out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
a84040ab |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor file selection handling eficonfig_select_file_handler() is commonly used to select the file. eficonfig_display_select_file_option() adds an additional menu to clear the selected file. eficonfig_display_select_file_option() is not always necessary for the file selection process, so it must be outside of eficonfig_select_file_handler(). This commit also renames the following functions to avoid confusion. eficonfig_select_file_handler() -> eficonfig_process_select_file() eficonfig_select_file() -> eficonfig_show_file_selection() eficonfig_display_select_file_option() -> eficonfig_process_show_file_option() Finally, test_eficonfig.py need to be updated to get aligned with the above modification. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
1167e88a |
|
14-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix missing variable initialization The 'ret' variable must be initialized before use in eficonfig_delete_invalid_boot_option(). Fixes: c416f1c0bc ("bootmenu: add removable media entries") Addresses-Coverity: 376207 ("Uninitialized variables") Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
3d595ac5 |
|
09-Nov-2022 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: remove superfluous if in eficonfig_edit_boot_option Goto for an immediately succeeding label is superfluous. Fixes: 87d791423ac6 ("eficonfig: menu-driven addition of UEFI boot option") Addresses-Coverity: 376202 ("Identical code for different branches") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
2c0b0c31 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_SECURE_BOOT This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_SECURE_BOOT defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
83f3d121 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_MM_COMM_TEE This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_MM_COMM_TEE defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
88df3634 |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: CTRL+S to save the boot order 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>
|
#
45f5319f |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
menu: remove CTRL+C to quit On the sandbox called without "--terminal raw" CTRL+C leaves U-Boot, "ESC/CTRL+C to quit" is misleading. Let's remove CTRL+C to quit key handling from bootmenu and eficonfig menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
|
#
8dbd0a0f |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add vertical scroll support The current eficonfig menu does not support vertical scroll, so it can not display the menu entries greater than the console row size. This commit add the vertial scroll support. The console size is retrieved by SIMPLE_TEXT_OUTPUT_PROTOCOL.QueryMode() service, then calculates the row size for menu entry by subtracting menu header and description row size from the console row size. "start" and "end" are added in the efimenu structure. "start" keeps the menu entry index at the top, "end" keeps the bottom menu entry index. item_data_print() menu function only draws the menu entry between "start" and "end". This commit also fixes the issue that "Save" and "Quit" entries can be moved by BKEY_PLUS in change boot order menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
0d590852 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation This commit removes the change boot order specific menu implementation. The change boot order implementation calls eficonfig_process_common() same as other menus. The change boot order menu requires own item_data_print and item_choice implementation, but display_statusline function can be a same function as other menus. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
cd160b27 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor eficonfig_process_common function Current change boot order implementation does not call eficonfig_process_common() and call own menu functions for display_statusline, item_data_print and item_choice. Change boot order functionality should call eficonfig_process_common() to improve maintenanceability. This commit is a preparation to remove the change boot order specific implementation. The menu functions (display_statusline, item_data_print and item_choice) are added as argument of eficonfig_process_common(). The menu description string displayed at the bottom of the menu is also added as argument. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
32bab0ea |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Make use of CLI character processing Avoid duplicating some of the escape-sequence processing here and use the CLI function instead. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
d0ca98db |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Update bootmenu_loop() to return the code Use the return value to save having to pass around a pointer. This also resolves any ambiguity about what *key contains when the function is called. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
2da4a15e |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Rename KEY_... to BKEY_... This enum values conflict with linux/input.h so rename them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
64550274 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: avoid SetVariable between GetNextVariableName calls The current code calls efi_set_variable_int() to delete the invalid boot option between calls to efi_get_next_variable_name_int(), it may produce unpredictable results. This commit moves removal of the invalid boot option outside of the efi_get_next_variable_name_int() calls. EFI_NOT_FOUND returned from efi_get_next_variable_name_int() indicates we retrieved all EFI variables, it should be treated as EFI_SUCEESS. To address the checkpatch warning of too many leading tabs, combine two if statement into one. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
ce327084 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: carve out efi_get_next_variable_name_int calls To retrieve the EFI variable name by efi_get_next_variable_name_int(), the sequence of alloc -> efi_get_next_variable_name_int -> realloc -> efi_get_next_variable_name_int is required. In current code, this sequence repeatedly appears in the several functions. It should be curved out a common function. This commit also fixes the missing free() of var_name16 in eficonfig_delete_invalid_boot_option(). Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
140a8959 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use efi_get_next_variable_name_int() eficonfig command reads all possible UEFI load options from 0x0000 to 0xFFFF to construct the menu. This takes too much time in some environment. This commit uses efi_get_next_variable_name_int() to read all existing UEFI load options to significantlly reduce the count of efi_get_var() call. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
78b1ccc4 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use u16_strsize() to get u16 string buffer size Use u16_strsize() to simplify the u16 string buffer size calculation. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c67d3c9e |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix going one directory up issue The directory name in eficonfig menu entry contains the '\' separator. strcmp() argument ".." is wrong and one directory up handling does not work correctly. strcmp() argument must include '\' separator. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c3b5af63 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add UEFI Secure Boot Key enrollment interface This commit adds the menu-driven UEFI Secure Boot Key enrollment interface. User can enroll PK, KEK, db and dbx by selecting file. Only the signed EFI Signature List(s) with an authenticated header, typically '.auth' file, is accepted. To clear the PK, KEK, db and dbx, user needs to enroll the null key signed by PK or KEK. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
21faf4ef |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use protocol interface for file selection EFI_SIMPLE_FILE_SYSTEM_PROTOCOL is not always provided by U-Boot. Use protocol interface functions instead of U-Boot internal functions. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d6566113 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose eficonfig_create_device_path() Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use eficonfig_create_device_path() to construct the full device path from device path of the volume and file path, so move it out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d571f9b2 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation All the eficonfig menus other than "Change Boot Order" use 'eficonfig_entry' structure for each menu entry. This commit refactors change boot order implementation to use 'eficonfig_entry' structure same as other menus to have consistent menu handling. This commit also simplifies the data->active handling when KEY_SPACE is pressed, and sizeof() parameter. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
8961e93e |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose append entry function Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use append_entry() and append_quit_entry() to construct the menu, so move them out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
a84040ab |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor file selection handling eficonfig_select_file_handler() is commonly used to select the file. eficonfig_display_select_file_option() adds an additional menu to clear the selected file. eficonfig_display_select_file_option() is not always necessary for the file selection process, so it must be outside of eficonfig_select_file_handler(). This commit also renames the following functions to avoid confusion. eficonfig_select_file_handler() -> eficonfig_process_select_file() eficonfig_select_file() -> eficonfig_show_file_selection() eficonfig_display_select_file_option() -> eficonfig_process_show_file_option() Finally, test_eficonfig.py need to be updated to get aligned with the above modification. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
1167e88a |
|
14-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix missing variable initialization The 'ret' variable must be initialized before use in eficonfig_delete_invalid_boot_option(). Fixes: c416f1c0bc ("bootmenu: add removable media entries") Addresses-Coverity: 376207 ("Uninitialized variables") Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
3d595ac5 |
|
09-Nov-2022 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: remove superfluous if in eficonfig_edit_boot_option Goto for an immediately succeeding label is superfluous. Fixes: 87d791423ac6 ("eficonfig: menu-driven addition of UEFI boot option") Addresses-Coverity: 376202 ("Identical code for different branches") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
2c0b0c31 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_SECURE_BOOT This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_SECURE_BOOT defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
83f3d121 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_MM_COMM_TEE This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_MM_COMM_TEE defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
88df3634 |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: CTRL+S to save the boot order 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>
|
#
45f5319f |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
menu: remove CTRL+C to quit On the sandbox called without "--terminal raw" CTRL+C leaves U-Boot, "ESC/CTRL+C to quit" is misleading. Let's remove CTRL+C to quit key handling from bootmenu and eficonfig menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
|
#
8dbd0a0f |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add vertical scroll support The current eficonfig menu does not support vertical scroll, so it can not display the menu entries greater than the console row size. This commit add the vertial scroll support. The console size is retrieved by SIMPLE_TEXT_OUTPUT_PROTOCOL.QueryMode() service, then calculates the row size for menu entry by subtracting menu header and description row size from the console row size. "start" and "end" are added in the efimenu structure. "start" keeps the menu entry index at the top, "end" keeps the bottom menu entry index. item_data_print() menu function only draws the menu entry between "start" and "end". This commit also fixes the issue that "Save" and "Quit" entries can be moved by BKEY_PLUS in change boot order menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
0d590852 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation This commit removes the change boot order specific menu implementation. The change boot order implementation calls eficonfig_process_common() same as other menus. The change boot order menu requires own item_data_print and item_choice implementation, but display_statusline function can be a same function as other menus. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
cd160b27 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor eficonfig_process_common function Current change boot order implementation does not call eficonfig_process_common() and call own menu functions for display_statusline, item_data_print and item_choice. Change boot order functionality should call eficonfig_process_common() to improve maintenanceability. This commit is a preparation to remove the change boot order specific implementation. The menu functions (display_statusline, item_data_print and item_choice) are added as argument of eficonfig_process_common(). The menu description string displayed at the bottom of the menu is also added as argument. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
32bab0ea |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Make use of CLI character processing Avoid duplicating some of the escape-sequence processing here and use the CLI function instead. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
d0ca98db |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Update bootmenu_loop() to return the code Use the return value to save having to pass around a pointer. This also resolves any ambiguity about what *key contains when the function is called. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
2da4a15e |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Rename KEY_... to BKEY_... This enum values conflict with linux/input.h so rename them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
64550274 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: avoid SetVariable between GetNextVariableName calls The current code calls efi_set_variable_int() to delete the invalid boot option between calls to efi_get_next_variable_name_int(), it may produce unpredictable results. This commit moves removal of the invalid boot option outside of the efi_get_next_variable_name_int() calls. EFI_NOT_FOUND returned from efi_get_next_variable_name_int() indicates we retrieved all EFI variables, it should be treated as EFI_SUCEESS. To address the checkpatch warning of too many leading tabs, combine two if statement into one. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
ce327084 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: carve out efi_get_next_variable_name_int calls To retrieve the EFI variable name by efi_get_next_variable_name_int(), the sequence of alloc -> efi_get_next_variable_name_int -> realloc -> efi_get_next_variable_name_int is required. In current code, this sequence repeatedly appears in the several functions. It should be curved out a common function. This commit also fixes the missing free() of var_name16 in eficonfig_delete_invalid_boot_option(). Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
140a8959 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use efi_get_next_variable_name_int() eficonfig command reads all possible UEFI load options from 0x0000 to 0xFFFF to construct the menu. This takes too much time in some environment. This commit uses efi_get_next_variable_name_int() to read all existing UEFI load options to significantlly reduce the count of efi_get_var() call. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
78b1ccc4 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use u16_strsize() to get u16 string buffer size Use u16_strsize() to simplify the u16 string buffer size calculation. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c67d3c9e |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix going one directory up issue The directory name in eficonfig menu entry contains the '\' separator. strcmp() argument ".." is wrong and one directory up handling does not work correctly. strcmp() argument must include '\' separator. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c3b5af63 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add UEFI Secure Boot Key enrollment interface This commit adds the menu-driven UEFI Secure Boot Key enrollment interface. User can enroll PK, KEK, db and dbx by selecting file. Only the signed EFI Signature List(s) with an authenticated header, typically '.auth' file, is accepted. To clear the PK, KEK, db and dbx, user needs to enroll the null key signed by PK or KEK. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
21faf4ef |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use protocol interface for file selection EFI_SIMPLE_FILE_SYSTEM_PROTOCOL is not always provided by U-Boot. Use protocol interface functions instead of U-Boot internal functions. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d6566113 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose eficonfig_create_device_path() Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use eficonfig_create_device_path() to construct the full device path from device path of the volume and file path, so move it out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d571f9b2 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation All the eficonfig menus other than "Change Boot Order" use 'eficonfig_entry' structure for each menu entry. This commit refactors change boot order implementation to use 'eficonfig_entry' structure same as other menus to have consistent menu handling. This commit also simplifies the data->active handling when KEY_SPACE is pressed, and sizeof() parameter. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
8961e93e |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose append entry function Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use append_entry() and append_quit_entry() to construct the menu, so move them out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
a84040ab |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor file selection handling eficonfig_select_file_handler() is commonly used to select the file. eficonfig_display_select_file_option() adds an additional menu to clear the selected file. eficonfig_display_select_file_option() is not always necessary for the file selection process, so it must be outside of eficonfig_select_file_handler(). This commit also renames the following functions to avoid confusion. eficonfig_select_file_handler() -> eficonfig_process_select_file() eficonfig_select_file() -> eficonfig_show_file_selection() eficonfig_display_select_file_option() -> eficonfig_process_show_file_option() Finally, test_eficonfig.py need to be updated to get aligned with the above modification. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
1167e88a |
|
14-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix missing variable initialization The 'ret' variable must be initialized before use in eficonfig_delete_invalid_boot_option(). Fixes: c416f1c0bc ("bootmenu: add removable media entries") Addresses-Coverity: 376207 ("Uninitialized variables") Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
3d595ac5 |
|
09-Nov-2022 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: remove superfluous if in eficonfig_edit_boot_option Goto for an immediately succeeding label is superfluous. Fixes: 87d791423ac6 ("eficonfig: menu-driven addition of UEFI boot option") Addresses-Coverity: 376202 ("Identical code for different branches") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
2c0b0c31 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_SECURE_BOOT This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_SECURE_BOOT defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
83f3d121 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_MM_COMM_TEE This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_MM_COMM_TEE defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
88df3634 |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: CTRL+S to save the boot order 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>
|
#
45f5319f |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
menu: remove CTRL+C to quit On the sandbox called without "--terminal raw" CTRL+C leaves U-Boot, "ESC/CTRL+C to quit" is misleading. Let's remove CTRL+C to quit key handling from bootmenu and eficonfig menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
|
#
8dbd0a0f |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add vertical scroll support The current eficonfig menu does not support vertical scroll, so it can not display the menu entries greater than the console row size. This commit add the vertial scroll support. The console size is retrieved by SIMPLE_TEXT_OUTPUT_PROTOCOL.QueryMode() service, then calculates the row size for menu entry by subtracting menu header and description row size from the console row size. "start" and "end" are added in the efimenu structure. "start" keeps the menu entry index at the top, "end" keeps the bottom menu entry index. item_data_print() menu function only draws the menu entry between "start" and "end". This commit also fixes the issue that "Save" and "Quit" entries can be moved by BKEY_PLUS in change boot order menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
0d590852 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation This commit removes the change boot order specific menu implementation. The change boot order implementation calls eficonfig_process_common() same as other menus. The change boot order menu requires own item_data_print and item_choice implementation, but display_statusline function can be a same function as other menus. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
cd160b27 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor eficonfig_process_common function Current change boot order implementation does not call eficonfig_process_common() and call own menu functions for display_statusline, item_data_print and item_choice. Change boot order functionality should call eficonfig_process_common() to improve maintenanceability. This commit is a preparation to remove the change boot order specific implementation. The menu functions (display_statusline, item_data_print and item_choice) are added as argument of eficonfig_process_common(). The menu description string displayed at the bottom of the menu is also added as argument. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
32bab0ea |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Make use of CLI character processing Avoid duplicating some of the escape-sequence processing here and use the CLI function instead. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
d0ca98db |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Update bootmenu_loop() to return the code Use the return value to save having to pass around a pointer. This also resolves any ambiguity about what *key contains when the function is called. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
2da4a15e |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Rename KEY_... to BKEY_... This enum values conflict with linux/input.h so rename them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
64550274 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: avoid SetVariable between GetNextVariableName calls The current code calls efi_set_variable_int() to delete the invalid boot option between calls to efi_get_next_variable_name_int(), it may produce unpredictable results. This commit moves removal of the invalid boot option outside of the efi_get_next_variable_name_int() calls. EFI_NOT_FOUND returned from efi_get_next_variable_name_int() indicates we retrieved all EFI variables, it should be treated as EFI_SUCEESS. To address the checkpatch warning of too many leading tabs, combine two if statement into one. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
ce327084 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: carve out efi_get_next_variable_name_int calls To retrieve the EFI variable name by efi_get_next_variable_name_int(), the sequence of alloc -> efi_get_next_variable_name_int -> realloc -> efi_get_next_variable_name_int is required. In current code, this sequence repeatedly appears in the several functions. It should be curved out a common function. This commit also fixes the missing free() of var_name16 in eficonfig_delete_invalid_boot_option(). Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
140a8959 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use efi_get_next_variable_name_int() eficonfig command reads all possible UEFI load options from 0x0000 to 0xFFFF to construct the menu. This takes too much time in some environment. This commit uses efi_get_next_variable_name_int() to read all existing UEFI load options to significantlly reduce the count of efi_get_var() call. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
78b1ccc4 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use u16_strsize() to get u16 string buffer size Use u16_strsize() to simplify the u16 string buffer size calculation. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c67d3c9e |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix going one directory up issue The directory name in eficonfig menu entry contains the '\' separator. strcmp() argument ".." is wrong and one directory up handling does not work correctly. strcmp() argument must include '\' separator. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c3b5af63 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add UEFI Secure Boot Key enrollment interface This commit adds the menu-driven UEFI Secure Boot Key enrollment interface. User can enroll PK, KEK, db and dbx by selecting file. Only the signed EFI Signature List(s) with an authenticated header, typically '.auth' file, is accepted. To clear the PK, KEK, db and dbx, user needs to enroll the null key signed by PK or KEK. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
21faf4ef |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use protocol interface for file selection EFI_SIMPLE_FILE_SYSTEM_PROTOCOL is not always provided by U-Boot. Use protocol interface functions instead of U-Boot internal functions. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d6566113 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose eficonfig_create_device_path() Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use eficonfig_create_device_path() to construct the full device path from device path of the volume and file path, so move it out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d571f9b2 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation All the eficonfig menus other than "Change Boot Order" use 'eficonfig_entry' structure for each menu entry. This commit refactors change boot order implementation to use 'eficonfig_entry' structure same as other menus to have consistent menu handling. This commit also simplifies the data->active handling when KEY_SPACE is pressed, and sizeof() parameter. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
8961e93e |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose append entry function Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use append_entry() and append_quit_entry() to construct the menu, so move them out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
a84040ab |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor file selection handling eficonfig_select_file_handler() is commonly used to select the file. eficonfig_display_select_file_option() adds an additional menu to clear the selected file. eficonfig_display_select_file_option() is not always necessary for the file selection process, so it must be outside of eficonfig_select_file_handler(). This commit also renames the following functions to avoid confusion. eficonfig_select_file_handler() -> eficonfig_process_select_file() eficonfig_select_file() -> eficonfig_show_file_selection() eficonfig_display_select_file_option() -> eficonfig_process_show_file_option() Finally, test_eficonfig.py need to be updated to get aligned with the above modification. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
1167e88a |
|
14-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix missing variable initialization The 'ret' variable must be initialized before use in eficonfig_delete_invalid_boot_option(). Fixes: c416f1c0bc ("bootmenu: add removable media entries") Addresses-Coverity: 376207 ("Uninitialized variables") Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
3d595ac5 |
|
09-Nov-2022 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: remove superfluous if in eficonfig_edit_boot_option Goto for an immediately succeeding label is superfluous. Fixes: 87d791423ac6 ("eficonfig: menu-driven addition of UEFI boot option") Addresses-Coverity: 376202 ("Identical code for different branches") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
2c0b0c31 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_SECURE_BOOT This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_SECURE_BOOT defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
83f3d121 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_MM_COMM_TEE This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_MM_COMM_TEE defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
88df3634 |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: CTRL+S to save the boot order 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>
|
#
45f5319f |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
menu: remove CTRL+C to quit On the sandbox called without "--terminal raw" CTRL+C leaves U-Boot, "ESC/CTRL+C to quit" is misleading. Let's remove CTRL+C to quit key handling from bootmenu and eficonfig menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
|
#
8dbd0a0f |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add vertical scroll support The current eficonfig menu does not support vertical scroll, so it can not display the menu entries greater than the console row size. This commit add the vertial scroll support. The console size is retrieved by SIMPLE_TEXT_OUTPUT_PROTOCOL.QueryMode() service, then calculates the row size for menu entry by subtracting menu header and description row size from the console row size. "start" and "end" are added in the efimenu structure. "start" keeps the menu entry index at the top, "end" keeps the bottom menu entry index. item_data_print() menu function only draws the menu entry between "start" and "end". This commit also fixes the issue that "Save" and "Quit" entries can be moved by BKEY_PLUS in change boot order menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
0d590852 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation This commit removes the change boot order specific menu implementation. The change boot order implementation calls eficonfig_process_common() same as other menus. The change boot order menu requires own item_data_print and item_choice implementation, but display_statusline function can be a same function as other menus. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
cd160b27 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor eficonfig_process_common function Current change boot order implementation does not call eficonfig_process_common() and call own menu functions for display_statusline, item_data_print and item_choice. Change boot order functionality should call eficonfig_process_common() to improve maintenanceability. This commit is a preparation to remove the change boot order specific implementation. The menu functions (display_statusline, item_data_print and item_choice) are added as argument of eficonfig_process_common(). The menu description string displayed at the bottom of the menu is also added as argument. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
32bab0ea |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Make use of CLI character processing Avoid duplicating some of the escape-sequence processing here and use the CLI function instead. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
d0ca98db |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Update bootmenu_loop() to return the code Use the return value to save having to pass around a pointer. This also resolves any ambiguity about what *key contains when the function is called. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
2da4a15e |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Rename KEY_... to BKEY_... This enum values conflict with linux/input.h so rename them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
64550274 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: avoid SetVariable between GetNextVariableName calls The current code calls efi_set_variable_int() to delete the invalid boot option between calls to efi_get_next_variable_name_int(), it may produce unpredictable results. This commit moves removal of the invalid boot option outside of the efi_get_next_variable_name_int() calls. EFI_NOT_FOUND returned from efi_get_next_variable_name_int() indicates we retrieved all EFI variables, it should be treated as EFI_SUCEESS. To address the checkpatch warning of too many leading tabs, combine two if statement into one. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
ce327084 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: carve out efi_get_next_variable_name_int calls To retrieve the EFI variable name by efi_get_next_variable_name_int(), the sequence of alloc -> efi_get_next_variable_name_int -> realloc -> efi_get_next_variable_name_int is required. In current code, this sequence repeatedly appears in the several functions. It should be curved out a common function. This commit also fixes the missing free() of var_name16 in eficonfig_delete_invalid_boot_option(). Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
140a8959 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use efi_get_next_variable_name_int() eficonfig command reads all possible UEFI load options from 0x0000 to 0xFFFF to construct the menu. This takes too much time in some environment. This commit uses efi_get_next_variable_name_int() to read all existing UEFI load options to significantlly reduce the count of efi_get_var() call. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
78b1ccc4 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use u16_strsize() to get u16 string buffer size Use u16_strsize() to simplify the u16 string buffer size calculation. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c67d3c9e |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix going one directory up issue The directory name in eficonfig menu entry contains the '\' separator. strcmp() argument ".." is wrong and one directory up handling does not work correctly. strcmp() argument must include '\' separator. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c3b5af63 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add UEFI Secure Boot Key enrollment interface This commit adds the menu-driven UEFI Secure Boot Key enrollment interface. User can enroll PK, KEK, db and dbx by selecting file. Only the signed EFI Signature List(s) with an authenticated header, typically '.auth' file, is accepted. To clear the PK, KEK, db and dbx, user needs to enroll the null key signed by PK or KEK. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
21faf4ef |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use protocol interface for file selection EFI_SIMPLE_FILE_SYSTEM_PROTOCOL is not always provided by U-Boot. Use protocol interface functions instead of U-Boot internal functions. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d6566113 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose eficonfig_create_device_path() Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use eficonfig_create_device_path() to construct the full device path from device path of the volume and file path, so move it out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d571f9b2 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation All the eficonfig menus other than "Change Boot Order" use 'eficonfig_entry' structure for each menu entry. This commit refactors change boot order implementation to use 'eficonfig_entry' structure same as other menus to have consistent menu handling. This commit also simplifies the data->active handling when KEY_SPACE is pressed, and sizeof() parameter. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
8961e93e |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose append entry function Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use append_entry() and append_quit_entry() to construct the menu, so move them out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
a84040ab |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor file selection handling eficonfig_select_file_handler() is commonly used to select the file. eficonfig_display_select_file_option() adds an additional menu to clear the selected file. eficonfig_display_select_file_option() is not always necessary for the file selection process, so it must be outside of eficonfig_select_file_handler(). This commit also renames the following functions to avoid confusion. eficonfig_select_file_handler() -> eficonfig_process_select_file() eficonfig_select_file() -> eficonfig_show_file_selection() eficonfig_display_select_file_option() -> eficonfig_process_show_file_option() Finally, test_eficonfig.py need to be updated to get aligned with the above modification. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
1167e88a |
|
14-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix missing variable initialization The 'ret' variable must be initialized before use in eficonfig_delete_invalid_boot_option(). Fixes: c416f1c0bc ("bootmenu: add removable media entries") Addresses-Coverity: 376207 ("Uninitialized variables") Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
3d595ac5 |
|
09-Nov-2022 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: remove superfluous if in eficonfig_edit_boot_option Goto for an immediately succeeding label is superfluous. Fixes: 87d791423ac6 ("eficonfig: menu-driven addition of UEFI boot option") Addresses-Coverity: 376202 ("Identical code for different branches") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
2c0b0c31 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_SECURE_BOOT This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_SECURE_BOOT defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
83f3d121 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_MM_COMM_TEE This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_MM_COMM_TEE defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
88df3634 |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: CTRL+S to save the boot order 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>
|
#
45f5319f |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
menu: remove CTRL+C to quit On the sandbox called without "--terminal raw" CTRL+C leaves U-Boot, "ESC/CTRL+C to quit" is misleading. Let's remove CTRL+C to quit key handling from bootmenu and eficonfig menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
|
#
8dbd0a0f |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add vertical scroll support The current eficonfig menu does not support vertical scroll, so it can not display the menu entries greater than the console row size. This commit add the vertial scroll support. The console size is retrieved by SIMPLE_TEXT_OUTPUT_PROTOCOL.QueryMode() service, then calculates the row size for menu entry by subtracting menu header and description row size from the console row size. "start" and "end" are added in the efimenu structure. "start" keeps the menu entry index at the top, "end" keeps the bottom menu entry index. item_data_print() menu function only draws the menu entry between "start" and "end". This commit also fixes the issue that "Save" and "Quit" entries can be moved by BKEY_PLUS in change boot order menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
0d590852 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation This commit removes the change boot order specific menu implementation. The change boot order implementation calls eficonfig_process_common() same as other menus. The change boot order menu requires own item_data_print and item_choice implementation, but display_statusline function can be a same function as other menus. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
cd160b27 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor eficonfig_process_common function Current change boot order implementation does not call eficonfig_process_common() and call own menu functions for display_statusline, item_data_print and item_choice. Change boot order functionality should call eficonfig_process_common() to improve maintenanceability. This commit is a preparation to remove the change boot order specific implementation. The menu functions (display_statusline, item_data_print and item_choice) are added as argument of eficonfig_process_common(). The menu description string displayed at the bottom of the menu is also added as argument. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
32bab0ea |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Make use of CLI character processing Avoid duplicating some of the escape-sequence processing here and use the CLI function instead. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
d0ca98db |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Update bootmenu_loop() to return the code Use the return value to save having to pass around a pointer. This also resolves any ambiguity about what *key contains when the function is called. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
2da4a15e |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Rename KEY_... to BKEY_... This enum values conflict with linux/input.h so rename them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
64550274 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: avoid SetVariable between GetNextVariableName calls The current code calls efi_set_variable_int() to delete the invalid boot option between calls to efi_get_next_variable_name_int(), it may produce unpredictable results. This commit moves removal of the invalid boot option outside of the efi_get_next_variable_name_int() calls. EFI_NOT_FOUND returned from efi_get_next_variable_name_int() indicates we retrieved all EFI variables, it should be treated as EFI_SUCEESS. To address the checkpatch warning of too many leading tabs, combine two if statement into one. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
ce327084 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: carve out efi_get_next_variable_name_int calls To retrieve the EFI variable name by efi_get_next_variable_name_int(), the sequence of alloc -> efi_get_next_variable_name_int -> realloc -> efi_get_next_variable_name_int is required. In current code, this sequence repeatedly appears in the several functions. It should be curved out a common function. This commit also fixes the missing free() of var_name16 in eficonfig_delete_invalid_boot_option(). Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
140a8959 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use efi_get_next_variable_name_int() eficonfig command reads all possible UEFI load options from 0x0000 to 0xFFFF to construct the menu. This takes too much time in some environment. This commit uses efi_get_next_variable_name_int() to read all existing UEFI load options to significantlly reduce the count of efi_get_var() call. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
78b1ccc4 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use u16_strsize() to get u16 string buffer size Use u16_strsize() to simplify the u16 string buffer size calculation. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c67d3c9e |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix going one directory up issue The directory name in eficonfig menu entry contains the '\' separator. strcmp() argument ".." is wrong and one directory up handling does not work correctly. strcmp() argument must include '\' separator. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c3b5af63 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add UEFI Secure Boot Key enrollment interface This commit adds the menu-driven UEFI Secure Boot Key enrollment interface. User can enroll PK, KEK, db and dbx by selecting file. Only the signed EFI Signature List(s) with an authenticated header, typically '.auth' file, is accepted. To clear the PK, KEK, db and dbx, user needs to enroll the null key signed by PK or KEK. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
21faf4ef |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use protocol interface for file selection EFI_SIMPLE_FILE_SYSTEM_PROTOCOL is not always provided by U-Boot. Use protocol interface functions instead of U-Boot internal functions. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d6566113 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose eficonfig_create_device_path() Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use eficonfig_create_device_path() to construct the full device path from device path of the volume and file path, so move it out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d571f9b2 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation All the eficonfig menus other than "Change Boot Order" use 'eficonfig_entry' structure for each menu entry. This commit refactors change boot order implementation to use 'eficonfig_entry' structure same as other menus to have consistent menu handling. This commit also simplifies the data->active handling when KEY_SPACE is pressed, and sizeof() parameter. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
8961e93e |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose append entry function Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use append_entry() and append_quit_entry() to construct the menu, so move them out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
a84040ab |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor file selection handling eficonfig_select_file_handler() is commonly used to select the file. eficonfig_display_select_file_option() adds an additional menu to clear the selected file. eficonfig_display_select_file_option() is not always necessary for the file selection process, so it must be outside of eficonfig_select_file_handler(). This commit also renames the following functions to avoid confusion. eficonfig_select_file_handler() -> eficonfig_process_select_file() eficonfig_select_file() -> eficonfig_show_file_selection() eficonfig_display_select_file_option() -> eficonfig_process_show_file_option() Finally, test_eficonfig.py need to be updated to get aligned with the above modification. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
1167e88a |
|
14-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix missing variable initialization The 'ret' variable must be initialized before use in eficonfig_delete_invalid_boot_option(). Fixes: c416f1c0bc ("bootmenu: add removable media entries") Addresses-Coverity: 376207 ("Uninitialized variables") Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
3d595ac5 |
|
09-Nov-2022 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: remove superfluous if in eficonfig_edit_boot_option Goto for an immediately succeeding label is superfluous. Fixes: 87d791423ac6 ("eficonfig: menu-driven addition of UEFI boot option") Addresses-Coverity: 376202 ("Identical code for different branches") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
2c0b0c31 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_SECURE_BOOT This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_SECURE_BOOT defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
83f3d121 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_MM_COMM_TEE This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_MM_COMM_TEE defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
88df3634 |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: CTRL+S to save the boot order 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>
|
#
45f5319f |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
menu: remove CTRL+C to quit On the sandbox called without "--terminal raw" CTRL+C leaves U-Boot, "ESC/CTRL+C to quit" is misleading. Let's remove CTRL+C to quit key handling from bootmenu and eficonfig menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
|
#
8dbd0a0f |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add vertical scroll support The current eficonfig menu does not support vertical scroll, so it can not display the menu entries greater than the console row size. This commit add the vertial scroll support. The console size is retrieved by SIMPLE_TEXT_OUTPUT_PROTOCOL.QueryMode() service, then calculates the row size for menu entry by subtracting menu header and description row size from the console row size. "start" and "end" are added in the efimenu structure. "start" keeps the menu entry index at the top, "end" keeps the bottom menu entry index. item_data_print() menu function only draws the menu entry between "start" and "end". This commit also fixes the issue that "Save" and "Quit" entries can be moved by BKEY_PLUS in change boot order menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
0d590852 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation This commit removes the change boot order specific menu implementation. The change boot order implementation calls eficonfig_process_common() same as other menus. The change boot order menu requires own item_data_print and item_choice implementation, but display_statusline function can be a same function as other menus. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
cd160b27 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor eficonfig_process_common function Current change boot order implementation does not call eficonfig_process_common() and call own menu functions for display_statusline, item_data_print and item_choice. Change boot order functionality should call eficonfig_process_common() to improve maintenanceability. This commit is a preparation to remove the change boot order specific implementation. The menu functions (display_statusline, item_data_print and item_choice) are added as argument of eficonfig_process_common(). The menu description string displayed at the bottom of the menu is also added as argument. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
32bab0ea |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Make use of CLI character processing Avoid duplicating some of the escape-sequence processing here and use the CLI function instead. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
d0ca98db |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Update bootmenu_loop() to return the code Use the return value to save having to pass around a pointer. This also resolves any ambiguity about what *key contains when the function is called. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
2da4a15e |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Rename KEY_... to BKEY_... This enum values conflict with linux/input.h so rename them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
64550274 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: avoid SetVariable between GetNextVariableName calls The current code calls efi_set_variable_int() to delete the invalid boot option between calls to efi_get_next_variable_name_int(), it may produce unpredictable results. This commit moves removal of the invalid boot option outside of the efi_get_next_variable_name_int() calls. EFI_NOT_FOUND returned from efi_get_next_variable_name_int() indicates we retrieved all EFI variables, it should be treated as EFI_SUCEESS. To address the checkpatch warning of too many leading tabs, combine two if statement into one. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
ce327084 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: carve out efi_get_next_variable_name_int calls To retrieve the EFI variable name by efi_get_next_variable_name_int(), the sequence of alloc -> efi_get_next_variable_name_int -> realloc -> efi_get_next_variable_name_int is required. In current code, this sequence repeatedly appears in the several functions. It should be curved out a common function. This commit also fixes the missing free() of var_name16 in eficonfig_delete_invalid_boot_option(). Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
140a8959 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use efi_get_next_variable_name_int() eficonfig command reads all possible UEFI load options from 0x0000 to 0xFFFF to construct the menu. This takes too much time in some environment. This commit uses efi_get_next_variable_name_int() to read all existing UEFI load options to significantlly reduce the count of efi_get_var() call. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
78b1ccc4 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use u16_strsize() to get u16 string buffer size Use u16_strsize() to simplify the u16 string buffer size calculation. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c67d3c9e |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix going one directory up issue The directory name in eficonfig menu entry contains the '\' separator. strcmp() argument ".." is wrong and one directory up handling does not work correctly. strcmp() argument must include '\' separator. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c3b5af63 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add UEFI Secure Boot Key enrollment interface This commit adds the menu-driven UEFI Secure Boot Key enrollment interface. User can enroll PK, KEK, db and dbx by selecting file. Only the signed EFI Signature List(s) with an authenticated header, typically '.auth' file, is accepted. To clear the PK, KEK, db and dbx, user needs to enroll the null key signed by PK or KEK. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
21faf4ef |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use protocol interface for file selection EFI_SIMPLE_FILE_SYSTEM_PROTOCOL is not always provided by U-Boot. Use protocol interface functions instead of U-Boot internal functions. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d6566113 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose eficonfig_create_device_path() Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use eficonfig_create_device_path() to construct the full device path from device path of the volume and file path, so move it out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d571f9b2 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation All the eficonfig menus other than "Change Boot Order" use 'eficonfig_entry' structure for each menu entry. This commit refactors change boot order implementation to use 'eficonfig_entry' structure same as other menus to have consistent menu handling. This commit also simplifies the data->active handling when KEY_SPACE is pressed, and sizeof() parameter. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
8961e93e |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose append entry function Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use append_entry() and append_quit_entry() to construct the menu, so move them out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
a84040ab |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor file selection handling eficonfig_select_file_handler() is commonly used to select the file. eficonfig_display_select_file_option() adds an additional menu to clear the selected file. eficonfig_display_select_file_option() is not always necessary for the file selection process, so it must be outside of eficonfig_select_file_handler(). This commit also renames the following functions to avoid confusion. eficonfig_select_file_handler() -> eficonfig_process_select_file() eficonfig_select_file() -> eficonfig_show_file_selection() eficonfig_display_select_file_option() -> eficonfig_process_show_file_option() Finally, test_eficonfig.py need to be updated to get aligned with the above modification. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
1167e88a |
|
14-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix missing variable initialization The 'ret' variable must be initialized before use in eficonfig_delete_invalid_boot_option(). Fixes: c416f1c0bc ("bootmenu: add removable media entries") Addresses-Coverity: 376207 ("Uninitialized variables") Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
3d595ac5 |
|
09-Nov-2022 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: remove superfluous if in eficonfig_edit_boot_option Goto for an immediately succeeding label is superfluous. Fixes: 87d791423ac6 ("eficonfig: menu-driven addition of UEFI boot option") Addresses-Coverity: 376202 ("Identical code for different branches") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
2c0b0c31 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_SECURE_BOOT This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_SECURE_BOOT defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
83f3d121 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_MM_COMM_TEE This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_MM_COMM_TEE defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
88df3634 |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: CTRL+S to save the boot order 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>
|
#
45f5319f |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
menu: remove CTRL+C to quit On the sandbox called without "--terminal raw" CTRL+C leaves U-Boot, "ESC/CTRL+C to quit" is misleading. Let's remove CTRL+C to quit key handling from bootmenu and eficonfig menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
|
#
8dbd0a0f |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add vertical scroll support The current eficonfig menu does not support vertical scroll, so it can not display the menu entries greater than the console row size. This commit add the vertial scroll support. The console size is retrieved by SIMPLE_TEXT_OUTPUT_PROTOCOL.QueryMode() service, then calculates the row size for menu entry by subtracting menu header and description row size from the console row size. "start" and "end" are added in the efimenu structure. "start" keeps the menu entry index at the top, "end" keeps the bottom menu entry index. item_data_print() menu function only draws the menu entry between "start" and "end". This commit also fixes the issue that "Save" and "Quit" entries can be moved by BKEY_PLUS in change boot order menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
0d590852 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation This commit removes the change boot order specific menu implementation. The change boot order implementation calls eficonfig_process_common() same as other menus. The change boot order menu requires own item_data_print and item_choice implementation, but display_statusline function can be a same function as other menus. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
cd160b27 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor eficonfig_process_common function Current change boot order implementation does not call eficonfig_process_common() and call own menu functions for display_statusline, item_data_print and item_choice. Change boot order functionality should call eficonfig_process_common() to improve maintenanceability. This commit is a preparation to remove the change boot order specific implementation. The menu functions (display_statusline, item_data_print and item_choice) are added as argument of eficonfig_process_common(). The menu description string displayed at the bottom of the menu is also added as argument. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
32bab0ea |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Make use of CLI character processing Avoid duplicating some of the escape-sequence processing here and use the CLI function instead. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
d0ca98db |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Update bootmenu_loop() to return the code Use the return value to save having to pass around a pointer. This also resolves any ambiguity about what *key contains when the function is called. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
2da4a15e |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Rename KEY_... to BKEY_... This enum values conflict with linux/input.h so rename them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
64550274 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: avoid SetVariable between GetNextVariableName calls The current code calls efi_set_variable_int() to delete the invalid boot option between calls to efi_get_next_variable_name_int(), it may produce unpredictable results. This commit moves removal of the invalid boot option outside of the efi_get_next_variable_name_int() calls. EFI_NOT_FOUND returned from efi_get_next_variable_name_int() indicates we retrieved all EFI variables, it should be treated as EFI_SUCEESS. To address the checkpatch warning of too many leading tabs, combine two if statement into one. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
ce327084 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: carve out efi_get_next_variable_name_int calls To retrieve the EFI variable name by efi_get_next_variable_name_int(), the sequence of alloc -> efi_get_next_variable_name_int -> realloc -> efi_get_next_variable_name_int is required. In current code, this sequence repeatedly appears in the several functions. It should be curved out a common function. This commit also fixes the missing free() of var_name16 in eficonfig_delete_invalid_boot_option(). Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
140a8959 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use efi_get_next_variable_name_int() eficonfig command reads all possible UEFI load options from 0x0000 to 0xFFFF to construct the menu. This takes too much time in some environment. This commit uses efi_get_next_variable_name_int() to read all existing UEFI load options to significantlly reduce the count of efi_get_var() call. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
78b1ccc4 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use u16_strsize() to get u16 string buffer size Use u16_strsize() to simplify the u16 string buffer size calculation. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c67d3c9e |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix going one directory up issue The directory name in eficonfig menu entry contains the '\' separator. strcmp() argument ".." is wrong and one directory up handling does not work correctly. strcmp() argument must include '\' separator. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c3b5af63 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add UEFI Secure Boot Key enrollment interface This commit adds the menu-driven UEFI Secure Boot Key enrollment interface. User can enroll PK, KEK, db and dbx by selecting file. Only the signed EFI Signature List(s) with an authenticated header, typically '.auth' file, is accepted. To clear the PK, KEK, db and dbx, user needs to enroll the null key signed by PK or KEK. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
21faf4ef |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use protocol interface for file selection EFI_SIMPLE_FILE_SYSTEM_PROTOCOL is not always provided by U-Boot. Use protocol interface functions instead of U-Boot internal functions. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d6566113 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose eficonfig_create_device_path() Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use eficonfig_create_device_path() to construct the full device path from device path of the volume and file path, so move it out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d571f9b2 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation All the eficonfig menus other than "Change Boot Order" use 'eficonfig_entry' structure for each menu entry. This commit refactors change boot order implementation to use 'eficonfig_entry' structure same as other menus to have consistent menu handling. This commit also simplifies the data->active handling when KEY_SPACE is pressed, and sizeof() parameter. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
8961e93e |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose append entry function Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use append_entry() and append_quit_entry() to construct the menu, so move them out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
a84040ab |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor file selection handling eficonfig_select_file_handler() is commonly used to select the file. eficonfig_display_select_file_option() adds an additional menu to clear the selected file. eficonfig_display_select_file_option() is not always necessary for the file selection process, so it must be outside of eficonfig_select_file_handler(). This commit also renames the following functions to avoid confusion. eficonfig_select_file_handler() -> eficonfig_process_select_file() eficonfig_select_file() -> eficonfig_show_file_selection() eficonfig_display_select_file_option() -> eficonfig_process_show_file_option() Finally, test_eficonfig.py need to be updated to get aligned with the above modification. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
1167e88a |
|
14-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix missing variable initialization The 'ret' variable must be initialized before use in eficonfig_delete_invalid_boot_option(). Fixes: c416f1c0bc ("bootmenu: add removable media entries") Addresses-Coverity: 376207 ("Uninitialized variables") Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
3d595ac5 |
|
09-Nov-2022 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: remove superfluous if in eficonfig_edit_boot_option Goto for an immediately succeeding label is superfluous. Fixes: 87d791423ac6 ("eficonfig: menu-driven addition of UEFI boot option") Addresses-Coverity: 376202 ("Identical code for different branches") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
2c0b0c31 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_SECURE_BOOT This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_SECURE_BOOT defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
83f3d121 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_MM_COMM_TEE This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_MM_COMM_TEE defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
88df3634 |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: CTRL+S to save the boot order 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>
|
#
45f5319f |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
menu: remove CTRL+C to quit On the sandbox called without "--terminal raw" CTRL+C leaves U-Boot, "ESC/CTRL+C to quit" is misleading. Let's remove CTRL+C to quit key handling from bootmenu and eficonfig menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
|
#
8dbd0a0f |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add vertical scroll support The current eficonfig menu does not support vertical scroll, so it can not display the menu entries greater than the console row size. This commit add the vertial scroll support. The console size is retrieved by SIMPLE_TEXT_OUTPUT_PROTOCOL.QueryMode() service, then calculates the row size for menu entry by subtracting menu header and description row size from the console row size. "start" and "end" are added in the efimenu structure. "start" keeps the menu entry index at the top, "end" keeps the bottom menu entry index. item_data_print() menu function only draws the menu entry between "start" and "end". This commit also fixes the issue that "Save" and "Quit" entries can be moved by BKEY_PLUS in change boot order menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
0d590852 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation This commit removes the change boot order specific menu implementation. The change boot order implementation calls eficonfig_process_common() same as other menus. The change boot order menu requires own item_data_print and item_choice implementation, but display_statusline function can be a same function as other menus. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
cd160b27 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor eficonfig_process_common function Current change boot order implementation does not call eficonfig_process_common() and call own menu functions for display_statusline, item_data_print and item_choice. Change boot order functionality should call eficonfig_process_common() to improve maintenanceability. This commit is a preparation to remove the change boot order specific implementation. The menu functions (display_statusline, item_data_print and item_choice) are added as argument of eficonfig_process_common(). The menu description string displayed at the bottom of the menu is also added as argument. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
32bab0ea |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Make use of CLI character processing Avoid duplicating some of the escape-sequence processing here and use the CLI function instead. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
d0ca98db |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Update bootmenu_loop() to return the code Use the return value to save having to pass around a pointer. This also resolves any ambiguity about what *key contains when the function is called. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
2da4a15e |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Rename KEY_... to BKEY_... This enum values conflict with linux/input.h so rename them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
64550274 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: avoid SetVariable between GetNextVariableName calls The current code calls efi_set_variable_int() to delete the invalid boot option between calls to efi_get_next_variable_name_int(), it may produce unpredictable results. This commit moves removal of the invalid boot option outside of the efi_get_next_variable_name_int() calls. EFI_NOT_FOUND returned from efi_get_next_variable_name_int() indicates we retrieved all EFI variables, it should be treated as EFI_SUCEESS. To address the checkpatch warning of too many leading tabs, combine two if statement into one. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
ce327084 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: carve out efi_get_next_variable_name_int calls To retrieve the EFI variable name by efi_get_next_variable_name_int(), the sequence of alloc -> efi_get_next_variable_name_int -> realloc -> efi_get_next_variable_name_int is required. In current code, this sequence repeatedly appears in the several functions. It should be curved out a common function. This commit also fixes the missing free() of var_name16 in eficonfig_delete_invalid_boot_option(). Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
140a8959 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use efi_get_next_variable_name_int() eficonfig command reads all possible UEFI load options from 0x0000 to 0xFFFF to construct the menu. This takes too much time in some environment. This commit uses efi_get_next_variable_name_int() to read all existing UEFI load options to significantlly reduce the count of efi_get_var() call. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
78b1ccc4 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use u16_strsize() to get u16 string buffer size Use u16_strsize() to simplify the u16 string buffer size calculation. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c67d3c9e |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix going one directory up issue The directory name in eficonfig menu entry contains the '\' separator. strcmp() argument ".." is wrong and one directory up handling does not work correctly. strcmp() argument must include '\' separator. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c3b5af63 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add UEFI Secure Boot Key enrollment interface This commit adds the menu-driven UEFI Secure Boot Key enrollment interface. User can enroll PK, KEK, db and dbx by selecting file. Only the signed EFI Signature List(s) with an authenticated header, typically '.auth' file, is accepted. To clear the PK, KEK, db and dbx, user needs to enroll the null key signed by PK or KEK. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
21faf4ef |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use protocol interface for file selection EFI_SIMPLE_FILE_SYSTEM_PROTOCOL is not always provided by U-Boot. Use protocol interface functions instead of U-Boot internal functions. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d6566113 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose eficonfig_create_device_path() Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use eficonfig_create_device_path() to construct the full device path from device path of the volume and file path, so move it out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d571f9b2 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation All the eficonfig menus other than "Change Boot Order" use 'eficonfig_entry' structure for each menu entry. This commit refactors change boot order implementation to use 'eficonfig_entry' structure same as other menus to have consistent menu handling. This commit also simplifies the data->active handling when KEY_SPACE is pressed, and sizeof() parameter. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
8961e93e |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose append entry function Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use append_entry() and append_quit_entry() to construct the menu, so move them out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
a84040ab |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor file selection handling eficonfig_select_file_handler() is commonly used to select the file. eficonfig_display_select_file_option() adds an additional menu to clear the selected file. eficonfig_display_select_file_option() is not always necessary for the file selection process, so it must be outside of eficonfig_select_file_handler(). This commit also renames the following functions to avoid confusion. eficonfig_select_file_handler() -> eficonfig_process_select_file() eficonfig_select_file() -> eficonfig_show_file_selection() eficonfig_display_select_file_option() -> eficonfig_process_show_file_option() Finally, test_eficonfig.py need to be updated to get aligned with the above modification. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
1167e88a |
|
14-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix missing variable initialization The 'ret' variable must be initialized before use in eficonfig_delete_invalid_boot_option(). Fixes: c416f1c0bc ("bootmenu: add removable media entries") Addresses-Coverity: 376207 ("Uninitialized variables") Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
3d595ac5 |
|
09-Nov-2022 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: remove superfluous if in eficonfig_edit_boot_option Goto for an immediately succeeding label is superfluous. Fixes: 87d791423ac6 ("eficonfig: menu-driven addition of UEFI boot option") Addresses-Coverity: 376202 ("Identical code for different branches") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
2c0b0c31 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_SECURE_BOOT This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_SECURE_BOOT defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
83f3d121 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_MM_COMM_TEE This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_MM_COMM_TEE defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
88df3634 |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: CTRL+S to save the boot order 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>
|
#
45f5319f |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
menu: remove CTRL+C to quit On the sandbox called without "--terminal raw" CTRL+C leaves U-Boot, "ESC/CTRL+C to quit" is misleading. Let's remove CTRL+C to quit key handling from bootmenu and eficonfig menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
|
#
8dbd0a0f |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add vertical scroll support The current eficonfig menu does not support vertical scroll, so it can not display the menu entries greater than the console row size. This commit add the vertial scroll support. The console size is retrieved by SIMPLE_TEXT_OUTPUT_PROTOCOL.QueryMode() service, then calculates the row size for menu entry by subtracting menu header and description row size from the console row size. "start" and "end" are added in the efimenu structure. "start" keeps the menu entry index at the top, "end" keeps the bottom menu entry index. item_data_print() menu function only draws the menu entry between "start" and "end". This commit also fixes the issue that "Save" and "Quit" entries can be moved by BKEY_PLUS in change boot order menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
0d590852 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation This commit removes the change boot order specific menu implementation. The change boot order implementation calls eficonfig_process_common() same as other menus. The change boot order menu requires own item_data_print and item_choice implementation, but display_statusline function can be a same function as other menus. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
cd160b27 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor eficonfig_process_common function Current change boot order implementation does not call eficonfig_process_common() and call own menu functions for display_statusline, item_data_print and item_choice. Change boot order functionality should call eficonfig_process_common() to improve maintenanceability. This commit is a preparation to remove the change boot order specific implementation. The menu functions (display_statusline, item_data_print and item_choice) are added as argument of eficonfig_process_common(). The menu description string displayed at the bottom of the menu is also added as argument. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
32bab0ea |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Make use of CLI character processing Avoid duplicating some of the escape-sequence processing here and use the CLI function instead. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
d0ca98db |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Update bootmenu_loop() to return the code Use the return value to save having to pass around a pointer. This also resolves any ambiguity about what *key contains when the function is called. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
2da4a15e |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Rename KEY_... to BKEY_... This enum values conflict with linux/input.h so rename them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
64550274 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: avoid SetVariable between GetNextVariableName calls The current code calls efi_set_variable_int() to delete the invalid boot option between calls to efi_get_next_variable_name_int(), it may produce unpredictable results. This commit moves removal of the invalid boot option outside of the efi_get_next_variable_name_int() calls. EFI_NOT_FOUND returned from efi_get_next_variable_name_int() indicates we retrieved all EFI variables, it should be treated as EFI_SUCEESS. To address the checkpatch warning of too many leading tabs, combine two if statement into one. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
ce327084 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: carve out efi_get_next_variable_name_int calls To retrieve the EFI variable name by efi_get_next_variable_name_int(), the sequence of alloc -> efi_get_next_variable_name_int -> realloc -> efi_get_next_variable_name_int is required. In current code, this sequence repeatedly appears in the several functions. It should be curved out a common function. This commit also fixes the missing free() of var_name16 in eficonfig_delete_invalid_boot_option(). Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
140a8959 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use efi_get_next_variable_name_int() eficonfig command reads all possible UEFI load options from 0x0000 to 0xFFFF to construct the menu. This takes too much time in some environment. This commit uses efi_get_next_variable_name_int() to read all existing UEFI load options to significantlly reduce the count of efi_get_var() call. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
78b1ccc4 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use u16_strsize() to get u16 string buffer size Use u16_strsize() to simplify the u16 string buffer size calculation. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c67d3c9e |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix going one directory up issue The directory name in eficonfig menu entry contains the '\' separator. strcmp() argument ".." is wrong and one directory up handling does not work correctly. strcmp() argument must include '\' separator. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c3b5af63 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add UEFI Secure Boot Key enrollment interface This commit adds the menu-driven UEFI Secure Boot Key enrollment interface. User can enroll PK, KEK, db and dbx by selecting file. Only the signed EFI Signature List(s) with an authenticated header, typically '.auth' file, is accepted. To clear the PK, KEK, db and dbx, user needs to enroll the null key signed by PK or KEK. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
21faf4ef |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use protocol interface for file selection EFI_SIMPLE_FILE_SYSTEM_PROTOCOL is not always provided by U-Boot. Use protocol interface functions instead of U-Boot internal functions. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d6566113 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose eficonfig_create_device_path() Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use eficonfig_create_device_path() to construct the full device path from device path of the volume and file path, so move it out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d571f9b2 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation All the eficonfig menus other than "Change Boot Order" use 'eficonfig_entry' structure for each menu entry. This commit refactors change boot order implementation to use 'eficonfig_entry' structure same as other menus to have consistent menu handling. This commit also simplifies the data->active handling when KEY_SPACE is pressed, and sizeof() parameter. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
8961e93e |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose append entry function Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use append_entry() and append_quit_entry() to construct the menu, so move them out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
a84040ab |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor file selection handling eficonfig_select_file_handler() is commonly used to select the file. eficonfig_display_select_file_option() adds an additional menu to clear the selected file. eficonfig_display_select_file_option() is not always necessary for the file selection process, so it must be outside of eficonfig_select_file_handler(). This commit also renames the following functions to avoid confusion. eficonfig_select_file_handler() -> eficonfig_process_select_file() eficonfig_select_file() -> eficonfig_show_file_selection() eficonfig_display_select_file_option() -> eficonfig_process_show_file_option() Finally, test_eficonfig.py need to be updated to get aligned with the above modification. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
1167e88a |
|
14-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix missing variable initialization The 'ret' variable must be initialized before use in eficonfig_delete_invalid_boot_option(). Fixes: c416f1c0bc ("bootmenu: add removable media entries") Addresses-Coverity: 376207 ("Uninitialized variables") Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
3d595ac5 |
|
09-Nov-2022 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: remove superfluous if in eficonfig_edit_boot_option Goto for an immediately succeeding label is superfluous. Fixes: 87d791423ac6 ("eficonfig: menu-driven addition of UEFI boot option") Addresses-Coverity: 376202 ("Identical code for different branches") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
2c0b0c31 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_SECURE_BOOT This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_SECURE_BOOT defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
83f3d121 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_MM_COMM_TEE This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_MM_COMM_TEE defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
88df3634 |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: CTRL+S to save the boot order 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>
|
#
45f5319f |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
menu: remove CTRL+C to quit On the sandbox called without "--terminal raw" CTRL+C leaves U-Boot, "ESC/CTRL+C to quit" is misleading. Let's remove CTRL+C to quit key handling from bootmenu and eficonfig menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
|
#
8dbd0a0f |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add vertical scroll support The current eficonfig menu does not support vertical scroll, so it can not display the menu entries greater than the console row size. This commit add the vertial scroll support. The console size is retrieved by SIMPLE_TEXT_OUTPUT_PROTOCOL.QueryMode() service, then calculates the row size for menu entry by subtracting menu header and description row size from the console row size. "start" and "end" are added in the efimenu structure. "start" keeps the menu entry index at the top, "end" keeps the bottom menu entry index. item_data_print() menu function only draws the menu entry between "start" and "end". This commit also fixes the issue that "Save" and "Quit" entries can be moved by BKEY_PLUS in change boot order menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
0d590852 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation This commit removes the change boot order specific menu implementation. The change boot order implementation calls eficonfig_process_common() same as other menus. The change boot order menu requires own item_data_print and item_choice implementation, but display_statusline function can be a same function as other menus. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
cd160b27 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor eficonfig_process_common function Current change boot order implementation does not call eficonfig_process_common() and call own menu functions for display_statusline, item_data_print and item_choice. Change boot order functionality should call eficonfig_process_common() to improve maintenanceability. This commit is a preparation to remove the change boot order specific implementation. The menu functions (display_statusline, item_data_print and item_choice) are added as argument of eficonfig_process_common(). The menu description string displayed at the bottom of the menu is also added as argument. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
32bab0ea |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Make use of CLI character processing Avoid duplicating some of the escape-sequence processing here and use the CLI function instead. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
d0ca98db |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Update bootmenu_loop() to return the code Use the return value to save having to pass around a pointer. This also resolves any ambiguity about what *key contains when the function is called. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
2da4a15e |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Rename KEY_... to BKEY_... This enum values conflict with linux/input.h so rename them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
64550274 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: avoid SetVariable between GetNextVariableName calls The current code calls efi_set_variable_int() to delete the invalid boot option between calls to efi_get_next_variable_name_int(), it may produce unpredictable results. This commit moves removal of the invalid boot option outside of the efi_get_next_variable_name_int() calls. EFI_NOT_FOUND returned from efi_get_next_variable_name_int() indicates we retrieved all EFI variables, it should be treated as EFI_SUCEESS. To address the checkpatch warning of too many leading tabs, combine two if statement into one. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
ce327084 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: carve out efi_get_next_variable_name_int calls To retrieve the EFI variable name by efi_get_next_variable_name_int(), the sequence of alloc -> efi_get_next_variable_name_int -> realloc -> efi_get_next_variable_name_int is required. In current code, this sequence repeatedly appears in the several functions. It should be curved out a common function. This commit also fixes the missing free() of var_name16 in eficonfig_delete_invalid_boot_option(). Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
140a8959 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use efi_get_next_variable_name_int() eficonfig command reads all possible UEFI load options from 0x0000 to 0xFFFF to construct the menu. This takes too much time in some environment. This commit uses efi_get_next_variable_name_int() to read all existing UEFI load options to significantlly reduce the count of efi_get_var() call. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
78b1ccc4 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use u16_strsize() to get u16 string buffer size Use u16_strsize() to simplify the u16 string buffer size calculation. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c67d3c9e |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix going one directory up issue The directory name in eficonfig menu entry contains the '\' separator. strcmp() argument ".." is wrong and one directory up handling does not work correctly. strcmp() argument must include '\' separator. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c3b5af63 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add UEFI Secure Boot Key enrollment interface This commit adds the menu-driven UEFI Secure Boot Key enrollment interface. User can enroll PK, KEK, db and dbx by selecting file. Only the signed EFI Signature List(s) with an authenticated header, typically '.auth' file, is accepted. To clear the PK, KEK, db and dbx, user needs to enroll the null key signed by PK or KEK. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
21faf4ef |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use protocol interface for file selection EFI_SIMPLE_FILE_SYSTEM_PROTOCOL is not always provided by U-Boot. Use protocol interface functions instead of U-Boot internal functions. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d6566113 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose eficonfig_create_device_path() Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use eficonfig_create_device_path() to construct the full device path from device path of the volume and file path, so move it out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d571f9b2 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation All the eficonfig menus other than "Change Boot Order" use 'eficonfig_entry' structure for each menu entry. This commit refactors change boot order implementation to use 'eficonfig_entry' structure same as other menus to have consistent menu handling. This commit also simplifies the data->active handling when KEY_SPACE is pressed, and sizeof() parameter. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
8961e93e |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose append entry function Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use append_entry() and append_quit_entry() to construct the menu, so move them out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
a84040ab |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor file selection handling eficonfig_select_file_handler() is commonly used to select the file. eficonfig_display_select_file_option() adds an additional menu to clear the selected file. eficonfig_display_select_file_option() is not always necessary for the file selection process, so it must be outside of eficonfig_select_file_handler(). This commit also renames the following functions to avoid confusion. eficonfig_select_file_handler() -> eficonfig_process_select_file() eficonfig_select_file() -> eficonfig_show_file_selection() eficonfig_display_select_file_option() -> eficonfig_process_show_file_option() Finally, test_eficonfig.py need to be updated to get aligned with the above modification. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
1167e88a |
|
14-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix missing variable initialization The 'ret' variable must be initialized before use in eficonfig_delete_invalid_boot_option(). Fixes: c416f1c0bc ("bootmenu: add removable media entries") Addresses-Coverity: 376207 ("Uninitialized variables") Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
3d595ac5 |
|
09-Nov-2022 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: remove superfluous if in eficonfig_edit_boot_option Goto for an immediately succeeding label is superfluous. Fixes: 87d791423ac6 ("eficonfig: menu-driven addition of UEFI boot option") Addresses-Coverity: 376202 ("Identical code for different branches") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
2c0b0c31 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_SECURE_BOOT This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_SECURE_BOOT defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
83f3d121 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_MM_COMM_TEE This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_MM_COMM_TEE defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
88df3634 |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: CTRL+S to save the boot order 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>
|
#
45f5319f |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
menu: remove CTRL+C to quit On the sandbox called without "--terminal raw" CTRL+C leaves U-Boot, "ESC/CTRL+C to quit" is misleading. Let's remove CTRL+C to quit key handling from bootmenu and eficonfig menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
|
#
8dbd0a0f |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add vertical scroll support The current eficonfig menu does not support vertical scroll, so it can not display the menu entries greater than the console row size. This commit add the vertial scroll support. The console size is retrieved by SIMPLE_TEXT_OUTPUT_PROTOCOL.QueryMode() service, then calculates the row size for menu entry by subtracting menu header and description row size from the console row size. "start" and "end" are added in the efimenu structure. "start" keeps the menu entry index at the top, "end" keeps the bottom menu entry index. item_data_print() menu function only draws the menu entry between "start" and "end". This commit also fixes the issue that "Save" and "Quit" entries can be moved by BKEY_PLUS in change boot order menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
0d590852 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation This commit removes the change boot order specific menu implementation. The change boot order implementation calls eficonfig_process_common() same as other menus. The change boot order menu requires own item_data_print and item_choice implementation, but display_statusline function can be a same function as other menus. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
cd160b27 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor eficonfig_process_common function Current change boot order implementation does not call eficonfig_process_common() and call own menu functions for display_statusline, item_data_print and item_choice. Change boot order functionality should call eficonfig_process_common() to improve maintenanceability. This commit is a preparation to remove the change boot order specific implementation. The menu functions (display_statusline, item_data_print and item_choice) are added as argument of eficonfig_process_common(). The menu description string displayed at the bottom of the menu is also added as argument. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
32bab0ea |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Make use of CLI character processing Avoid duplicating some of the escape-sequence processing here and use the CLI function instead. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
d0ca98db |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Update bootmenu_loop() to return the code Use the return value to save having to pass around a pointer. This also resolves any ambiguity about what *key contains when the function is called. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
2da4a15e |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Rename KEY_... to BKEY_... This enum values conflict with linux/input.h so rename them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
64550274 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: avoid SetVariable between GetNextVariableName calls The current code calls efi_set_variable_int() to delete the invalid boot option between calls to efi_get_next_variable_name_int(), it may produce unpredictable results. This commit moves removal of the invalid boot option outside of the efi_get_next_variable_name_int() calls. EFI_NOT_FOUND returned from efi_get_next_variable_name_int() indicates we retrieved all EFI variables, it should be treated as EFI_SUCEESS. To address the checkpatch warning of too many leading tabs, combine two if statement into one. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
ce327084 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: carve out efi_get_next_variable_name_int calls To retrieve the EFI variable name by efi_get_next_variable_name_int(), the sequence of alloc -> efi_get_next_variable_name_int -> realloc -> efi_get_next_variable_name_int is required. In current code, this sequence repeatedly appears in the several functions. It should be curved out a common function. This commit also fixes the missing free() of var_name16 in eficonfig_delete_invalid_boot_option(). Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
140a8959 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use efi_get_next_variable_name_int() eficonfig command reads all possible UEFI load options from 0x0000 to 0xFFFF to construct the menu. This takes too much time in some environment. This commit uses efi_get_next_variable_name_int() to read all existing UEFI load options to significantlly reduce the count of efi_get_var() call. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
78b1ccc4 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use u16_strsize() to get u16 string buffer size Use u16_strsize() to simplify the u16 string buffer size calculation. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c67d3c9e |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix going one directory up issue The directory name in eficonfig menu entry contains the '\' separator. strcmp() argument ".." is wrong and one directory up handling does not work correctly. strcmp() argument must include '\' separator. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c3b5af63 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add UEFI Secure Boot Key enrollment interface This commit adds the menu-driven UEFI Secure Boot Key enrollment interface. User can enroll PK, KEK, db and dbx by selecting file. Only the signed EFI Signature List(s) with an authenticated header, typically '.auth' file, is accepted. To clear the PK, KEK, db and dbx, user needs to enroll the null key signed by PK or KEK. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
21faf4ef |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use protocol interface for file selection EFI_SIMPLE_FILE_SYSTEM_PROTOCOL is not always provided by U-Boot. Use protocol interface functions instead of U-Boot internal functions. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d6566113 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose eficonfig_create_device_path() Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use eficonfig_create_device_path() to construct the full device path from device path of the volume and file path, so move it out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d571f9b2 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation All the eficonfig menus other than "Change Boot Order" use 'eficonfig_entry' structure for each menu entry. This commit refactors change boot order implementation to use 'eficonfig_entry' structure same as other menus to have consistent menu handling. This commit also simplifies the data->active handling when KEY_SPACE is pressed, and sizeof() parameter. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
8961e93e |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose append entry function Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use append_entry() and append_quit_entry() to construct the menu, so move them out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
a84040ab |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor file selection handling eficonfig_select_file_handler() is commonly used to select the file. eficonfig_display_select_file_option() adds an additional menu to clear the selected file. eficonfig_display_select_file_option() is not always necessary for the file selection process, so it must be outside of eficonfig_select_file_handler(). This commit also renames the following functions to avoid confusion. eficonfig_select_file_handler() -> eficonfig_process_select_file() eficonfig_select_file() -> eficonfig_show_file_selection() eficonfig_display_select_file_option() -> eficonfig_process_show_file_option() Finally, test_eficonfig.py need to be updated to get aligned with the above modification. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
1167e88a |
|
14-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix missing variable initialization The 'ret' variable must be initialized before use in eficonfig_delete_invalid_boot_option(). Fixes: c416f1c0bc ("bootmenu: add removable media entries") Addresses-Coverity: 376207 ("Uninitialized variables") Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
3d595ac5 |
|
09-Nov-2022 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: remove superfluous if in eficonfig_edit_boot_option Goto for an immediately succeeding label is superfluous. Fixes: 87d791423ac6 ("eficonfig: menu-driven addition of UEFI boot option") Addresses-Coverity: 376202 ("Identical code for different branches") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
2c0b0c31 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_SECURE_BOOT This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_SECURE_BOOT defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
83f3d121 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_MM_COMM_TEE This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_MM_COMM_TEE defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
88df3634 |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: CTRL+S to save the boot order 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>
|
#
45f5319f |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
menu: remove CTRL+C to quit On the sandbox called without "--terminal raw" CTRL+C leaves U-Boot, "ESC/CTRL+C to quit" is misleading. Let's remove CTRL+C to quit key handling from bootmenu and eficonfig menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
|
#
8dbd0a0f |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add vertical scroll support The current eficonfig menu does not support vertical scroll, so it can not display the menu entries greater than the console row size. This commit add the vertial scroll support. The console size is retrieved by SIMPLE_TEXT_OUTPUT_PROTOCOL.QueryMode() service, then calculates the row size for menu entry by subtracting menu header and description row size from the console row size. "start" and "end" are added in the efimenu structure. "start" keeps the menu entry index at the top, "end" keeps the bottom menu entry index. item_data_print() menu function only draws the menu entry between "start" and "end". This commit also fixes the issue that "Save" and "Quit" entries can be moved by BKEY_PLUS in change boot order menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
0d590852 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation This commit removes the change boot order specific menu implementation. The change boot order implementation calls eficonfig_process_common() same as other menus. The change boot order menu requires own item_data_print and item_choice implementation, but display_statusline function can be a same function as other menus. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
cd160b27 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor eficonfig_process_common function Current change boot order implementation does not call eficonfig_process_common() and call own menu functions for display_statusline, item_data_print and item_choice. Change boot order functionality should call eficonfig_process_common() to improve maintenanceability. This commit is a preparation to remove the change boot order specific implementation. The menu functions (display_statusline, item_data_print and item_choice) are added as argument of eficonfig_process_common(). The menu description string displayed at the bottom of the menu is also added as argument. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
32bab0ea |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Make use of CLI character processing Avoid duplicating some of the escape-sequence processing here and use the CLI function instead. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
d0ca98db |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Update bootmenu_loop() to return the code Use the return value to save having to pass around a pointer. This also resolves any ambiguity about what *key contains when the function is called. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
2da4a15e |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Rename KEY_... to BKEY_... This enum values conflict with linux/input.h so rename them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
64550274 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: avoid SetVariable between GetNextVariableName calls The current code calls efi_set_variable_int() to delete the invalid boot option between calls to efi_get_next_variable_name_int(), it may produce unpredictable results. This commit moves removal of the invalid boot option outside of the efi_get_next_variable_name_int() calls. EFI_NOT_FOUND returned from efi_get_next_variable_name_int() indicates we retrieved all EFI variables, it should be treated as EFI_SUCEESS. To address the checkpatch warning of too many leading tabs, combine two if statement into one. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
ce327084 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: carve out efi_get_next_variable_name_int calls To retrieve the EFI variable name by efi_get_next_variable_name_int(), the sequence of alloc -> efi_get_next_variable_name_int -> realloc -> efi_get_next_variable_name_int is required. In current code, this sequence repeatedly appears in the several functions. It should be curved out a common function. This commit also fixes the missing free() of var_name16 in eficonfig_delete_invalid_boot_option(). Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
140a8959 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use efi_get_next_variable_name_int() eficonfig command reads all possible UEFI load options from 0x0000 to 0xFFFF to construct the menu. This takes too much time in some environment. This commit uses efi_get_next_variable_name_int() to read all existing UEFI load options to significantlly reduce the count of efi_get_var() call. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
78b1ccc4 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use u16_strsize() to get u16 string buffer size Use u16_strsize() to simplify the u16 string buffer size calculation. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c67d3c9e |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix going one directory up issue The directory name in eficonfig menu entry contains the '\' separator. strcmp() argument ".." is wrong and one directory up handling does not work correctly. strcmp() argument must include '\' separator. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c3b5af63 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add UEFI Secure Boot Key enrollment interface This commit adds the menu-driven UEFI Secure Boot Key enrollment interface. User can enroll PK, KEK, db and dbx by selecting file. Only the signed EFI Signature List(s) with an authenticated header, typically '.auth' file, is accepted. To clear the PK, KEK, db and dbx, user needs to enroll the null key signed by PK or KEK. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
21faf4ef |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use protocol interface for file selection EFI_SIMPLE_FILE_SYSTEM_PROTOCOL is not always provided by U-Boot. Use protocol interface functions instead of U-Boot internal functions. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d6566113 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose eficonfig_create_device_path() Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use eficonfig_create_device_path() to construct the full device path from device path of the volume and file path, so move it out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d571f9b2 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation All the eficonfig menus other than "Change Boot Order" use 'eficonfig_entry' structure for each menu entry. This commit refactors change boot order implementation to use 'eficonfig_entry' structure same as other menus to have consistent menu handling. This commit also simplifies the data->active handling when KEY_SPACE is pressed, and sizeof() parameter. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
8961e93e |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose append entry function Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use append_entry() and append_quit_entry() to construct the menu, so move them out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
a84040ab |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor file selection handling eficonfig_select_file_handler() is commonly used to select the file. eficonfig_display_select_file_option() adds an additional menu to clear the selected file. eficonfig_display_select_file_option() is not always necessary for the file selection process, so it must be outside of eficonfig_select_file_handler(). This commit also renames the following functions to avoid confusion. eficonfig_select_file_handler() -> eficonfig_process_select_file() eficonfig_select_file() -> eficonfig_show_file_selection() eficonfig_display_select_file_option() -> eficonfig_process_show_file_option() Finally, test_eficonfig.py need to be updated to get aligned with the above modification. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
1167e88a |
|
14-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix missing variable initialization The 'ret' variable must be initialized before use in eficonfig_delete_invalid_boot_option(). Fixes: c416f1c0bc ("bootmenu: add removable media entries") Addresses-Coverity: 376207 ("Uninitialized variables") Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
3d595ac5 |
|
09-Nov-2022 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: remove superfluous if in eficonfig_edit_boot_option Goto for an immediately succeeding label is superfluous. Fixes: 87d791423ac6 ("eficonfig: menu-driven addition of UEFI boot option") Addresses-Coverity: 376202 ("Identical code for different branches") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
2c0b0c31 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_SECURE_BOOT This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_SECURE_BOOT defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
83f3d121 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_MM_COMM_TEE This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_MM_COMM_TEE defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
88df3634 |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: CTRL+S to save the boot order 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>
|
#
45f5319f |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
menu: remove CTRL+C to quit On the sandbox called without "--terminal raw" CTRL+C leaves U-Boot, "ESC/CTRL+C to quit" is misleading. Let's remove CTRL+C to quit key handling from bootmenu and eficonfig menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
|
#
8dbd0a0f |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add vertical scroll support The current eficonfig menu does not support vertical scroll, so it can not display the menu entries greater than the console row size. This commit add the vertial scroll support. The console size is retrieved by SIMPLE_TEXT_OUTPUT_PROTOCOL.QueryMode() service, then calculates the row size for menu entry by subtracting menu header and description row size from the console row size. "start" and "end" are added in the efimenu structure. "start" keeps the menu entry index at the top, "end" keeps the bottom menu entry index. item_data_print() menu function only draws the menu entry between "start" and "end". This commit also fixes the issue that "Save" and "Quit" entries can be moved by BKEY_PLUS in change boot order menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
0d590852 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation This commit removes the change boot order specific menu implementation. The change boot order implementation calls eficonfig_process_common() same as other menus. The change boot order menu requires own item_data_print and item_choice implementation, but display_statusline function can be a same function as other menus. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
cd160b27 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor eficonfig_process_common function Current change boot order implementation does not call eficonfig_process_common() and call own menu functions for display_statusline, item_data_print and item_choice. Change boot order functionality should call eficonfig_process_common() to improve maintenanceability. This commit is a preparation to remove the change boot order specific implementation. The menu functions (display_statusline, item_data_print and item_choice) are added as argument of eficonfig_process_common(). The menu description string displayed at the bottom of the menu is also added as argument. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
32bab0ea |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Make use of CLI character processing Avoid duplicating some of the escape-sequence processing here and use the CLI function instead. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
d0ca98db |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Update bootmenu_loop() to return the code Use the return value to save having to pass around a pointer. This also resolves any ambiguity about what *key contains when the function is called. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
2da4a15e |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Rename KEY_... to BKEY_... This enum values conflict with linux/input.h so rename them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
64550274 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: avoid SetVariable between GetNextVariableName calls The current code calls efi_set_variable_int() to delete the invalid boot option between calls to efi_get_next_variable_name_int(), it may produce unpredictable results. This commit moves removal of the invalid boot option outside of the efi_get_next_variable_name_int() calls. EFI_NOT_FOUND returned from efi_get_next_variable_name_int() indicates we retrieved all EFI variables, it should be treated as EFI_SUCEESS. To address the checkpatch warning of too many leading tabs, combine two if statement into one. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
ce327084 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: carve out efi_get_next_variable_name_int calls To retrieve the EFI variable name by efi_get_next_variable_name_int(), the sequence of alloc -> efi_get_next_variable_name_int -> realloc -> efi_get_next_variable_name_int is required. In current code, this sequence repeatedly appears in the several functions. It should be curved out a common function. This commit also fixes the missing free() of var_name16 in eficonfig_delete_invalid_boot_option(). Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
140a8959 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use efi_get_next_variable_name_int() eficonfig command reads all possible UEFI load options from 0x0000 to 0xFFFF to construct the menu. This takes too much time in some environment. This commit uses efi_get_next_variable_name_int() to read all existing UEFI load options to significantlly reduce the count of efi_get_var() call. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
78b1ccc4 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use u16_strsize() to get u16 string buffer size Use u16_strsize() to simplify the u16 string buffer size calculation. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c67d3c9e |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix going one directory up issue The directory name in eficonfig menu entry contains the '\' separator. strcmp() argument ".." is wrong and one directory up handling does not work correctly. strcmp() argument must include '\' separator. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c3b5af63 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add UEFI Secure Boot Key enrollment interface This commit adds the menu-driven UEFI Secure Boot Key enrollment interface. User can enroll PK, KEK, db and dbx by selecting file. Only the signed EFI Signature List(s) with an authenticated header, typically '.auth' file, is accepted. To clear the PK, KEK, db and dbx, user needs to enroll the null key signed by PK or KEK. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
21faf4ef |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use protocol interface for file selection EFI_SIMPLE_FILE_SYSTEM_PROTOCOL is not always provided by U-Boot. Use protocol interface functions instead of U-Boot internal functions. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d6566113 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose eficonfig_create_device_path() Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use eficonfig_create_device_path() to construct the full device path from device path of the volume and file path, so move it out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d571f9b2 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation All the eficonfig menus other than "Change Boot Order" use 'eficonfig_entry' structure for each menu entry. This commit refactors change boot order implementation to use 'eficonfig_entry' structure same as other menus to have consistent menu handling. This commit also simplifies the data->active handling when KEY_SPACE is pressed, and sizeof() parameter. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
8961e93e |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose append entry function Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use append_entry() and append_quit_entry() to construct the menu, so move them out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
a84040ab |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor file selection handling eficonfig_select_file_handler() is commonly used to select the file. eficonfig_display_select_file_option() adds an additional menu to clear the selected file. eficonfig_display_select_file_option() is not always necessary for the file selection process, so it must be outside of eficonfig_select_file_handler(). This commit also renames the following functions to avoid confusion. eficonfig_select_file_handler() -> eficonfig_process_select_file() eficonfig_select_file() -> eficonfig_show_file_selection() eficonfig_display_select_file_option() -> eficonfig_process_show_file_option() Finally, test_eficonfig.py need to be updated to get aligned with the above modification. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
1167e88a |
|
14-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix missing variable initialization The 'ret' variable must be initialized before use in eficonfig_delete_invalid_boot_option(). Fixes: c416f1c0bc ("bootmenu: add removable media entries") Addresses-Coverity: 376207 ("Uninitialized variables") Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
3d595ac5 |
|
09-Nov-2022 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: remove superfluous if in eficonfig_edit_boot_option Goto for an immediately succeeding label is superfluous. Fixes: 87d791423ac6 ("eficonfig: menu-driven addition of UEFI boot option") Addresses-Coverity: 376202 ("Identical code for different branches") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
2c0b0c31 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_SECURE_BOOT This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_SECURE_BOOT defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
83f3d121 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_MM_COMM_TEE This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_MM_COMM_TEE defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
88df3634 |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: CTRL+S to save the boot order 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>
|
#
45f5319f |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
menu: remove CTRL+C to quit On the sandbox called without "--terminal raw" CTRL+C leaves U-Boot, "ESC/CTRL+C to quit" is misleading. Let's remove CTRL+C to quit key handling from bootmenu and eficonfig menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
|
#
8dbd0a0f |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add vertical scroll support The current eficonfig menu does not support vertical scroll, so it can not display the menu entries greater than the console row size. This commit add the vertial scroll support. The console size is retrieved by SIMPLE_TEXT_OUTPUT_PROTOCOL.QueryMode() service, then calculates the row size for menu entry by subtracting menu header and description row size from the console row size. "start" and "end" are added in the efimenu structure. "start" keeps the menu entry index at the top, "end" keeps the bottom menu entry index. item_data_print() menu function only draws the menu entry between "start" and "end". This commit also fixes the issue that "Save" and "Quit" entries can be moved by BKEY_PLUS in change boot order menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
0d590852 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation This commit removes the change boot order specific menu implementation. The change boot order implementation calls eficonfig_process_common() same as other menus. The change boot order menu requires own item_data_print and item_choice implementation, but display_statusline function can be a same function as other menus. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
cd160b27 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor eficonfig_process_common function Current change boot order implementation does not call eficonfig_process_common() and call own menu functions for display_statusline, item_data_print and item_choice. Change boot order functionality should call eficonfig_process_common() to improve maintenanceability. This commit is a preparation to remove the change boot order specific implementation. The menu functions (display_statusline, item_data_print and item_choice) are added as argument of eficonfig_process_common(). The menu description string displayed at the bottom of the menu is also added as argument. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
32bab0ea |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Make use of CLI character processing Avoid duplicating some of the escape-sequence processing here and use the CLI function instead. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
d0ca98db |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Update bootmenu_loop() to return the code Use the return value to save having to pass around a pointer. This also resolves any ambiguity about what *key contains when the function is called. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
2da4a15e |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Rename KEY_... to BKEY_... This enum values conflict with linux/input.h so rename them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
64550274 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: avoid SetVariable between GetNextVariableName calls The current code calls efi_set_variable_int() to delete the invalid boot option between calls to efi_get_next_variable_name_int(), it may produce unpredictable results. This commit moves removal of the invalid boot option outside of the efi_get_next_variable_name_int() calls. EFI_NOT_FOUND returned from efi_get_next_variable_name_int() indicates we retrieved all EFI variables, it should be treated as EFI_SUCEESS. To address the checkpatch warning of too many leading tabs, combine two if statement into one. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
ce327084 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: carve out efi_get_next_variable_name_int calls To retrieve the EFI variable name by efi_get_next_variable_name_int(), the sequence of alloc -> efi_get_next_variable_name_int -> realloc -> efi_get_next_variable_name_int is required. In current code, this sequence repeatedly appears in the several functions. It should be curved out a common function. This commit also fixes the missing free() of var_name16 in eficonfig_delete_invalid_boot_option(). Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
140a8959 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use efi_get_next_variable_name_int() eficonfig command reads all possible UEFI load options from 0x0000 to 0xFFFF to construct the menu. This takes too much time in some environment. This commit uses efi_get_next_variable_name_int() to read all existing UEFI load options to significantlly reduce the count of efi_get_var() call. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
78b1ccc4 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use u16_strsize() to get u16 string buffer size Use u16_strsize() to simplify the u16 string buffer size calculation. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c67d3c9e |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix going one directory up issue The directory name in eficonfig menu entry contains the '\' separator. strcmp() argument ".." is wrong and one directory up handling does not work correctly. strcmp() argument must include '\' separator. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c3b5af63 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add UEFI Secure Boot Key enrollment interface This commit adds the menu-driven UEFI Secure Boot Key enrollment interface. User can enroll PK, KEK, db and dbx by selecting file. Only the signed EFI Signature List(s) with an authenticated header, typically '.auth' file, is accepted. To clear the PK, KEK, db and dbx, user needs to enroll the null key signed by PK or KEK. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
21faf4ef |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use protocol interface for file selection EFI_SIMPLE_FILE_SYSTEM_PROTOCOL is not always provided by U-Boot. Use protocol interface functions instead of U-Boot internal functions. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d6566113 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose eficonfig_create_device_path() Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use eficonfig_create_device_path() to construct the full device path from device path of the volume and file path, so move it out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d571f9b2 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation All the eficonfig menus other than "Change Boot Order" use 'eficonfig_entry' structure for each menu entry. This commit refactors change boot order implementation to use 'eficonfig_entry' structure same as other menus to have consistent menu handling. This commit also simplifies the data->active handling when KEY_SPACE is pressed, and sizeof() parameter. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
8961e93e |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose append entry function Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use append_entry() and append_quit_entry() to construct the menu, so move them out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
a84040ab |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor file selection handling eficonfig_select_file_handler() is commonly used to select the file. eficonfig_display_select_file_option() adds an additional menu to clear the selected file. eficonfig_display_select_file_option() is not always necessary for the file selection process, so it must be outside of eficonfig_select_file_handler(). This commit also renames the following functions to avoid confusion. eficonfig_select_file_handler() -> eficonfig_process_select_file() eficonfig_select_file() -> eficonfig_show_file_selection() eficonfig_display_select_file_option() -> eficonfig_process_show_file_option() Finally, test_eficonfig.py need to be updated to get aligned with the above modification. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
1167e88a |
|
14-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix missing variable initialization The 'ret' variable must be initialized before use in eficonfig_delete_invalid_boot_option(). Fixes: c416f1c0bc ("bootmenu: add removable media entries") Addresses-Coverity: 376207 ("Uninitialized variables") Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
3d595ac5 |
|
09-Nov-2022 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: remove superfluous if in eficonfig_edit_boot_option Goto for an immediately succeeding label is superfluous. Fixes: 87d791423ac6 ("eficonfig: menu-driven addition of UEFI boot option") Addresses-Coverity: 376202 ("Identical code for different branches") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
2c0b0c31 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_SECURE_BOOT This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_SECURE_BOOT defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
83f3d121 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_MM_COMM_TEE This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_MM_COMM_TEE defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
88df3634 |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: CTRL+S to save the boot order 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>
|
#
45f5319f |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
menu: remove CTRL+C to quit On the sandbox called without "--terminal raw" CTRL+C leaves U-Boot, "ESC/CTRL+C to quit" is misleading. Let's remove CTRL+C to quit key handling from bootmenu and eficonfig menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
|
#
8dbd0a0f |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add vertical scroll support The current eficonfig menu does not support vertical scroll, so it can not display the menu entries greater than the console row size. This commit add the vertial scroll support. The console size is retrieved by SIMPLE_TEXT_OUTPUT_PROTOCOL.QueryMode() service, then calculates the row size for menu entry by subtracting menu header and description row size from the console row size. "start" and "end" are added in the efimenu structure. "start" keeps the menu entry index at the top, "end" keeps the bottom menu entry index. item_data_print() menu function only draws the menu entry between "start" and "end". This commit also fixes the issue that "Save" and "Quit" entries can be moved by BKEY_PLUS in change boot order menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
0d590852 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation This commit removes the change boot order specific menu implementation. The change boot order implementation calls eficonfig_process_common() same as other menus. The change boot order menu requires own item_data_print and item_choice implementation, but display_statusline function can be a same function as other menus. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
cd160b27 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor eficonfig_process_common function Current change boot order implementation does not call eficonfig_process_common() and call own menu functions for display_statusline, item_data_print and item_choice. Change boot order functionality should call eficonfig_process_common() to improve maintenanceability. This commit is a preparation to remove the change boot order specific implementation. The menu functions (display_statusline, item_data_print and item_choice) are added as argument of eficonfig_process_common(). The menu description string displayed at the bottom of the menu is also added as argument. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
32bab0ea |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Make use of CLI character processing Avoid duplicating some of the escape-sequence processing here and use the CLI function instead. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
d0ca98db |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Update bootmenu_loop() to return the code Use the return value to save having to pass around a pointer. This also resolves any ambiguity about what *key contains when the function is called. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
2da4a15e |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Rename KEY_... to BKEY_... This enum values conflict with linux/input.h so rename them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
64550274 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: avoid SetVariable between GetNextVariableName calls The current code calls efi_set_variable_int() to delete the invalid boot option between calls to efi_get_next_variable_name_int(), it may produce unpredictable results. This commit moves removal of the invalid boot option outside of the efi_get_next_variable_name_int() calls. EFI_NOT_FOUND returned from efi_get_next_variable_name_int() indicates we retrieved all EFI variables, it should be treated as EFI_SUCEESS. To address the checkpatch warning of too many leading tabs, combine two if statement into one. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
ce327084 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: carve out efi_get_next_variable_name_int calls To retrieve the EFI variable name by efi_get_next_variable_name_int(), the sequence of alloc -> efi_get_next_variable_name_int -> realloc -> efi_get_next_variable_name_int is required. In current code, this sequence repeatedly appears in the several functions. It should be curved out a common function. This commit also fixes the missing free() of var_name16 in eficonfig_delete_invalid_boot_option(). Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
140a8959 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use efi_get_next_variable_name_int() eficonfig command reads all possible UEFI load options from 0x0000 to 0xFFFF to construct the menu. This takes too much time in some environment. This commit uses efi_get_next_variable_name_int() to read all existing UEFI load options to significantlly reduce the count of efi_get_var() call. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
78b1ccc4 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use u16_strsize() to get u16 string buffer size Use u16_strsize() to simplify the u16 string buffer size calculation. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c67d3c9e |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix going one directory up issue The directory name in eficonfig menu entry contains the '\' separator. strcmp() argument ".." is wrong and one directory up handling does not work correctly. strcmp() argument must include '\' separator. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c3b5af63 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add UEFI Secure Boot Key enrollment interface This commit adds the menu-driven UEFI Secure Boot Key enrollment interface. User can enroll PK, KEK, db and dbx by selecting file. Only the signed EFI Signature List(s) with an authenticated header, typically '.auth' file, is accepted. To clear the PK, KEK, db and dbx, user needs to enroll the null key signed by PK or KEK. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
21faf4ef |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use protocol interface for file selection EFI_SIMPLE_FILE_SYSTEM_PROTOCOL is not always provided by U-Boot. Use protocol interface functions instead of U-Boot internal functions. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d6566113 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose eficonfig_create_device_path() Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use eficonfig_create_device_path() to construct the full device path from device path of the volume and file path, so move it out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d571f9b2 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation All the eficonfig menus other than "Change Boot Order" use 'eficonfig_entry' structure for each menu entry. This commit refactors change boot order implementation to use 'eficonfig_entry' structure same as other menus to have consistent menu handling. This commit also simplifies the data->active handling when KEY_SPACE is pressed, and sizeof() parameter. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
8961e93e |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose append entry function Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use append_entry() and append_quit_entry() to construct the menu, so move them out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
a84040ab |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor file selection handling eficonfig_select_file_handler() is commonly used to select the file. eficonfig_display_select_file_option() adds an additional menu to clear the selected file. eficonfig_display_select_file_option() is not always necessary for the file selection process, so it must be outside of eficonfig_select_file_handler(). This commit also renames the following functions to avoid confusion. eficonfig_select_file_handler() -> eficonfig_process_select_file() eficonfig_select_file() -> eficonfig_show_file_selection() eficonfig_display_select_file_option() -> eficonfig_process_show_file_option() Finally, test_eficonfig.py need to be updated to get aligned with the above modification. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
1167e88a |
|
14-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix missing variable initialization The 'ret' variable must be initialized before use in eficonfig_delete_invalid_boot_option(). Fixes: c416f1c0bc ("bootmenu: add removable media entries") Addresses-Coverity: 376207 ("Uninitialized variables") Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
3d595ac5 |
|
09-Nov-2022 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: remove superfluous if in eficonfig_edit_boot_option Goto for an immediately succeeding label is superfluous. Fixes: 87d791423ac6 ("eficonfig: menu-driven addition of UEFI boot option") Addresses-Coverity: 376202 ("Identical code for different branches") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
2c0b0c31 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_SECURE_BOOT This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_SECURE_BOOT defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
83f3d121 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_MM_COMM_TEE This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_MM_COMM_TEE defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
88df3634 |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: CTRL+S to save the boot order 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>
|
#
45f5319f |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
menu: remove CTRL+C to quit On the sandbox called without "--terminal raw" CTRL+C leaves U-Boot, "ESC/CTRL+C to quit" is misleading. Let's remove CTRL+C to quit key handling from bootmenu and eficonfig menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
|
#
8dbd0a0f |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add vertical scroll support The current eficonfig menu does not support vertical scroll, so it can not display the menu entries greater than the console row size. This commit add the vertial scroll support. The console size is retrieved by SIMPLE_TEXT_OUTPUT_PROTOCOL.QueryMode() service, then calculates the row size for menu entry by subtracting menu header and description row size from the console row size. "start" and "end" are added in the efimenu structure. "start" keeps the menu entry index at the top, "end" keeps the bottom menu entry index. item_data_print() menu function only draws the menu entry between "start" and "end". This commit also fixes the issue that "Save" and "Quit" entries can be moved by BKEY_PLUS in change boot order menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
0d590852 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation This commit removes the change boot order specific menu implementation. The change boot order implementation calls eficonfig_process_common() same as other menus. The change boot order menu requires own item_data_print and item_choice implementation, but display_statusline function can be a same function as other menus. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
cd160b27 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor eficonfig_process_common function Current change boot order implementation does not call eficonfig_process_common() and call own menu functions for display_statusline, item_data_print and item_choice. Change boot order functionality should call eficonfig_process_common() to improve maintenanceability. This commit is a preparation to remove the change boot order specific implementation. The menu functions (display_statusline, item_data_print and item_choice) are added as argument of eficonfig_process_common(). The menu description string displayed at the bottom of the menu is also added as argument. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
32bab0ea |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Make use of CLI character processing Avoid duplicating some of the escape-sequence processing here and use the CLI function instead. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
d0ca98db |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Update bootmenu_loop() to return the code Use the return value to save having to pass around a pointer. This also resolves any ambiguity about what *key contains when the function is called. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
2da4a15e |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Rename KEY_... to BKEY_... This enum values conflict with linux/input.h so rename them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
64550274 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: avoid SetVariable between GetNextVariableName calls The current code calls efi_set_variable_int() to delete the invalid boot option between calls to efi_get_next_variable_name_int(), it may produce unpredictable results. This commit moves removal of the invalid boot option outside of the efi_get_next_variable_name_int() calls. EFI_NOT_FOUND returned from efi_get_next_variable_name_int() indicates we retrieved all EFI variables, it should be treated as EFI_SUCEESS. To address the checkpatch warning of too many leading tabs, combine two if statement into one. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
ce327084 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: carve out efi_get_next_variable_name_int calls To retrieve the EFI variable name by efi_get_next_variable_name_int(), the sequence of alloc -> efi_get_next_variable_name_int -> realloc -> efi_get_next_variable_name_int is required. In current code, this sequence repeatedly appears in the several functions. It should be curved out a common function. This commit also fixes the missing free() of var_name16 in eficonfig_delete_invalid_boot_option(). Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
140a8959 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use efi_get_next_variable_name_int() eficonfig command reads all possible UEFI load options from 0x0000 to 0xFFFF to construct the menu. This takes too much time in some environment. This commit uses efi_get_next_variable_name_int() to read all existing UEFI load options to significantlly reduce the count of efi_get_var() call. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
78b1ccc4 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use u16_strsize() to get u16 string buffer size Use u16_strsize() to simplify the u16 string buffer size calculation. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c67d3c9e |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix going one directory up issue The directory name in eficonfig menu entry contains the '\' separator. strcmp() argument ".." is wrong and one directory up handling does not work correctly. strcmp() argument must include '\' separator. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c3b5af63 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add UEFI Secure Boot Key enrollment interface This commit adds the menu-driven UEFI Secure Boot Key enrollment interface. User can enroll PK, KEK, db and dbx by selecting file. Only the signed EFI Signature List(s) with an authenticated header, typically '.auth' file, is accepted. To clear the PK, KEK, db and dbx, user needs to enroll the null key signed by PK or KEK. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
21faf4ef |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use protocol interface for file selection EFI_SIMPLE_FILE_SYSTEM_PROTOCOL is not always provided by U-Boot. Use protocol interface functions instead of U-Boot internal functions. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d6566113 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose eficonfig_create_device_path() Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use eficonfig_create_device_path() to construct the full device path from device path of the volume and file path, so move it out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d571f9b2 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation All the eficonfig menus other than "Change Boot Order" use 'eficonfig_entry' structure for each menu entry. This commit refactors change boot order implementation to use 'eficonfig_entry' structure same as other menus to have consistent menu handling. This commit also simplifies the data->active handling when KEY_SPACE is pressed, and sizeof() parameter. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
8961e93e |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose append entry function Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use append_entry() and append_quit_entry() to construct the menu, so move them out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
a84040ab |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor file selection handling eficonfig_select_file_handler() is commonly used to select the file. eficonfig_display_select_file_option() adds an additional menu to clear the selected file. eficonfig_display_select_file_option() is not always necessary for the file selection process, so it must be outside of eficonfig_select_file_handler(). This commit also renames the following functions to avoid confusion. eficonfig_select_file_handler() -> eficonfig_process_select_file() eficonfig_select_file() -> eficonfig_show_file_selection() eficonfig_display_select_file_option() -> eficonfig_process_show_file_option() Finally, test_eficonfig.py need to be updated to get aligned with the above modification. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
1167e88a |
|
14-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix missing variable initialization The 'ret' variable must be initialized before use in eficonfig_delete_invalid_boot_option(). Fixes: c416f1c0bc ("bootmenu: add removable media entries") Addresses-Coverity: 376207 ("Uninitialized variables") Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
3d595ac5 |
|
09-Nov-2022 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: remove superfluous if in eficonfig_edit_boot_option Goto for an immediately succeeding label is superfluous. Fixes: 87d791423ac6 ("eficonfig: menu-driven addition of UEFI boot option") Addresses-Coverity: 376202 ("Identical code for different branches") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
2c0b0c31 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_SECURE_BOOT This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_SECURE_BOOT defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
83f3d121 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_MM_COMM_TEE This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_MM_COMM_TEE defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
88df3634 |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: CTRL+S to save the boot order 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>
|
#
45f5319f |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
menu: remove CTRL+C to quit On the sandbox called without "--terminal raw" CTRL+C leaves U-Boot, "ESC/CTRL+C to quit" is misleading. Let's remove CTRL+C to quit key handling from bootmenu and eficonfig menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
|
#
8dbd0a0f |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add vertical scroll support The current eficonfig menu does not support vertical scroll, so it can not display the menu entries greater than the console row size. This commit add the vertial scroll support. The console size is retrieved by SIMPLE_TEXT_OUTPUT_PROTOCOL.QueryMode() service, then calculates the row size for menu entry by subtracting menu header and description row size from the console row size. "start" and "end" are added in the efimenu structure. "start" keeps the menu entry index at the top, "end" keeps the bottom menu entry index. item_data_print() menu function only draws the menu entry between "start" and "end". This commit also fixes the issue that "Save" and "Quit" entries can be moved by BKEY_PLUS in change boot order menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
0d590852 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation This commit removes the change boot order specific menu implementation. The change boot order implementation calls eficonfig_process_common() same as other menus. The change boot order menu requires own item_data_print and item_choice implementation, but display_statusline function can be a same function as other menus. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
cd160b27 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor eficonfig_process_common function Current change boot order implementation does not call eficonfig_process_common() and call own menu functions for display_statusline, item_data_print and item_choice. Change boot order functionality should call eficonfig_process_common() to improve maintenanceability. This commit is a preparation to remove the change boot order specific implementation. The menu functions (display_statusline, item_data_print and item_choice) are added as argument of eficonfig_process_common(). The menu description string displayed at the bottom of the menu is also added as argument. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
32bab0ea |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Make use of CLI character processing Avoid duplicating some of the escape-sequence processing here and use the CLI function instead. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
d0ca98db |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Update bootmenu_loop() to return the code Use the return value to save having to pass around a pointer. This also resolves any ambiguity about what *key contains when the function is called. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
2da4a15e |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Rename KEY_... to BKEY_... This enum values conflict with linux/input.h so rename them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
64550274 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: avoid SetVariable between GetNextVariableName calls The current code calls efi_set_variable_int() to delete the invalid boot option between calls to efi_get_next_variable_name_int(), it may produce unpredictable results. This commit moves removal of the invalid boot option outside of the efi_get_next_variable_name_int() calls. EFI_NOT_FOUND returned from efi_get_next_variable_name_int() indicates we retrieved all EFI variables, it should be treated as EFI_SUCEESS. To address the checkpatch warning of too many leading tabs, combine two if statement into one. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
ce327084 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: carve out efi_get_next_variable_name_int calls To retrieve the EFI variable name by efi_get_next_variable_name_int(), the sequence of alloc -> efi_get_next_variable_name_int -> realloc -> efi_get_next_variable_name_int is required. In current code, this sequence repeatedly appears in the several functions. It should be curved out a common function. This commit also fixes the missing free() of var_name16 in eficonfig_delete_invalid_boot_option(). Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
140a8959 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use efi_get_next_variable_name_int() eficonfig command reads all possible UEFI load options from 0x0000 to 0xFFFF to construct the menu. This takes too much time in some environment. This commit uses efi_get_next_variable_name_int() to read all existing UEFI load options to significantlly reduce the count of efi_get_var() call. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
78b1ccc4 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use u16_strsize() to get u16 string buffer size Use u16_strsize() to simplify the u16 string buffer size calculation. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c67d3c9e |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix going one directory up issue The directory name in eficonfig menu entry contains the '\' separator. strcmp() argument ".." is wrong and one directory up handling does not work correctly. strcmp() argument must include '\' separator. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c3b5af63 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add UEFI Secure Boot Key enrollment interface This commit adds the menu-driven UEFI Secure Boot Key enrollment interface. User can enroll PK, KEK, db and dbx by selecting file. Only the signed EFI Signature List(s) with an authenticated header, typically '.auth' file, is accepted. To clear the PK, KEK, db and dbx, user needs to enroll the null key signed by PK or KEK. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
21faf4ef |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use protocol interface for file selection EFI_SIMPLE_FILE_SYSTEM_PROTOCOL is not always provided by U-Boot. Use protocol interface functions instead of U-Boot internal functions. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d6566113 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose eficonfig_create_device_path() Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use eficonfig_create_device_path() to construct the full device path from device path of the volume and file path, so move it out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d571f9b2 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation All the eficonfig menus other than "Change Boot Order" use 'eficonfig_entry' structure for each menu entry. This commit refactors change boot order implementation to use 'eficonfig_entry' structure same as other menus to have consistent menu handling. This commit also simplifies the data->active handling when KEY_SPACE is pressed, and sizeof() parameter. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
8961e93e |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose append entry function Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use append_entry() and append_quit_entry() to construct the menu, so move them out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
a84040ab |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor file selection handling eficonfig_select_file_handler() is commonly used to select the file. eficonfig_display_select_file_option() adds an additional menu to clear the selected file. eficonfig_display_select_file_option() is not always necessary for the file selection process, so it must be outside of eficonfig_select_file_handler(). This commit also renames the following functions to avoid confusion. eficonfig_select_file_handler() -> eficonfig_process_select_file() eficonfig_select_file() -> eficonfig_show_file_selection() eficonfig_display_select_file_option() -> eficonfig_process_show_file_option() Finally, test_eficonfig.py need to be updated to get aligned with the above modification. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
1167e88a |
|
14-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix missing variable initialization The 'ret' variable must be initialized before use in eficonfig_delete_invalid_boot_option(). Fixes: c416f1c0bc ("bootmenu: add removable media entries") Addresses-Coverity: 376207 ("Uninitialized variables") Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
3d595ac5 |
|
09-Nov-2022 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: remove superfluous if in eficonfig_edit_boot_option Goto for an immediately succeeding label is superfluous. Fixes: 87d791423ac6 ("eficonfig: menu-driven addition of UEFI boot option") Addresses-Coverity: 376202 ("Identical code for different branches") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
2c0b0c31 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_SECURE_BOOT This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_SECURE_BOOT defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
83f3d121 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_MM_COMM_TEE This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_MM_COMM_TEE defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
88df3634 |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: CTRL+S to save the boot order 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>
|
#
45f5319f |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
menu: remove CTRL+C to quit On the sandbox called without "--terminal raw" CTRL+C leaves U-Boot, "ESC/CTRL+C to quit" is misleading. Let's remove CTRL+C to quit key handling from bootmenu and eficonfig menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
|
#
8dbd0a0f |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add vertical scroll support The current eficonfig menu does not support vertical scroll, so it can not display the menu entries greater than the console row size. This commit add the vertial scroll support. The console size is retrieved by SIMPLE_TEXT_OUTPUT_PROTOCOL.QueryMode() service, then calculates the row size for menu entry by subtracting menu header and description row size from the console row size. "start" and "end" are added in the efimenu structure. "start" keeps the menu entry index at the top, "end" keeps the bottom menu entry index. item_data_print() menu function only draws the menu entry between "start" and "end". This commit also fixes the issue that "Save" and "Quit" entries can be moved by BKEY_PLUS in change boot order menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
0d590852 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation This commit removes the change boot order specific menu implementation. The change boot order implementation calls eficonfig_process_common() same as other menus. The change boot order menu requires own item_data_print and item_choice implementation, but display_statusline function can be a same function as other menus. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
cd160b27 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor eficonfig_process_common function Current change boot order implementation does not call eficonfig_process_common() and call own menu functions for display_statusline, item_data_print and item_choice. Change boot order functionality should call eficonfig_process_common() to improve maintenanceability. This commit is a preparation to remove the change boot order specific implementation. The menu functions (display_statusline, item_data_print and item_choice) are added as argument of eficonfig_process_common(). The menu description string displayed at the bottom of the menu is also added as argument. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
32bab0ea |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Make use of CLI character processing Avoid duplicating some of the escape-sequence processing here and use the CLI function instead. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
d0ca98db |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Update bootmenu_loop() to return the code Use the return value to save having to pass around a pointer. This also resolves any ambiguity about what *key contains when the function is called. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
2da4a15e |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Rename KEY_... to BKEY_... This enum values conflict with linux/input.h so rename them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
64550274 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: avoid SetVariable between GetNextVariableName calls The current code calls efi_set_variable_int() to delete the invalid boot option between calls to efi_get_next_variable_name_int(), it may produce unpredictable results. This commit moves removal of the invalid boot option outside of the efi_get_next_variable_name_int() calls. EFI_NOT_FOUND returned from efi_get_next_variable_name_int() indicates we retrieved all EFI variables, it should be treated as EFI_SUCEESS. To address the checkpatch warning of too many leading tabs, combine two if statement into one. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
ce327084 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: carve out efi_get_next_variable_name_int calls To retrieve the EFI variable name by efi_get_next_variable_name_int(), the sequence of alloc -> efi_get_next_variable_name_int -> realloc -> efi_get_next_variable_name_int is required. In current code, this sequence repeatedly appears in the several functions. It should be curved out a common function. This commit also fixes the missing free() of var_name16 in eficonfig_delete_invalid_boot_option(). Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
140a8959 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use efi_get_next_variable_name_int() eficonfig command reads all possible UEFI load options from 0x0000 to 0xFFFF to construct the menu. This takes too much time in some environment. This commit uses efi_get_next_variable_name_int() to read all existing UEFI load options to significantlly reduce the count of efi_get_var() call. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
78b1ccc4 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use u16_strsize() to get u16 string buffer size Use u16_strsize() to simplify the u16 string buffer size calculation. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c67d3c9e |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix going one directory up issue The directory name in eficonfig menu entry contains the '\' separator. strcmp() argument ".." is wrong and one directory up handling does not work correctly. strcmp() argument must include '\' separator. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c3b5af63 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add UEFI Secure Boot Key enrollment interface This commit adds the menu-driven UEFI Secure Boot Key enrollment interface. User can enroll PK, KEK, db and dbx by selecting file. Only the signed EFI Signature List(s) with an authenticated header, typically '.auth' file, is accepted. To clear the PK, KEK, db and dbx, user needs to enroll the null key signed by PK or KEK. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
21faf4ef |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use protocol interface for file selection EFI_SIMPLE_FILE_SYSTEM_PROTOCOL is not always provided by U-Boot. Use protocol interface functions instead of U-Boot internal functions. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d6566113 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose eficonfig_create_device_path() Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use eficonfig_create_device_path() to construct the full device path from device path of the volume and file path, so move it out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d571f9b2 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation All the eficonfig menus other than "Change Boot Order" use 'eficonfig_entry' structure for each menu entry. This commit refactors change boot order implementation to use 'eficonfig_entry' structure same as other menus to have consistent menu handling. This commit also simplifies the data->active handling when KEY_SPACE is pressed, and sizeof() parameter. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
8961e93e |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose append entry function Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use append_entry() and append_quit_entry() to construct the menu, so move them out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
a84040ab |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor file selection handling eficonfig_select_file_handler() is commonly used to select the file. eficonfig_display_select_file_option() adds an additional menu to clear the selected file. eficonfig_display_select_file_option() is not always necessary for the file selection process, so it must be outside of eficonfig_select_file_handler(). This commit also renames the following functions to avoid confusion. eficonfig_select_file_handler() -> eficonfig_process_select_file() eficonfig_select_file() -> eficonfig_show_file_selection() eficonfig_display_select_file_option() -> eficonfig_process_show_file_option() Finally, test_eficonfig.py need to be updated to get aligned with the above modification. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
1167e88a |
|
14-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix missing variable initialization The 'ret' variable must be initialized before use in eficonfig_delete_invalid_boot_option(). Fixes: c416f1c0bc ("bootmenu: add removable media entries") Addresses-Coverity: 376207 ("Uninitialized variables") Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
3d595ac5 |
|
09-Nov-2022 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: remove superfluous if in eficonfig_edit_boot_option Goto for an immediately succeeding label is superfluous. Fixes: 87d791423ac6 ("eficonfig: menu-driven addition of UEFI boot option") Addresses-Coverity: 376202 ("Identical code for different branches") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
2c0b0c31 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_SECURE_BOOT This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_SECURE_BOOT defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
83f3d121 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_MM_COMM_TEE This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_MM_COMM_TEE defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
88df3634 |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: CTRL+S to save the boot order 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>
|
#
45f5319f |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
menu: remove CTRL+C to quit On the sandbox called without "--terminal raw" CTRL+C leaves U-Boot, "ESC/CTRL+C to quit" is misleading. Let's remove CTRL+C to quit key handling from bootmenu and eficonfig menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
|
#
8dbd0a0f |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add vertical scroll support The current eficonfig menu does not support vertical scroll, so it can not display the menu entries greater than the console row size. This commit add the vertial scroll support. The console size is retrieved by SIMPLE_TEXT_OUTPUT_PROTOCOL.QueryMode() service, then calculates the row size for menu entry by subtracting menu header and description row size from the console row size. "start" and "end" are added in the efimenu structure. "start" keeps the menu entry index at the top, "end" keeps the bottom menu entry index. item_data_print() menu function only draws the menu entry between "start" and "end". This commit also fixes the issue that "Save" and "Quit" entries can be moved by BKEY_PLUS in change boot order menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
0d590852 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation This commit removes the change boot order specific menu implementation. The change boot order implementation calls eficonfig_process_common() same as other menus. The change boot order menu requires own item_data_print and item_choice implementation, but display_statusline function can be a same function as other menus. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
cd160b27 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor eficonfig_process_common function Current change boot order implementation does not call eficonfig_process_common() and call own menu functions for display_statusline, item_data_print and item_choice. Change boot order functionality should call eficonfig_process_common() to improve maintenanceability. This commit is a preparation to remove the change boot order specific implementation. The menu functions (display_statusline, item_data_print and item_choice) are added as argument of eficonfig_process_common(). The menu description string displayed at the bottom of the menu is also added as argument. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
32bab0ea |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Make use of CLI character processing Avoid duplicating some of the escape-sequence processing here and use the CLI function instead. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
d0ca98db |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Update bootmenu_loop() to return the code Use the return value to save having to pass around a pointer. This also resolves any ambiguity about what *key contains when the function is called. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
2da4a15e |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Rename KEY_... to BKEY_... This enum values conflict with linux/input.h so rename them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
64550274 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: avoid SetVariable between GetNextVariableName calls The current code calls efi_set_variable_int() to delete the invalid boot option between calls to efi_get_next_variable_name_int(), it may produce unpredictable results. This commit moves removal of the invalid boot option outside of the efi_get_next_variable_name_int() calls. EFI_NOT_FOUND returned from efi_get_next_variable_name_int() indicates we retrieved all EFI variables, it should be treated as EFI_SUCEESS. To address the checkpatch warning of too many leading tabs, combine two if statement into one. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
ce327084 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: carve out efi_get_next_variable_name_int calls To retrieve the EFI variable name by efi_get_next_variable_name_int(), the sequence of alloc -> efi_get_next_variable_name_int -> realloc -> efi_get_next_variable_name_int is required. In current code, this sequence repeatedly appears in the several functions. It should be curved out a common function. This commit also fixes the missing free() of var_name16 in eficonfig_delete_invalid_boot_option(). Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
140a8959 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use efi_get_next_variable_name_int() eficonfig command reads all possible UEFI load options from 0x0000 to 0xFFFF to construct the menu. This takes too much time in some environment. This commit uses efi_get_next_variable_name_int() to read all existing UEFI load options to significantlly reduce the count of efi_get_var() call. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
78b1ccc4 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use u16_strsize() to get u16 string buffer size Use u16_strsize() to simplify the u16 string buffer size calculation. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c67d3c9e |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix going one directory up issue The directory name in eficonfig menu entry contains the '\' separator. strcmp() argument ".." is wrong and one directory up handling does not work correctly. strcmp() argument must include '\' separator. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c3b5af63 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add UEFI Secure Boot Key enrollment interface This commit adds the menu-driven UEFI Secure Boot Key enrollment interface. User can enroll PK, KEK, db and dbx by selecting file. Only the signed EFI Signature List(s) with an authenticated header, typically '.auth' file, is accepted. To clear the PK, KEK, db and dbx, user needs to enroll the null key signed by PK or KEK. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
21faf4ef |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use protocol interface for file selection EFI_SIMPLE_FILE_SYSTEM_PROTOCOL is not always provided by U-Boot. Use protocol interface functions instead of U-Boot internal functions. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d6566113 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose eficonfig_create_device_path() Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use eficonfig_create_device_path() to construct the full device path from device path of the volume and file path, so move it out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d571f9b2 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation All the eficonfig menus other than "Change Boot Order" use 'eficonfig_entry' structure for each menu entry. This commit refactors change boot order implementation to use 'eficonfig_entry' structure same as other menus to have consistent menu handling. This commit also simplifies the data->active handling when KEY_SPACE is pressed, and sizeof() parameter. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
8961e93e |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose append entry function Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use append_entry() and append_quit_entry() to construct the menu, so move them out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
a84040ab |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor file selection handling eficonfig_select_file_handler() is commonly used to select the file. eficonfig_display_select_file_option() adds an additional menu to clear the selected file. eficonfig_display_select_file_option() is not always necessary for the file selection process, so it must be outside of eficonfig_select_file_handler(). This commit also renames the following functions to avoid confusion. eficonfig_select_file_handler() -> eficonfig_process_select_file() eficonfig_select_file() -> eficonfig_show_file_selection() eficonfig_display_select_file_option() -> eficonfig_process_show_file_option() Finally, test_eficonfig.py need to be updated to get aligned with the above modification. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
1167e88a |
|
14-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix missing variable initialization The 'ret' variable must be initialized before use in eficonfig_delete_invalid_boot_option(). Fixes: c416f1c0bc ("bootmenu: add removable media entries") Addresses-Coverity: 376207 ("Uninitialized variables") Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
3d595ac5 |
|
09-Nov-2022 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: remove superfluous if in eficonfig_edit_boot_option Goto for an immediately succeeding label is superfluous. Fixes: 87d791423ac6 ("eficonfig: menu-driven addition of UEFI boot option") Addresses-Coverity: 376202 ("Identical code for different branches") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
2c0b0c31 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_SECURE_BOOT This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_SECURE_BOOT defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
83f3d121 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_MM_COMM_TEE This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_MM_COMM_TEE defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
88df3634 |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: CTRL+S to save the boot order 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>
|
#
45f5319f |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
menu: remove CTRL+C to quit On the sandbox called without "--terminal raw" CTRL+C leaves U-Boot, "ESC/CTRL+C to quit" is misleading. Let's remove CTRL+C to quit key handling from bootmenu and eficonfig menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
|
#
8dbd0a0f |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add vertical scroll support The current eficonfig menu does not support vertical scroll, so it can not display the menu entries greater than the console row size. This commit add the vertial scroll support. The console size is retrieved by SIMPLE_TEXT_OUTPUT_PROTOCOL.QueryMode() service, then calculates the row size for menu entry by subtracting menu header and description row size from the console row size. "start" and "end" are added in the efimenu structure. "start" keeps the menu entry index at the top, "end" keeps the bottom menu entry index. item_data_print() menu function only draws the menu entry between "start" and "end". This commit also fixes the issue that "Save" and "Quit" entries can be moved by BKEY_PLUS in change boot order menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
0d590852 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation This commit removes the change boot order specific menu implementation. The change boot order implementation calls eficonfig_process_common() same as other menus. The change boot order menu requires own item_data_print and item_choice implementation, but display_statusline function can be a same function as other menus. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
cd160b27 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor eficonfig_process_common function Current change boot order implementation does not call eficonfig_process_common() and call own menu functions for display_statusline, item_data_print and item_choice. Change boot order functionality should call eficonfig_process_common() to improve maintenanceability. This commit is a preparation to remove the change boot order specific implementation. The menu functions (display_statusline, item_data_print and item_choice) are added as argument of eficonfig_process_common(). The menu description string displayed at the bottom of the menu is also added as argument. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
32bab0ea |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Make use of CLI character processing Avoid duplicating some of the escape-sequence processing here and use the CLI function instead. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
d0ca98db |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Update bootmenu_loop() to return the code Use the return value to save having to pass around a pointer. This also resolves any ambiguity about what *key contains when the function is called. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
2da4a15e |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Rename KEY_... to BKEY_... This enum values conflict with linux/input.h so rename them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
64550274 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: avoid SetVariable between GetNextVariableName calls The current code calls efi_set_variable_int() to delete the invalid boot option between calls to efi_get_next_variable_name_int(), it may produce unpredictable results. This commit moves removal of the invalid boot option outside of the efi_get_next_variable_name_int() calls. EFI_NOT_FOUND returned from efi_get_next_variable_name_int() indicates we retrieved all EFI variables, it should be treated as EFI_SUCEESS. To address the checkpatch warning of too many leading tabs, combine two if statement into one. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
ce327084 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: carve out efi_get_next_variable_name_int calls To retrieve the EFI variable name by efi_get_next_variable_name_int(), the sequence of alloc -> efi_get_next_variable_name_int -> realloc -> efi_get_next_variable_name_int is required. In current code, this sequence repeatedly appears in the several functions. It should be curved out a common function. This commit also fixes the missing free() of var_name16 in eficonfig_delete_invalid_boot_option(). Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
140a8959 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use efi_get_next_variable_name_int() eficonfig command reads all possible UEFI load options from 0x0000 to 0xFFFF to construct the menu. This takes too much time in some environment. This commit uses efi_get_next_variable_name_int() to read all existing UEFI load options to significantlly reduce the count of efi_get_var() call. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
78b1ccc4 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use u16_strsize() to get u16 string buffer size Use u16_strsize() to simplify the u16 string buffer size calculation. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c67d3c9e |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix going one directory up issue The directory name in eficonfig menu entry contains the '\' separator. strcmp() argument ".." is wrong and one directory up handling does not work correctly. strcmp() argument must include '\' separator. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c3b5af63 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add UEFI Secure Boot Key enrollment interface This commit adds the menu-driven UEFI Secure Boot Key enrollment interface. User can enroll PK, KEK, db and dbx by selecting file. Only the signed EFI Signature List(s) with an authenticated header, typically '.auth' file, is accepted. To clear the PK, KEK, db and dbx, user needs to enroll the null key signed by PK or KEK. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
21faf4ef |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use protocol interface for file selection EFI_SIMPLE_FILE_SYSTEM_PROTOCOL is not always provided by U-Boot. Use protocol interface functions instead of U-Boot internal functions. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d6566113 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose eficonfig_create_device_path() Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use eficonfig_create_device_path() to construct the full device path from device path of the volume and file path, so move it out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d571f9b2 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation All the eficonfig menus other than "Change Boot Order" use 'eficonfig_entry' structure for each menu entry. This commit refactors change boot order implementation to use 'eficonfig_entry' structure same as other menus to have consistent menu handling. This commit also simplifies the data->active handling when KEY_SPACE is pressed, and sizeof() parameter. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
8961e93e |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose append entry function Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use append_entry() and append_quit_entry() to construct the menu, so move them out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
a84040ab |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor file selection handling eficonfig_select_file_handler() is commonly used to select the file. eficonfig_display_select_file_option() adds an additional menu to clear the selected file. eficonfig_display_select_file_option() is not always necessary for the file selection process, so it must be outside of eficonfig_select_file_handler(). This commit also renames the following functions to avoid confusion. eficonfig_select_file_handler() -> eficonfig_process_select_file() eficonfig_select_file() -> eficonfig_show_file_selection() eficonfig_display_select_file_option() -> eficonfig_process_show_file_option() Finally, test_eficonfig.py need to be updated to get aligned with the above modification. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
1167e88a |
|
14-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix missing variable initialization The 'ret' variable must be initialized before use in eficonfig_delete_invalid_boot_option(). Fixes: c416f1c0bc ("bootmenu: add removable media entries") Addresses-Coverity: 376207 ("Uninitialized variables") Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
3d595ac5 |
|
09-Nov-2022 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: remove superfluous if in eficonfig_edit_boot_option Goto for an immediately succeeding label is superfluous. Fixes: 87d791423ac6 ("eficonfig: menu-driven addition of UEFI boot option") Addresses-Coverity: 376202 ("Identical code for different branches") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
2c0b0c31 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_SECURE_BOOT This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_SECURE_BOOT defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
83f3d121 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_MM_COMM_TEE This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_MM_COMM_TEE defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
88df3634 |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: CTRL+S to save the boot order 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>
|
#
45f5319f |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
menu: remove CTRL+C to quit On the sandbox called without "--terminal raw" CTRL+C leaves U-Boot, "ESC/CTRL+C to quit" is misleading. Let's remove CTRL+C to quit key handling from bootmenu and eficonfig menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
|
#
8dbd0a0f |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add vertical scroll support The current eficonfig menu does not support vertical scroll, so it can not display the menu entries greater than the console row size. This commit add the vertial scroll support. The console size is retrieved by SIMPLE_TEXT_OUTPUT_PROTOCOL.QueryMode() service, then calculates the row size for menu entry by subtracting menu header and description row size from the console row size. "start" and "end" are added in the efimenu structure. "start" keeps the menu entry index at the top, "end" keeps the bottom menu entry index. item_data_print() menu function only draws the menu entry between "start" and "end". This commit also fixes the issue that "Save" and "Quit" entries can be moved by BKEY_PLUS in change boot order menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
0d590852 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation This commit removes the change boot order specific menu implementation. The change boot order implementation calls eficonfig_process_common() same as other menus. The change boot order menu requires own item_data_print and item_choice implementation, but display_statusline function can be a same function as other menus. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
cd160b27 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor eficonfig_process_common function Current change boot order implementation does not call eficonfig_process_common() and call own menu functions for display_statusline, item_data_print and item_choice. Change boot order functionality should call eficonfig_process_common() to improve maintenanceability. This commit is a preparation to remove the change boot order specific implementation. The menu functions (display_statusline, item_data_print and item_choice) are added as argument of eficonfig_process_common(). The menu description string displayed at the bottom of the menu is also added as argument. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
32bab0ea |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Make use of CLI character processing Avoid duplicating some of the escape-sequence processing here and use the CLI function instead. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
d0ca98db |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Update bootmenu_loop() to return the code Use the return value to save having to pass around a pointer. This also resolves any ambiguity about what *key contains when the function is called. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
2da4a15e |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Rename KEY_... to BKEY_... This enum values conflict with linux/input.h so rename them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
64550274 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: avoid SetVariable between GetNextVariableName calls The current code calls efi_set_variable_int() to delete the invalid boot option between calls to efi_get_next_variable_name_int(), it may produce unpredictable results. This commit moves removal of the invalid boot option outside of the efi_get_next_variable_name_int() calls. EFI_NOT_FOUND returned from efi_get_next_variable_name_int() indicates we retrieved all EFI variables, it should be treated as EFI_SUCEESS. To address the checkpatch warning of too many leading tabs, combine two if statement into one. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
ce327084 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: carve out efi_get_next_variable_name_int calls To retrieve the EFI variable name by efi_get_next_variable_name_int(), the sequence of alloc -> efi_get_next_variable_name_int -> realloc -> efi_get_next_variable_name_int is required. In current code, this sequence repeatedly appears in the several functions. It should be curved out a common function. This commit also fixes the missing free() of var_name16 in eficonfig_delete_invalid_boot_option(). Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
140a8959 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use efi_get_next_variable_name_int() eficonfig command reads all possible UEFI load options from 0x0000 to 0xFFFF to construct the menu. This takes too much time in some environment. This commit uses efi_get_next_variable_name_int() to read all existing UEFI load options to significantlly reduce the count of efi_get_var() call. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
78b1ccc4 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use u16_strsize() to get u16 string buffer size Use u16_strsize() to simplify the u16 string buffer size calculation. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c67d3c9e |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix going one directory up issue The directory name in eficonfig menu entry contains the '\' separator. strcmp() argument ".." is wrong and one directory up handling does not work correctly. strcmp() argument must include '\' separator. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c3b5af63 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add UEFI Secure Boot Key enrollment interface This commit adds the menu-driven UEFI Secure Boot Key enrollment interface. User can enroll PK, KEK, db and dbx by selecting file. Only the signed EFI Signature List(s) with an authenticated header, typically '.auth' file, is accepted. To clear the PK, KEK, db and dbx, user needs to enroll the null key signed by PK or KEK. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
21faf4ef |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use protocol interface for file selection EFI_SIMPLE_FILE_SYSTEM_PROTOCOL is not always provided by U-Boot. Use protocol interface functions instead of U-Boot internal functions. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d6566113 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose eficonfig_create_device_path() Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use eficonfig_create_device_path() to construct the full device path from device path of the volume and file path, so move it out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d571f9b2 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation All the eficonfig menus other than "Change Boot Order" use 'eficonfig_entry' structure for each menu entry. This commit refactors change boot order implementation to use 'eficonfig_entry' structure same as other menus to have consistent menu handling. This commit also simplifies the data->active handling when KEY_SPACE is pressed, and sizeof() parameter. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
8961e93e |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose append entry function Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use append_entry() and append_quit_entry() to construct the menu, so move them out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
a84040ab |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor file selection handling eficonfig_select_file_handler() is commonly used to select the file. eficonfig_display_select_file_option() adds an additional menu to clear the selected file. eficonfig_display_select_file_option() is not always necessary for the file selection process, so it must be outside of eficonfig_select_file_handler(). This commit also renames the following functions to avoid confusion. eficonfig_select_file_handler() -> eficonfig_process_select_file() eficonfig_select_file() -> eficonfig_show_file_selection() eficonfig_display_select_file_option() -> eficonfig_process_show_file_option() Finally, test_eficonfig.py need to be updated to get aligned with the above modification. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
1167e88a |
|
14-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix missing variable initialization The 'ret' variable must be initialized before use in eficonfig_delete_invalid_boot_option(). Fixes: c416f1c0bc ("bootmenu: add removable media entries") Addresses-Coverity: 376207 ("Uninitialized variables") Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
3d595ac5 |
|
09-Nov-2022 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: remove superfluous if in eficonfig_edit_boot_option Goto for an immediately succeeding label is superfluous. Fixes: 87d791423ac6 ("eficonfig: menu-driven addition of UEFI boot option") Addresses-Coverity: 376202 ("Identical code for different branches") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
2c0b0c31 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_SECURE_BOOT This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_SECURE_BOOT defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
83f3d121 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_MM_COMM_TEE This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_MM_COMM_TEE defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
88df3634 |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: CTRL+S to save the boot order 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>
|
#
45f5319f |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
menu: remove CTRL+C to quit On the sandbox called without "--terminal raw" CTRL+C leaves U-Boot, "ESC/CTRL+C to quit" is misleading. Let's remove CTRL+C to quit key handling from bootmenu and eficonfig menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
|
#
8dbd0a0f |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add vertical scroll support The current eficonfig menu does not support vertical scroll, so it can not display the menu entries greater than the console row size. This commit add the vertial scroll support. The console size is retrieved by SIMPLE_TEXT_OUTPUT_PROTOCOL.QueryMode() service, then calculates the row size for menu entry by subtracting menu header and description row size from the console row size. "start" and "end" are added in the efimenu structure. "start" keeps the menu entry index at the top, "end" keeps the bottom menu entry index. item_data_print() menu function only draws the menu entry between "start" and "end". This commit also fixes the issue that "Save" and "Quit" entries can be moved by BKEY_PLUS in change boot order menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
0d590852 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation This commit removes the change boot order specific menu implementation. The change boot order implementation calls eficonfig_process_common() same as other menus. The change boot order menu requires own item_data_print and item_choice implementation, but display_statusline function can be a same function as other menus. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
cd160b27 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor eficonfig_process_common function Current change boot order implementation does not call eficonfig_process_common() and call own menu functions for display_statusline, item_data_print and item_choice. Change boot order functionality should call eficonfig_process_common() to improve maintenanceability. This commit is a preparation to remove the change boot order specific implementation. The menu functions (display_statusline, item_data_print and item_choice) are added as argument of eficonfig_process_common(). The menu description string displayed at the bottom of the menu is also added as argument. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
32bab0ea |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Make use of CLI character processing Avoid duplicating some of the escape-sequence processing here and use the CLI function instead. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
d0ca98db |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Update bootmenu_loop() to return the code Use the return value to save having to pass around a pointer. This also resolves any ambiguity about what *key contains when the function is called. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
2da4a15e |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Rename KEY_... to BKEY_... This enum values conflict with linux/input.h so rename them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
64550274 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: avoid SetVariable between GetNextVariableName calls The current code calls efi_set_variable_int() to delete the invalid boot option between calls to efi_get_next_variable_name_int(), it may produce unpredictable results. This commit moves removal of the invalid boot option outside of the efi_get_next_variable_name_int() calls. EFI_NOT_FOUND returned from efi_get_next_variable_name_int() indicates we retrieved all EFI variables, it should be treated as EFI_SUCEESS. To address the checkpatch warning of too many leading tabs, combine two if statement into one. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
ce327084 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: carve out efi_get_next_variable_name_int calls To retrieve the EFI variable name by efi_get_next_variable_name_int(), the sequence of alloc -> efi_get_next_variable_name_int -> realloc -> efi_get_next_variable_name_int is required. In current code, this sequence repeatedly appears in the several functions. It should be curved out a common function. This commit also fixes the missing free() of var_name16 in eficonfig_delete_invalid_boot_option(). Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
140a8959 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use efi_get_next_variable_name_int() eficonfig command reads all possible UEFI load options from 0x0000 to 0xFFFF to construct the menu. This takes too much time in some environment. This commit uses efi_get_next_variable_name_int() to read all existing UEFI load options to significantlly reduce the count of efi_get_var() call. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
78b1ccc4 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use u16_strsize() to get u16 string buffer size Use u16_strsize() to simplify the u16 string buffer size calculation. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c67d3c9e |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix going one directory up issue The directory name in eficonfig menu entry contains the '\' separator. strcmp() argument ".." is wrong and one directory up handling does not work correctly. strcmp() argument must include '\' separator. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c3b5af63 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add UEFI Secure Boot Key enrollment interface This commit adds the menu-driven UEFI Secure Boot Key enrollment interface. User can enroll PK, KEK, db and dbx by selecting file. Only the signed EFI Signature List(s) with an authenticated header, typically '.auth' file, is accepted. To clear the PK, KEK, db and dbx, user needs to enroll the null key signed by PK or KEK. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
21faf4ef |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use protocol interface for file selection EFI_SIMPLE_FILE_SYSTEM_PROTOCOL is not always provided by U-Boot. Use protocol interface functions instead of U-Boot internal functions. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d6566113 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose eficonfig_create_device_path() Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use eficonfig_create_device_path() to construct the full device path from device path of the volume and file path, so move it out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d571f9b2 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation All the eficonfig menus other than "Change Boot Order" use 'eficonfig_entry' structure for each menu entry. This commit refactors change boot order implementation to use 'eficonfig_entry' structure same as other menus to have consistent menu handling. This commit also simplifies the data->active handling when KEY_SPACE is pressed, and sizeof() parameter. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
8961e93e |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose append entry function Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use append_entry() and append_quit_entry() to construct the menu, so move them out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
a84040ab |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor file selection handling eficonfig_select_file_handler() is commonly used to select the file. eficonfig_display_select_file_option() adds an additional menu to clear the selected file. eficonfig_display_select_file_option() is not always necessary for the file selection process, so it must be outside of eficonfig_select_file_handler(). This commit also renames the following functions to avoid confusion. eficonfig_select_file_handler() -> eficonfig_process_select_file() eficonfig_select_file() -> eficonfig_show_file_selection() eficonfig_display_select_file_option() -> eficonfig_process_show_file_option() Finally, test_eficonfig.py need to be updated to get aligned with the above modification. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
1167e88a |
|
14-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix missing variable initialization The 'ret' variable must be initialized before use in eficonfig_delete_invalid_boot_option(). Fixes: c416f1c0bc ("bootmenu: add removable media entries") Addresses-Coverity: 376207 ("Uninitialized variables") Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
3d595ac5 |
|
09-Nov-2022 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: remove superfluous if in eficonfig_edit_boot_option Goto for an immediately succeeding label is superfluous. Fixes: 87d791423ac6 ("eficonfig: menu-driven addition of UEFI boot option") Addresses-Coverity: 376202 ("Identical code for different branches") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
2c0b0c31 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_SECURE_BOOT This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_SECURE_BOOT defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
83f3d121 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_MM_COMM_TEE This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_MM_COMM_TEE defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
88df3634 |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: CTRL+S to save the boot order 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>
|
#
45f5319f |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
menu: remove CTRL+C to quit On the sandbox called without "--terminal raw" CTRL+C leaves U-Boot, "ESC/CTRL+C to quit" is misleading. Let's remove CTRL+C to quit key handling from bootmenu and eficonfig menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
|
#
8dbd0a0f |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add vertical scroll support The current eficonfig menu does not support vertical scroll, so it can not display the menu entries greater than the console row size. This commit add the vertial scroll support. The console size is retrieved by SIMPLE_TEXT_OUTPUT_PROTOCOL.QueryMode() service, then calculates the row size for menu entry by subtracting menu header and description row size from the console row size. "start" and "end" are added in the efimenu structure. "start" keeps the menu entry index at the top, "end" keeps the bottom menu entry index. item_data_print() menu function only draws the menu entry between "start" and "end". This commit also fixes the issue that "Save" and "Quit" entries can be moved by BKEY_PLUS in change boot order menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
0d590852 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation This commit removes the change boot order specific menu implementation. The change boot order implementation calls eficonfig_process_common() same as other menus. The change boot order menu requires own item_data_print and item_choice implementation, but display_statusline function can be a same function as other menus. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
cd160b27 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor eficonfig_process_common function Current change boot order implementation does not call eficonfig_process_common() and call own menu functions for display_statusline, item_data_print and item_choice. Change boot order functionality should call eficonfig_process_common() to improve maintenanceability. This commit is a preparation to remove the change boot order specific implementation. The menu functions (display_statusline, item_data_print and item_choice) are added as argument of eficonfig_process_common(). The menu description string displayed at the bottom of the menu is also added as argument. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
32bab0ea |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Make use of CLI character processing Avoid duplicating some of the escape-sequence processing here and use the CLI function instead. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
d0ca98db |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Update bootmenu_loop() to return the code Use the return value to save having to pass around a pointer. This also resolves any ambiguity about what *key contains when the function is called. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
2da4a15e |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Rename KEY_... to BKEY_... This enum values conflict with linux/input.h so rename them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
64550274 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: avoid SetVariable between GetNextVariableName calls The current code calls efi_set_variable_int() to delete the invalid boot option between calls to efi_get_next_variable_name_int(), it may produce unpredictable results. This commit moves removal of the invalid boot option outside of the efi_get_next_variable_name_int() calls. EFI_NOT_FOUND returned from efi_get_next_variable_name_int() indicates we retrieved all EFI variables, it should be treated as EFI_SUCEESS. To address the checkpatch warning of too many leading tabs, combine two if statement into one. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
ce327084 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: carve out efi_get_next_variable_name_int calls To retrieve the EFI variable name by efi_get_next_variable_name_int(), the sequence of alloc -> efi_get_next_variable_name_int -> realloc -> efi_get_next_variable_name_int is required. In current code, this sequence repeatedly appears in the several functions. It should be curved out a common function. This commit also fixes the missing free() of var_name16 in eficonfig_delete_invalid_boot_option(). Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
140a8959 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use efi_get_next_variable_name_int() eficonfig command reads all possible UEFI load options from 0x0000 to 0xFFFF to construct the menu. This takes too much time in some environment. This commit uses efi_get_next_variable_name_int() to read all existing UEFI load options to significantlly reduce the count of efi_get_var() call. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
78b1ccc4 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use u16_strsize() to get u16 string buffer size Use u16_strsize() to simplify the u16 string buffer size calculation. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c67d3c9e |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix going one directory up issue The directory name in eficonfig menu entry contains the '\' separator. strcmp() argument ".." is wrong and one directory up handling does not work correctly. strcmp() argument must include '\' separator. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c3b5af63 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add UEFI Secure Boot Key enrollment interface This commit adds the menu-driven UEFI Secure Boot Key enrollment interface. User can enroll PK, KEK, db and dbx by selecting file. Only the signed EFI Signature List(s) with an authenticated header, typically '.auth' file, is accepted. To clear the PK, KEK, db and dbx, user needs to enroll the null key signed by PK or KEK. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
21faf4ef |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use protocol interface for file selection EFI_SIMPLE_FILE_SYSTEM_PROTOCOL is not always provided by U-Boot. Use protocol interface functions instead of U-Boot internal functions. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d6566113 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose eficonfig_create_device_path() Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use eficonfig_create_device_path() to construct the full device path from device path of the volume and file path, so move it out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d571f9b2 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation All the eficonfig menus other than "Change Boot Order" use 'eficonfig_entry' structure for each menu entry. This commit refactors change boot order implementation to use 'eficonfig_entry' structure same as other menus to have consistent menu handling. This commit also simplifies the data->active handling when KEY_SPACE is pressed, and sizeof() parameter. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
8961e93e |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose append entry function Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use append_entry() and append_quit_entry() to construct the menu, so move them out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
a84040ab |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor file selection handling eficonfig_select_file_handler() is commonly used to select the file. eficonfig_display_select_file_option() adds an additional menu to clear the selected file. eficonfig_display_select_file_option() is not always necessary for the file selection process, so it must be outside of eficonfig_select_file_handler(). This commit also renames the following functions to avoid confusion. eficonfig_select_file_handler() -> eficonfig_process_select_file() eficonfig_select_file() -> eficonfig_show_file_selection() eficonfig_display_select_file_option() -> eficonfig_process_show_file_option() Finally, test_eficonfig.py need to be updated to get aligned with the above modification. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
1167e88a |
|
14-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix missing variable initialization The 'ret' variable must be initialized before use in eficonfig_delete_invalid_boot_option(). Fixes: c416f1c0bc ("bootmenu: add removable media entries") Addresses-Coverity: 376207 ("Uninitialized variables") Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
3d595ac5 |
|
09-Nov-2022 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: remove superfluous if in eficonfig_edit_boot_option Goto for an immediately succeeding label is superfluous. Fixes: 87d791423ac6 ("eficonfig: menu-driven addition of UEFI boot option") Addresses-Coverity: 376202 ("Identical code for different branches") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
2c0b0c31 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_SECURE_BOOT This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_SECURE_BOOT defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
83f3d121 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_MM_COMM_TEE This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_MM_COMM_TEE defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
88df3634 |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: CTRL+S to save the boot order 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>
|
#
45f5319f |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
menu: remove CTRL+C to quit On the sandbox called without "--terminal raw" CTRL+C leaves U-Boot, "ESC/CTRL+C to quit" is misleading. Let's remove CTRL+C to quit key handling from bootmenu and eficonfig menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
|
#
8dbd0a0f |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add vertical scroll support The current eficonfig menu does not support vertical scroll, so it can not display the menu entries greater than the console row size. This commit add the vertial scroll support. The console size is retrieved by SIMPLE_TEXT_OUTPUT_PROTOCOL.QueryMode() service, then calculates the row size for menu entry by subtracting menu header and description row size from the console row size. "start" and "end" are added in the efimenu structure. "start" keeps the menu entry index at the top, "end" keeps the bottom menu entry index. item_data_print() menu function only draws the menu entry between "start" and "end". This commit also fixes the issue that "Save" and "Quit" entries can be moved by BKEY_PLUS in change boot order menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
0d590852 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation This commit removes the change boot order specific menu implementation. The change boot order implementation calls eficonfig_process_common() same as other menus. The change boot order menu requires own item_data_print and item_choice implementation, but display_statusline function can be a same function as other menus. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
cd160b27 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor eficonfig_process_common function Current change boot order implementation does not call eficonfig_process_common() and call own menu functions for display_statusline, item_data_print and item_choice. Change boot order functionality should call eficonfig_process_common() to improve maintenanceability. This commit is a preparation to remove the change boot order specific implementation. The menu functions (display_statusline, item_data_print and item_choice) are added as argument of eficonfig_process_common(). The menu description string displayed at the bottom of the menu is also added as argument. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
32bab0ea |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Make use of CLI character processing Avoid duplicating some of the escape-sequence processing here and use the CLI function instead. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
d0ca98db |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Update bootmenu_loop() to return the code Use the return value to save having to pass around a pointer. This also resolves any ambiguity about what *key contains when the function is called. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
2da4a15e |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Rename KEY_... to BKEY_... This enum values conflict with linux/input.h so rename them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
64550274 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: avoid SetVariable between GetNextVariableName calls The current code calls efi_set_variable_int() to delete the invalid boot option between calls to efi_get_next_variable_name_int(), it may produce unpredictable results. This commit moves removal of the invalid boot option outside of the efi_get_next_variable_name_int() calls. EFI_NOT_FOUND returned from efi_get_next_variable_name_int() indicates we retrieved all EFI variables, it should be treated as EFI_SUCEESS. To address the checkpatch warning of too many leading tabs, combine two if statement into one. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
ce327084 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: carve out efi_get_next_variable_name_int calls To retrieve the EFI variable name by efi_get_next_variable_name_int(), the sequence of alloc -> efi_get_next_variable_name_int -> realloc -> efi_get_next_variable_name_int is required. In current code, this sequence repeatedly appears in the several functions. It should be curved out a common function. This commit also fixes the missing free() of var_name16 in eficonfig_delete_invalid_boot_option(). Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
140a8959 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use efi_get_next_variable_name_int() eficonfig command reads all possible UEFI load options from 0x0000 to 0xFFFF to construct the menu. This takes too much time in some environment. This commit uses efi_get_next_variable_name_int() to read all existing UEFI load options to significantlly reduce the count of efi_get_var() call. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
78b1ccc4 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use u16_strsize() to get u16 string buffer size Use u16_strsize() to simplify the u16 string buffer size calculation. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c67d3c9e |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix going one directory up issue The directory name in eficonfig menu entry contains the '\' separator. strcmp() argument ".." is wrong and one directory up handling does not work correctly. strcmp() argument must include '\' separator. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c3b5af63 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add UEFI Secure Boot Key enrollment interface This commit adds the menu-driven UEFI Secure Boot Key enrollment interface. User can enroll PK, KEK, db and dbx by selecting file. Only the signed EFI Signature List(s) with an authenticated header, typically '.auth' file, is accepted. To clear the PK, KEK, db and dbx, user needs to enroll the null key signed by PK or KEK. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
21faf4ef |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use protocol interface for file selection EFI_SIMPLE_FILE_SYSTEM_PROTOCOL is not always provided by U-Boot. Use protocol interface functions instead of U-Boot internal functions. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d6566113 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose eficonfig_create_device_path() Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use eficonfig_create_device_path() to construct the full device path from device path of the volume and file path, so move it out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d571f9b2 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation All the eficonfig menus other than "Change Boot Order" use 'eficonfig_entry' structure for each menu entry. This commit refactors change boot order implementation to use 'eficonfig_entry' structure same as other menus to have consistent menu handling. This commit also simplifies the data->active handling when KEY_SPACE is pressed, and sizeof() parameter. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
8961e93e |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose append entry function Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use append_entry() and append_quit_entry() to construct the menu, so move them out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
a84040ab |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor file selection handling eficonfig_select_file_handler() is commonly used to select the file. eficonfig_display_select_file_option() adds an additional menu to clear the selected file. eficonfig_display_select_file_option() is not always necessary for the file selection process, so it must be outside of eficonfig_select_file_handler(). This commit also renames the following functions to avoid confusion. eficonfig_select_file_handler() -> eficonfig_process_select_file() eficonfig_select_file() -> eficonfig_show_file_selection() eficonfig_display_select_file_option() -> eficonfig_process_show_file_option() Finally, test_eficonfig.py need to be updated to get aligned with the above modification. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
1167e88a |
|
14-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix missing variable initialization The 'ret' variable must be initialized before use in eficonfig_delete_invalid_boot_option(). Fixes: c416f1c0bc ("bootmenu: add removable media entries") Addresses-Coverity: 376207 ("Uninitialized variables") Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
3d595ac5 |
|
09-Nov-2022 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: remove superfluous if in eficonfig_edit_boot_option Goto for an immediately succeeding label is superfluous. Fixes: 87d791423ac6 ("eficonfig: menu-driven addition of UEFI boot option") Addresses-Coverity: 376202 ("Identical code for different branches") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
2c0b0c31 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_SECURE_BOOT This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_SECURE_BOOT defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
83f3d121 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_MM_COMM_TEE This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_MM_COMM_TEE defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
88df3634 |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: CTRL+S to save the boot order 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>
|
#
45f5319f |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
menu: remove CTRL+C to quit On the sandbox called without "--terminal raw" CTRL+C leaves U-Boot, "ESC/CTRL+C to quit" is misleading. Let's remove CTRL+C to quit key handling from bootmenu and eficonfig menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
|
#
8dbd0a0f |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add vertical scroll support The current eficonfig menu does not support vertical scroll, so it can not display the menu entries greater than the console row size. This commit add the vertial scroll support. The console size is retrieved by SIMPLE_TEXT_OUTPUT_PROTOCOL.QueryMode() service, then calculates the row size for menu entry by subtracting menu header and description row size from the console row size. "start" and "end" are added in the efimenu structure. "start" keeps the menu entry index at the top, "end" keeps the bottom menu entry index. item_data_print() menu function only draws the menu entry between "start" and "end". This commit also fixes the issue that "Save" and "Quit" entries can be moved by BKEY_PLUS in change boot order menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
0d590852 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation This commit removes the change boot order specific menu implementation. The change boot order implementation calls eficonfig_process_common() same as other menus. The change boot order menu requires own item_data_print and item_choice implementation, but display_statusline function can be a same function as other menus. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
cd160b27 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor eficonfig_process_common function Current change boot order implementation does not call eficonfig_process_common() and call own menu functions for display_statusline, item_data_print and item_choice. Change boot order functionality should call eficonfig_process_common() to improve maintenanceability. This commit is a preparation to remove the change boot order specific implementation. The menu functions (display_statusline, item_data_print and item_choice) are added as argument of eficonfig_process_common(). The menu description string displayed at the bottom of the menu is also added as argument. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
32bab0ea |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Make use of CLI character processing Avoid duplicating some of the escape-sequence processing here and use the CLI function instead. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
d0ca98db |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Update bootmenu_loop() to return the code Use the return value to save having to pass around a pointer. This also resolves any ambiguity about what *key contains when the function is called. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
2da4a15e |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Rename KEY_... to BKEY_... This enum values conflict with linux/input.h so rename them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
64550274 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: avoid SetVariable between GetNextVariableName calls The current code calls efi_set_variable_int() to delete the invalid boot option between calls to efi_get_next_variable_name_int(), it may produce unpredictable results. This commit moves removal of the invalid boot option outside of the efi_get_next_variable_name_int() calls. EFI_NOT_FOUND returned from efi_get_next_variable_name_int() indicates we retrieved all EFI variables, it should be treated as EFI_SUCEESS. To address the checkpatch warning of too many leading tabs, combine two if statement into one. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
ce327084 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: carve out efi_get_next_variable_name_int calls To retrieve the EFI variable name by efi_get_next_variable_name_int(), the sequence of alloc -> efi_get_next_variable_name_int -> realloc -> efi_get_next_variable_name_int is required. In current code, this sequence repeatedly appears in the several functions. It should be curved out a common function. This commit also fixes the missing free() of var_name16 in eficonfig_delete_invalid_boot_option(). Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
140a8959 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use efi_get_next_variable_name_int() eficonfig command reads all possible UEFI load options from 0x0000 to 0xFFFF to construct the menu. This takes too much time in some environment. This commit uses efi_get_next_variable_name_int() to read all existing UEFI load options to significantlly reduce the count of efi_get_var() call. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
78b1ccc4 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use u16_strsize() to get u16 string buffer size Use u16_strsize() to simplify the u16 string buffer size calculation. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c67d3c9e |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix going one directory up issue The directory name in eficonfig menu entry contains the '\' separator. strcmp() argument ".." is wrong and one directory up handling does not work correctly. strcmp() argument must include '\' separator. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c3b5af63 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add UEFI Secure Boot Key enrollment interface This commit adds the menu-driven UEFI Secure Boot Key enrollment interface. User can enroll PK, KEK, db and dbx by selecting file. Only the signed EFI Signature List(s) with an authenticated header, typically '.auth' file, is accepted. To clear the PK, KEK, db and dbx, user needs to enroll the null key signed by PK or KEK. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
21faf4ef |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use protocol interface for file selection EFI_SIMPLE_FILE_SYSTEM_PROTOCOL is not always provided by U-Boot. Use protocol interface functions instead of U-Boot internal functions. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d6566113 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose eficonfig_create_device_path() Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use eficonfig_create_device_path() to construct the full device path from device path of the volume and file path, so move it out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d571f9b2 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation All the eficonfig menus other than "Change Boot Order" use 'eficonfig_entry' structure for each menu entry. This commit refactors change boot order implementation to use 'eficonfig_entry' structure same as other menus to have consistent menu handling. This commit also simplifies the data->active handling when KEY_SPACE is pressed, and sizeof() parameter. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
8961e93e |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose append entry function Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use append_entry() and append_quit_entry() to construct the menu, so move them out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
a84040ab |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor file selection handling eficonfig_select_file_handler() is commonly used to select the file. eficonfig_display_select_file_option() adds an additional menu to clear the selected file. eficonfig_display_select_file_option() is not always necessary for the file selection process, so it must be outside of eficonfig_select_file_handler(). This commit also renames the following functions to avoid confusion. eficonfig_select_file_handler() -> eficonfig_process_select_file() eficonfig_select_file() -> eficonfig_show_file_selection() eficonfig_display_select_file_option() -> eficonfig_process_show_file_option() Finally, test_eficonfig.py need to be updated to get aligned with the above modification. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
1167e88a |
|
14-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix missing variable initialization The 'ret' variable must be initialized before use in eficonfig_delete_invalid_boot_option(). Fixes: c416f1c0bc ("bootmenu: add removable media entries") Addresses-Coverity: 376207 ("Uninitialized variables") Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
3d595ac5 |
|
09-Nov-2022 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: remove superfluous if in eficonfig_edit_boot_option Goto for an immediately succeeding label is superfluous. Fixes: 87d791423ac6 ("eficonfig: menu-driven addition of UEFI boot option") Addresses-Coverity: 376202 ("Identical code for different branches") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
2c0b0c31 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_SECURE_BOOT This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_SECURE_BOOT defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
83f3d121 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_MM_COMM_TEE This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_MM_COMM_TEE defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
88df3634 |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: CTRL+S to save the boot order 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>
|
#
45f5319f |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
menu: remove CTRL+C to quit On the sandbox called without "--terminal raw" CTRL+C leaves U-Boot, "ESC/CTRL+C to quit" is misleading. Let's remove CTRL+C to quit key handling from bootmenu and eficonfig menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
|
#
8dbd0a0f |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add vertical scroll support The current eficonfig menu does not support vertical scroll, so it can not display the menu entries greater than the console row size. This commit add the vertial scroll support. The console size is retrieved by SIMPLE_TEXT_OUTPUT_PROTOCOL.QueryMode() service, then calculates the row size for menu entry by subtracting menu header and description row size from the console row size. "start" and "end" are added in the efimenu structure. "start" keeps the menu entry index at the top, "end" keeps the bottom menu entry index. item_data_print() menu function only draws the menu entry between "start" and "end". This commit also fixes the issue that "Save" and "Quit" entries can be moved by BKEY_PLUS in change boot order menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
0d590852 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation This commit removes the change boot order specific menu implementation. The change boot order implementation calls eficonfig_process_common() same as other menus. The change boot order menu requires own item_data_print and item_choice implementation, but display_statusline function can be a same function as other menus. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
cd160b27 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor eficonfig_process_common function Current change boot order implementation does not call eficonfig_process_common() and call own menu functions for display_statusline, item_data_print and item_choice. Change boot order functionality should call eficonfig_process_common() to improve maintenanceability. This commit is a preparation to remove the change boot order specific implementation. The menu functions (display_statusline, item_data_print and item_choice) are added as argument of eficonfig_process_common(). The menu description string displayed at the bottom of the menu is also added as argument. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
32bab0ea |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Make use of CLI character processing Avoid duplicating some of the escape-sequence processing here and use the CLI function instead. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
d0ca98db |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Update bootmenu_loop() to return the code Use the return value to save having to pass around a pointer. This also resolves any ambiguity about what *key contains when the function is called. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
2da4a15e |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Rename KEY_... to BKEY_... This enum values conflict with linux/input.h so rename them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
64550274 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: avoid SetVariable between GetNextVariableName calls The current code calls efi_set_variable_int() to delete the invalid boot option between calls to efi_get_next_variable_name_int(), it may produce unpredictable results. This commit moves removal of the invalid boot option outside of the efi_get_next_variable_name_int() calls. EFI_NOT_FOUND returned from efi_get_next_variable_name_int() indicates we retrieved all EFI variables, it should be treated as EFI_SUCEESS. To address the checkpatch warning of too many leading tabs, combine two if statement into one. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
ce327084 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: carve out efi_get_next_variable_name_int calls To retrieve the EFI variable name by efi_get_next_variable_name_int(), the sequence of alloc -> efi_get_next_variable_name_int -> realloc -> efi_get_next_variable_name_int is required. In current code, this sequence repeatedly appears in the several functions. It should be curved out a common function. This commit also fixes the missing free() of var_name16 in eficonfig_delete_invalid_boot_option(). Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
140a8959 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use efi_get_next_variable_name_int() eficonfig command reads all possible UEFI load options from 0x0000 to 0xFFFF to construct the menu. This takes too much time in some environment. This commit uses efi_get_next_variable_name_int() to read all existing UEFI load options to significantlly reduce the count of efi_get_var() call. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
78b1ccc4 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use u16_strsize() to get u16 string buffer size Use u16_strsize() to simplify the u16 string buffer size calculation. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c67d3c9e |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix going one directory up issue The directory name in eficonfig menu entry contains the '\' separator. strcmp() argument ".." is wrong and one directory up handling does not work correctly. strcmp() argument must include '\' separator. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c3b5af63 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add UEFI Secure Boot Key enrollment interface This commit adds the menu-driven UEFI Secure Boot Key enrollment interface. User can enroll PK, KEK, db and dbx by selecting file. Only the signed EFI Signature List(s) with an authenticated header, typically '.auth' file, is accepted. To clear the PK, KEK, db and dbx, user needs to enroll the null key signed by PK or KEK. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
21faf4ef |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use protocol interface for file selection EFI_SIMPLE_FILE_SYSTEM_PROTOCOL is not always provided by U-Boot. Use protocol interface functions instead of U-Boot internal functions. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d6566113 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose eficonfig_create_device_path() Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use eficonfig_create_device_path() to construct the full device path from device path of the volume and file path, so move it out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d571f9b2 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation All the eficonfig menus other than "Change Boot Order" use 'eficonfig_entry' structure for each menu entry. This commit refactors change boot order implementation to use 'eficonfig_entry' structure same as other menus to have consistent menu handling. This commit also simplifies the data->active handling when KEY_SPACE is pressed, and sizeof() parameter. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
8961e93e |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose append entry function Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use append_entry() and append_quit_entry() to construct the menu, so move them out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
a84040ab |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor file selection handling eficonfig_select_file_handler() is commonly used to select the file. eficonfig_display_select_file_option() adds an additional menu to clear the selected file. eficonfig_display_select_file_option() is not always necessary for the file selection process, so it must be outside of eficonfig_select_file_handler(). This commit also renames the following functions to avoid confusion. eficonfig_select_file_handler() -> eficonfig_process_select_file() eficonfig_select_file() -> eficonfig_show_file_selection() eficonfig_display_select_file_option() -> eficonfig_process_show_file_option() Finally, test_eficonfig.py need to be updated to get aligned with the above modification. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
1167e88a |
|
14-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix missing variable initialization The 'ret' variable must be initialized before use in eficonfig_delete_invalid_boot_option(). Fixes: c416f1c0bc ("bootmenu: add removable media entries") Addresses-Coverity: 376207 ("Uninitialized variables") Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
3d595ac5 |
|
09-Nov-2022 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: remove superfluous if in eficonfig_edit_boot_option Goto for an immediately succeeding label is superfluous. Fixes: 87d791423ac6 ("eficonfig: menu-driven addition of UEFI boot option") Addresses-Coverity: 376202 ("Identical code for different branches") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
2c0b0c31 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_SECURE_BOOT This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_SECURE_BOOT defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
83f3d121 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_MM_COMM_TEE This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_MM_COMM_TEE defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
88df3634 |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: CTRL+S to save the boot order 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>
|
#
45f5319f |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
menu: remove CTRL+C to quit On the sandbox called without "--terminal raw" CTRL+C leaves U-Boot, "ESC/CTRL+C to quit" is misleading. Let's remove CTRL+C to quit key handling from bootmenu and eficonfig menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
|
#
8dbd0a0f |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add vertical scroll support The current eficonfig menu does not support vertical scroll, so it can not display the menu entries greater than the console row size. This commit add the vertial scroll support. The console size is retrieved by SIMPLE_TEXT_OUTPUT_PROTOCOL.QueryMode() service, then calculates the row size for menu entry by subtracting menu header and description row size from the console row size. "start" and "end" are added in the efimenu structure. "start" keeps the menu entry index at the top, "end" keeps the bottom menu entry index. item_data_print() menu function only draws the menu entry between "start" and "end". This commit also fixes the issue that "Save" and "Quit" entries can be moved by BKEY_PLUS in change boot order menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
0d590852 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation This commit removes the change boot order specific menu implementation. The change boot order implementation calls eficonfig_process_common() same as other menus. The change boot order menu requires own item_data_print and item_choice implementation, but display_statusline function can be a same function as other menus. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
cd160b27 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor eficonfig_process_common function Current change boot order implementation does not call eficonfig_process_common() and call own menu functions for display_statusline, item_data_print and item_choice. Change boot order functionality should call eficonfig_process_common() to improve maintenanceability. This commit is a preparation to remove the change boot order specific implementation. The menu functions (display_statusline, item_data_print and item_choice) are added as argument of eficonfig_process_common(). The menu description string displayed at the bottom of the menu is also added as argument. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
32bab0ea |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Make use of CLI character processing Avoid duplicating some of the escape-sequence processing here and use the CLI function instead. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
d0ca98db |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Update bootmenu_loop() to return the code Use the return value to save having to pass around a pointer. This also resolves any ambiguity about what *key contains when the function is called. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
2da4a15e |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Rename KEY_... to BKEY_... This enum values conflict with linux/input.h so rename them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
64550274 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: avoid SetVariable between GetNextVariableName calls The current code calls efi_set_variable_int() to delete the invalid boot option between calls to efi_get_next_variable_name_int(), it may produce unpredictable results. This commit moves removal of the invalid boot option outside of the efi_get_next_variable_name_int() calls. EFI_NOT_FOUND returned from efi_get_next_variable_name_int() indicates we retrieved all EFI variables, it should be treated as EFI_SUCEESS. To address the checkpatch warning of too many leading tabs, combine two if statement into one. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
ce327084 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: carve out efi_get_next_variable_name_int calls To retrieve the EFI variable name by efi_get_next_variable_name_int(), the sequence of alloc -> efi_get_next_variable_name_int -> realloc -> efi_get_next_variable_name_int is required. In current code, this sequence repeatedly appears in the several functions. It should be curved out a common function. This commit also fixes the missing free() of var_name16 in eficonfig_delete_invalid_boot_option(). Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
140a8959 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use efi_get_next_variable_name_int() eficonfig command reads all possible UEFI load options from 0x0000 to 0xFFFF to construct the menu. This takes too much time in some environment. This commit uses efi_get_next_variable_name_int() to read all existing UEFI load options to significantlly reduce the count of efi_get_var() call. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
78b1ccc4 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use u16_strsize() to get u16 string buffer size Use u16_strsize() to simplify the u16 string buffer size calculation. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c67d3c9e |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix going one directory up issue The directory name in eficonfig menu entry contains the '\' separator. strcmp() argument ".." is wrong and one directory up handling does not work correctly. strcmp() argument must include '\' separator. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c3b5af63 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add UEFI Secure Boot Key enrollment interface This commit adds the menu-driven UEFI Secure Boot Key enrollment interface. User can enroll PK, KEK, db and dbx by selecting file. Only the signed EFI Signature List(s) with an authenticated header, typically '.auth' file, is accepted. To clear the PK, KEK, db and dbx, user needs to enroll the null key signed by PK or KEK. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
21faf4ef |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use protocol interface for file selection EFI_SIMPLE_FILE_SYSTEM_PROTOCOL is not always provided by U-Boot. Use protocol interface functions instead of U-Boot internal functions. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d6566113 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose eficonfig_create_device_path() Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use eficonfig_create_device_path() to construct the full device path from device path of the volume and file path, so move it out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d571f9b2 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation All the eficonfig menus other than "Change Boot Order" use 'eficonfig_entry' structure for each menu entry. This commit refactors change boot order implementation to use 'eficonfig_entry' structure same as other menus to have consistent menu handling. This commit also simplifies the data->active handling when KEY_SPACE is pressed, and sizeof() parameter. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
8961e93e |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose append entry function Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use append_entry() and append_quit_entry() to construct the menu, so move them out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
a84040ab |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor file selection handling eficonfig_select_file_handler() is commonly used to select the file. eficonfig_display_select_file_option() adds an additional menu to clear the selected file. eficonfig_display_select_file_option() is not always necessary for the file selection process, so it must be outside of eficonfig_select_file_handler(). This commit also renames the following functions to avoid confusion. eficonfig_select_file_handler() -> eficonfig_process_select_file() eficonfig_select_file() -> eficonfig_show_file_selection() eficonfig_display_select_file_option() -> eficonfig_process_show_file_option() Finally, test_eficonfig.py need to be updated to get aligned with the above modification. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
1167e88a |
|
14-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix missing variable initialization The 'ret' variable must be initialized before use in eficonfig_delete_invalid_boot_option(). Fixes: c416f1c0bc ("bootmenu: add removable media entries") Addresses-Coverity: 376207 ("Uninitialized variables") Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
3d595ac5 |
|
09-Nov-2022 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: remove superfluous if in eficonfig_edit_boot_option Goto for an immediately succeeding label is superfluous. Fixes: 87d791423ac6 ("eficonfig: menu-driven addition of UEFI boot option") Addresses-Coverity: 376202 ("Identical code for different branches") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
2c0b0c31 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_SECURE_BOOT This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_SECURE_BOOT defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
83f3d121 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_MM_COMM_TEE This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_MM_COMM_TEE defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
88df3634 |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: CTRL+S to save the boot order 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>
|
#
45f5319f |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
menu: remove CTRL+C to quit On the sandbox called without "--terminal raw" CTRL+C leaves U-Boot, "ESC/CTRL+C to quit" is misleading. Let's remove CTRL+C to quit key handling from bootmenu and eficonfig menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
|
#
8dbd0a0f |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add vertical scroll support The current eficonfig menu does not support vertical scroll, so it can not display the menu entries greater than the console row size. This commit add the vertial scroll support. The console size is retrieved by SIMPLE_TEXT_OUTPUT_PROTOCOL.QueryMode() service, then calculates the row size for menu entry by subtracting menu header and description row size from the console row size. "start" and "end" are added in the efimenu structure. "start" keeps the menu entry index at the top, "end" keeps the bottom menu entry index. item_data_print() menu function only draws the menu entry between "start" and "end". This commit also fixes the issue that "Save" and "Quit" entries can be moved by BKEY_PLUS in change boot order menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
0d590852 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation This commit removes the change boot order specific menu implementation. The change boot order implementation calls eficonfig_process_common() same as other menus. The change boot order menu requires own item_data_print and item_choice implementation, but display_statusline function can be a same function as other menus. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
cd160b27 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor eficonfig_process_common function Current change boot order implementation does not call eficonfig_process_common() and call own menu functions for display_statusline, item_data_print and item_choice. Change boot order functionality should call eficonfig_process_common() to improve maintenanceability. This commit is a preparation to remove the change boot order specific implementation. The menu functions (display_statusline, item_data_print and item_choice) are added as argument of eficonfig_process_common(). The menu description string displayed at the bottom of the menu is also added as argument. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
32bab0ea |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Make use of CLI character processing Avoid duplicating some of the escape-sequence processing here and use the CLI function instead. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
d0ca98db |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Update bootmenu_loop() to return the code Use the return value to save having to pass around a pointer. This also resolves any ambiguity about what *key contains when the function is called. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
2da4a15e |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Rename KEY_... to BKEY_... This enum values conflict with linux/input.h so rename them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
64550274 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: avoid SetVariable between GetNextVariableName calls The current code calls efi_set_variable_int() to delete the invalid boot option between calls to efi_get_next_variable_name_int(), it may produce unpredictable results. This commit moves removal of the invalid boot option outside of the efi_get_next_variable_name_int() calls. EFI_NOT_FOUND returned from efi_get_next_variable_name_int() indicates we retrieved all EFI variables, it should be treated as EFI_SUCEESS. To address the checkpatch warning of too many leading tabs, combine two if statement into one. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
ce327084 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: carve out efi_get_next_variable_name_int calls To retrieve the EFI variable name by efi_get_next_variable_name_int(), the sequence of alloc -> efi_get_next_variable_name_int -> realloc -> efi_get_next_variable_name_int is required. In current code, this sequence repeatedly appears in the several functions. It should be curved out a common function. This commit also fixes the missing free() of var_name16 in eficonfig_delete_invalid_boot_option(). Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
140a8959 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use efi_get_next_variable_name_int() eficonfig command reads all possible UEFI load options from 0x0000 to 0xFFFF to construct the menu. This takes too much time in some environment. This commit uses efi_get_next_variable_name_int() to read all existing UEFI load options to significantlly reduce the count of efi_get_var() call. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
78b1ccc4 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use u16_strsize() to get u16 string buffer size Use u16_strsize() to simplify the u16 string buffer size calculation. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c67d3c9e |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix going one directory up issue The directory name in eficonfig menu entry contains the '\' separator. strcmp() argument ".." is wrong and one directory up handling does not work correctly. strcmp() argument must include '\' separator. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c3b5af63 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add UEFI Secure Boot Key enrollment interface This commit adds the menu-driven UEFI Secure Boot Key enrollment interface. User can enroll PK, KEK, db and dbx by selecting file. Only the signed EFI Signature List(s) with an authenticated header, typically '.auth' file, is accepted. To clear the PK, KEK, db and dbx, user needs to enroll the null key signed by PK or KEK. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
21faf4ef |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use protocol interface for file selection EFI_SIMPLE_FILE_SYSTEM_PROTOCOL is not always provided by U-Boot. Use protocol interface functions instead of U-Boot internal functions. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d6566113 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose eficonfig_create_device_path() Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use eficonfig_create_device_path() to construct the full device path from device path of the volume and file path, so move it out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d571f9b2 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation All the eficonfig menus other than "Change Boot Order" use 'eficonfig_entry' structure for each menu entry. This commit refactors change boot order implementation to use 'eficonfig_entry' structure same as other menus to have consistent menu handling. This commit also simplifies the data->active handling when KEY_SPACE is pressed, and sizeof() parameter. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
8961e93e |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose append entry function Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use append_entry() and append_quit_entry() to construct the menu, so move them out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
a84040ab |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor file selection handling eficonfig_select_file_handler() is commonly used to select the file. eficonfig_display_select_file_option() adds an additional menu to clear the selected file. eficonfig_display_select_file_option() is not always necessary for the file selection process, so it must be outside of eficonfig_select_file_handler(). This commit also renames the following functions to avoid confusion. eficonfig_select_file_handler() -> eficonfig_process_select_file() eficonfig_select_file() -> eficonfig_show_file_selection() eficonfig_display_select_file_option() -> eficonfig_process_show_file_option() Finally, test_eficonfig.py need to be updated to get aligned with the above modification. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
1167e88a |
|
14-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix missing variable initialization The 'ret' variable must be initialized before use in eficonfig_delete_invalid_boot_option(). Fixes: c416f1c0bc ("bootmenu: add removable media entries") Addresses-Coverity: 376207 ("Uninitialized variables") Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
3d595ac5 |
|
09-Nov-2022 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: remove superfluous if in eficonfig_edit_boot_option Goto for an immediately succeeding label is superfluous. Fixes: 87d791423ac6 ("eficonfig: menu-driven addition of UEFI boot option") Addresses-Coverity: 376202 ("Identical code for different branches") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
2c0b0c31 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_SECURE_BOOT This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_SECURE_BOOT defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
83f3d121 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_MM_COMM_TEE This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_MM_COMM_TEE defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
88df3634 |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: CTRL+S to save the boot order 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>
|
#
45f5319f |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
menu: remove CTRL+C to quit On the sandbox called without "--terminal raw" CTRL+C leaves U-Boot, "ESC/CTRL+C to quit" is misleading. Let's remove CTRL+C to quit key handling from bootmenu and eficonfig menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
|
#
8dbd0a0f |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add vertical scroll support The current eficonfig menu does not support vertical scroll, so it can not display the menu entries greater than the console row size. This commit add the vertial scroll support. The console size is retrieved by SIMPLE_TEXT_OUTPUT_PROTOCOL.QueryMode() service, then calculates the row size for menu entry by subtracting menu header and description row size from the console row size. "start" and "end" are added in the efimenu structure. "start" keeps the menu entry index at the top, "end" keeps the bottom menu entry index. item_data_print() menu function only draws the menu entry between "start" and "end". This commit also fixes the issue that "Save" and "Quit" entries can be moved by BKEY_PLUS in change boot order menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
0d590852 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation This commit removes the change boot order specific menu implementation. The change boot order implementation calls eficonfig_process_common() same as other menus. The change boot order menu requires own item_data_print and item_choice implementation, but display_statusline function can be a same function as other menus. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
cd160b27 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor eficonfig_process_common function Current change boot order implementation does not call eficonfig_process_common() and call own menu functions for display_statusline, item_data_print and item_choice. Change boot order functionality should call eficonfig_process_common() to improve maintenanceability. This commit is a preparation to remove the change boot order specific implementation. The menu functions (display_statusline, item_data_print and item_choice) are added as argument of eficonfig_process_common(). The menu description string displayed at the bottom of the menu is also added as argument. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
32bab0ea |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Make use of CLI character processing Avoid duplicating some of the escape-sequence processing here and use the CLI function instead. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
d0ca98db |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Update bootmenu_loop() to return the code Use the return value to save having to pass around a pointer. This also resolves any ambiguity about what *key contains when the function is called. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
2da4a15e |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Rename KEY_... to BKEY_... This enum values conflict with linux/input.h so rename them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
64550274 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: avoid SetVariable between GetNextVariableName calls The current code calls efi_set_variable_int() to delete the invalid boot option between calls to efi_get_next_variable_name_int(), it may produce unpredictable results. This commit moves removal of the invalid boot option outside of the efi_get_next_variable_name_int() calls. EFI_NOT_FOUND returned from efi_get_next_variable_name_int() indicates we retrieved all EFI variables, it should be treated as EFI_SUCEESS. To address the checkpatch warning of too many leading tabs, combine two if statement into one. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
ce327084 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: carve out efi_get_next_variable_name_int calls To retrieve the EFI variable name by efi_get_next_variable_name_int(), the sequence of alloc -> efi_get_next_variable_name_int -> realloc -> efi_get_next_variable_name_int is required. In current code, this sequence repeatedly appears in the several functions. It should be curved out a common function. This commit also fixes the missing free() of var_name16 in eficonfig_delete_invalid_boot_option(). Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
140a8959 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use efi_get_next_variable_name_int() eficonfig command reads all possible UEFI load options from 0x0000 to 0xFFFF to construct the menu. This takes too much time in some environment. This commit uses efi_get_next_variable_name_int() to read all existing UEFI load options to significantlly reduce the count of efi_get_var() call. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
78b1ccc4 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use u16_strsize() to get u16 string buffer size Use u16_strsize() to simplify the u16 string buffer size calculation. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c67d3c9e |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix going one directory up issue The directory name in eficonfig menu entry contains the '\' separator. strcmp() argument ".." is wrong and one directory up handling does not work correctly. strcmp() argument must include '\' separator. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c3b5af63 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add UEFI Secure Boot Key enrollment interface This commit adds the menu-driven UEFI Secure Boot Key enrollment interface. User can enroll PK, KEK, db and dbx by selecting file. Only the signed EFI Signature List(s) with an authenticated header, typically '.auth' file, is accepted. To clear the PK, KEK, db and dbx, user needs to enroll the null key signed by PK or KEK. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
21faf4ef |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use protocol interface for file selection EFI_SIMPLE_FILE_SYSTEM_PROTOCOL is not always provided by U-Boot. Use protocol interface functions instead of U-Boot internal functions. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d6566113 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose eficonfig_create_device_path() Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use eficonfig_create_device_path() to construct the full device path from device path of the volume and file path, so move it out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d571f9b2 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation All the eficonfig menus other than "Change Boot Order" use 'eficonfig_entry' structure for each menu entry. This commit refactors change boot order implementation to use 'eficonfig_entry' structure same as other menus to have consistent menu handling. This commit also simplifies the data->active handling when KEY_SPACE is pressed, and sizeof() parameter. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
8961e93e |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose append entry function Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use append_entry() and append_quit_entry() to construct the menu, so move them out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
a84040ab |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor file selection handling eficonfig_select_file_handler() is commonly used to select the file. eficonfig_display_select_file_option() adds an additional menu to clear the selected file. eficonfig_display_select_file_option() is not always necessary for the file selection process, so it must be outside of eficonfig_select_file_handler(). This commit also renames the following functions to avoid confusion. eficonfig_select_file_handler() -> eficonfig_process_select_file() eficonfig_select_file() -> eficonfig_show_file_selection() eficonfig_display_select_file_option() -> eficonfig_process_show_file_option() Finally, test_eficonfig.py need to be updated to get aligned with the above modification. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
1167e88a |
|
14-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix missing variable initialization The 'ret' variable must be initialized before use in eficonfig_delete_invalid_boot_option(). Fixes: c416f1c0bc ("bootmenu: add removable media entries") Addresses-Coverity: 376207 ("Uninitialized variables") Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
3d595ac5 |
|
09-Nov-2022 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: remove superfluous if in eficonfig_edit_boot_option Goto for an immediately succeeding label is superfluous. Fixes: 87d791423ac6 ("eficonfig: menu-driven addition of UEFI boot option") Addresses-Coverity: 376202 ("Identical code for different branches") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
2c0b0c31 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_SECURE_BOOT This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_SECURE_BOOT defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
83f3d121 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_MM_COMM_TEE This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_MM_COMM_TEE defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
88df3634 |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: CTRL+S to save the boot order 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>
|
#
45f5319f |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
menu: remove CTRL+C to quit On the sandbox called without "--terminal raw" CTRL+C leaves U-Boot, "ESC/CTRL+C to quit" is misleading. Let's remove CTRL+C to quit key handling from bootmenu and eficonfig menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
|
#
8dbd0a0f |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add vertical scroll support The current eficonfig menu does not support vertical scroll, so it can not display the menu entries greater than the console row size. This commit add the vertial scroll support. The console size is retrieved by SIMPLE_TEXT_OUTPUT_PROTOCOL.QueryMode() service, then calculates the row size for menu entry by subtracting menu header and description row size from the console row size. "start" and "end" are added in the efimenu structure. "start" keeps the menu entry index at the top, "end" keeps the bottom menu entry index. item_data_print() menu function only draws the menu entry between "start" and "end". This commit also fixes the issue that "Save" and "Quit" entries can be moved by BKEY_PLUS in change boot order menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
0d590852 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation This commit removes the change boot order specific menu implementation. The change boot order implementation calls eficonfig_process_common() same as other menus. The change boot order menu requires own item_data_print and item_choice implementation, but display_statusline function can be a same function as other menus. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
cd160b27 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor eficonfig_process_common function Current change boot order implementation does not call eficonfig_process_common() and call own menu functions for display_statusline, item_data_print and item_choice. Change boot order functionality should call eficonfig_process_common() to improve maintenanceability. This commit is a preparation to remove the change boot order specific implementation. The menu functions (display_statusline, item_data_print and item_choice) are added as argument of eficonfig_process_common(). The menu description string displayed at the bottom of the menu is also added as argument. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
32bab0ea |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Make use of CLI character processing Avoid duplicating some of the escape-sequence processing here and use the CLI function instead. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
d0ca98db |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Update bootmenu_loop() to return the code Use the return value to save having to pass around a pointer. This also resolves any ambiguity about what *key contains when the function is called. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
2da4a15e |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Rename KEY_... to BKEY_... This enum values conflict with linux/input.h so rename them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
64550274 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: avoid SetVariable between GetNextVariableName calls The current code calls efi_set_variable_int() to delete the invalid boot option between calls to efi_get_next_variable_name_int(), it may produce unpredictable results. This commit moves removal of the invalid boot option outside of the efi_get_next_variable_name_int() calls. EFI_NOT_FOUND returned from efi_get_next_variable_name_int() indicates we retrieved all EFI variables, it should be treated as EFI_SUCEESS. To address the checkpatch warning of too many leading tabs, combine two if statement into one. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
ce327084 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: carve out efi_get_next_variable_name_int calls To retrieve the EFI variable name by efi_get_next_variable_name_int(), the sequence of alloc -> efi_get_next_variable_name_int -> realloc -> efi_get_next_variable_name_int is required. In current code, this sequence repeatedly appears in the several functions. It should be curved out a common function. This commit also fixes the missing free() of var_name16 in eficonfig_delete_invalid_boot_option(). Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
140a8959 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use efi_get_next_variable_name_int() eficonfig command reads all possible UEFI load options from 0x0000 to 0xFFFF to construct the menu. This takes too much time in some environment. This commit uses efi_get_next_variable_name_int() to read all existing UEFI load options to significantlly reduce the count of efi_get_var() call. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
78b1ccc4 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use u16_strsize() to get u16 string buffer size Use u16_strsize() to simplify the u16 string buffer size calculation. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c67d3c9e |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix going one directory up issue The directory name in eficonfig menu entry contains the '\' separator. strcmp() argument ".." is wrong and one directory up handling does not work correctly. strcmp() argument must include '\' separator. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c3b5af63 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add UEFI Secure Boot Key enrollment interface This commit adds the menu-driven UEFI Secure Boot Key enrollment interface. User can enroll PK, KEK, db and dbx by selecting file. Only the signed EFI Signature List(s) with an authenticated header, typically '.auth' file, is accepted. To clear the PK, KEK, db and dbx, user needs to enroll the null key signed by PK or KEK. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
21faf4ef |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use protocol interface for file selection EFI_SIMPLE_FILE_SYSTEM_PROTOCOL is not always provided by U-Boot. Use protocol interface functions instead of U-Boot internal functions. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d6566113 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose eficonfig_create_device_path() Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use eficonfig_create_device_path() to construct the full device path from device path of the volume and file path, so move it out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d571f9b2 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation All the eficonfig menus other than "Change Boot Order" use 'eficonfig_entry' structure for each menu entry. This commit refactors change boot order implementation to use 'eficonfig_entry' structure same as other menus to have consistent menu handling. This commit also simplifies the data->active handling when KEY_SPACE is pressed, and sizeof() parameter. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
8961e93e |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose append entry function Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use append_entry() and append_quit_entry() to construct the menu, so move them out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
a84040ab |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor file selection handling eficonfig_select_file_handler() is commonly used to select the file. eficonfig_display_select_file_option() adds an additional menu to clear the selected file. eficonfig_display_select_file_option() is not always necessary for the file selection process, so it must be outside of eficonfig_select_file_handler(). This commit also renames the following functions to avoid confusion. eficonfig_select_file_handler() -> eficonfig_process_select_file() eficonfig_select_file() -> eficonfig_show_file_selection() eficonfig_display_select_file_option() -> eficonfig_process_show_file_option() Finally, test_eficonfig.py need to be updated to get aligned with the above modification. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
1167e88a |
|
14-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix missing variable initialization The 'ret' variable must be initialized before use in eficonfig_delete_invalid_boot_option(). Fixes: c416f1c0bc ("bootmenu: add removable media entries") Addresses-Coverity: 376207 ("Uninitialized variables") Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
3d595ac5 |
|
09-Nov-2022 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: remove superfluous if in eficonfig_edit_boot_option Goto for an immediately succeeding label is superfluous. Fixes: 87d791423ac6 ("eficonfig: menu-driven addition of UEFI boot option") Addresses-Coverity: 376202 ("Identical code for different branches") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
2c0b0c31 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_SECURE_BOOT This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_SECURE_BOOT defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
83f3d121 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_MM_COMM_TEE This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_MM_COMM_TEE defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
88df3634 |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: CTRL+S to save the boot order 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>
|
#
45f5319f |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
menu: remove CTRL+C to quit On the sandbox called without "--terminal raw" CTRL+C leaves U-Boot, "ESC/CTRL+C to quit" is misleading. Let's remove CTRL+C to quit key handling from bootmenu and eficonfig menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
|
#
8dbd0a0f |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add vertical scroll support The current eficonfig menu does not support vertical scroll, so it can not display the menu entries greater than the console row size. This commit add the vertial scroll support. The console size is retrieved by SIMPLE_TEXT_OUTPUT_PROTOCOL.QueryMode() service, then calculates the row size for menu entry by subtracting menu header and description row size from the console row size. "start" and "end" are added in the efimenu structure. "start" keeps the menu entry index at the top, "end" keeps the bottom menu entry index. item_data_print() menu function only draws the menu entry between "start" and "end". This commit also fixes the issue that "Save" and "Quit" entries can be moved by BKEY_PLUS in change boot order menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
0d590852 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation This commit removes the change boot order specific menu implementation. The change boot order implementation calls eficonfig_process_common() same as other menus. The change boot order menu requires own item_data_print and item_choice implementation, but display_statusline function can be a same function as other menus. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
cd160b27 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor eficonfig_process_common function Current change boot order implementation does not call eficonfig_process_common() and call own menu functions for display_statusline, item_data_print and item_choice. Change boot order functionality should call eficonfig_process_common() to improve maintenanceability. This commit is a preparation to remove the change boot order specific implementation. The menu functions (display_statusline, item_data_print and item_choice) are added as argument of eficonfig_process_common(). The menu description string displayed at the bottom of the menu is also added as argument. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
32bab0ea |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Make use of CLI character processing Avoid duplicating some of the escape-sequence processing here and use the CLI function instead. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
d0ca98db |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Update bootmenu_loop() to return the code Use the return value to save having to pass around a pointer. This also resolves any ambiguity about what *key contains when the function is called. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
2da4a15e |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Rename KEY_... to BKEY_... This enum values conflict with linux/input.h so rename them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
64550274 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: avoid SetVariable between GetNextVariableName calls The current code calls efi_set_variable_int() to delete the invalid boot option between calls to efi_get_next_variable_name_int(), it may produce unpredictable results. This commit moves removal of the invalid boot option outside of the efi_get_next_variable_name_int() calls. EFI_NOT_FOUND returned from efi_get_next_variable_name_int() indicates we retrieved all EFI variables, it should be treated as EFI_SUCEESS. To address the checkpatch warning of too many leading tabs, combine two if statement into one. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
ce327084 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: carve out efi_get_next_variable_name_int calls To retrieve the EFI variable name by efi_get_next_variable_name_int(), the sequence of alloc -> efi_get_next_variable_name_int -> realloc -> efi_get_next_variable_name_int is required. In current code, this sequence repeatedly appears in the several functions. It should be curved out a common function. This commit also fixes the missing free() of var_name16 in eficonfig_delete_invalid_boot_option(). Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
140a8959 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use efi_get_next_variable_name_int() eficonfig command reads all possible UEFI load options from 0x0000 to 0xFFFF to construct the menu. This takes too much time in some environment. This commit uses efi_get_next_variable_name_int() to read all existing UEFI load options to significantlly reduce the count of efi_get_var() call. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
78b1ccc4 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use u16_strsize() to get u16 string buffer size Use u16_strsize() to simplify the u16 string buffer size calculation. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c67d3c9e |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix going one directory up issue The directory name in eficonfig menu entry contains the '\' separator. strcmp() argument ".." is wrong and one directory up handling does not work correctly. strcmp() argument must include '\' separator. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c3b5af63 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add UEFI Secure Boot Key enrollment interface This commit adds the menu-driven UEFI Secure Boot Key enrollment interface. User can enroll PK, KEK, db and dbx by selecting file. Only the signed EFI Signature List(s) with an authenticated header, typically '.auth' file, is accepted. To clear the PK, KEK, db and dbx, user needs to enroll the null key signed by PK or KEK. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
21faf4ef |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use protocol interface for file selection EFI_SIMPLE_FILE_SYSTEM_PROTOCOL is not always provided by U-Boot. Use protocol interface functions instead of U-Boot internal functions. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d6566113 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose eficonfig_create_device_path() Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use eficonfig_create_device_path() to construct the full device path from device path of the volume and file path, so move it out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d571f9b2 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation All the eficonfig menus other than "Change Boot Order" use 'eficonfig_entry' structure for each menu entry. This commit refactors change boot order implementation to use 'eficonfig_entry' structure same as other menus to have consistent menu handling. This commit also simplifies the data->active handling when KEY_SPACE is pressed, and sizeof() parameter. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
8961e93e |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose append entry function Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use append_entry() and append_quit_entry() to construct the menu, so move them out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
a84040ab |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor file selection handling eficonfig_select_file_handler() is commonly used to select the file. eficonfig_display_select_file_option() adds an additional menu to clear the selected file. eficonfig_display_select_file_option() is not always necessary for the file selection process, so it must be outside of eficonfig_select_file_handler(). This commit also renames the following functions to avoid confusion. eficonfig_select_file_handler() -> eficonfig_process_select_file() eficonfig_select_file() -> eficonfig_show_file_selection() eficonfig_display_select_file_option() -> eficonfig_process_show_file_option() Finally, test_eficonfig.py need to be updated to get aligned with the above modification. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
1167e88a |
|
14-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix missing variable initialization The 'ret' variable must be initialized before use in eficonfig_delete_invalid_boot_option(). Fixes: c416f1c0bc ("bootmenu: add removable media entries") Addresses-Coverity: 376207 ("Uninitialized variables") Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
3d595ac5 |
|
09-Nov-2022 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: remove superfluous if in eficonfig_edit_boot_option Goto for an immediately succeeding label is superfluous. Fixes: 87d791423ac6 ("eficonfig: menu-driven addition of UEFI boot option") Addresses-Coverity: 376202 ("Identical code for different branches") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
2c0b0c31 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_SECURE_BOOT This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_SECURE_BOOT defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
83f3d121 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_MM_COMM_TEE This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_MM_COMM_TEE defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
88df3634 |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: CTRL+S to save the boot order 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>
|
#
45f5319f |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
menu: remove CTRL+C to quit On the sandbox called without "--terminal raw" CTRL+C leaves U-Boot, "ESC/CTRL+C to quit" is misleading. Let's remove CTRL+C to quit key handling from bootmenu and eficonfig menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
|
#
8dbd0a0f |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add vertical scroll support The current eficonfig menu does not support vertical scroll, so it can not display the menu entries greater than the console row size. This commit add the vertial scroll support. The console size is retrieved by SIMPLE_TEXT_OUTPUT_PROTOCOL.QueryMode() service, then calculates the row size for menu entry by subtracting menu header and description row size from the console row size. "start" and "end" are added in the efimenu structure. "start" keeps the menu entry index at the top, "end" keeps the bottom menu entry index. item_data_print() menu function only draws the menu entry between "start" and "end". This commit also fixes the issue that "Save" and "Quit" entries can be moved by BKEY_PLUS in change boot order menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
0d590852 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation This commit removes the change boot order specific menu implementation. The change boot order implementation calls eficonfig_process_common() same as other menus. The change boot order menu requires own item_data_print and item_choice implementation, but display_statusline function can be a same function as other menus. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
cd160b27 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor eficonfig_process_common function Current change boot order implementation does not call eficonfig_process_common() and call own menu functions for display_statusline, item_data_print and item_choice. Change boot order functionality should call eficonfig_process_common() to improve maintenanceability. This commit is a preparation to remove the change boot order specific implementation. The menu functions (display_statusline, item_data_print and item_choice) are added as argument of eficonfig_process_common(). The menu description string displayed at the bottom of the menu is also added as argument. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
32bab0ea |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Make use of CLI character processing Avoid duplicating some of the escape-sequence processing here and use the CLI function instead. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
d0ca98db |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Update bootmenu_loop() to return the code Use the return value to save having to pass around a pointer. This also resolves any ambiguity about what *key contains when the function is called. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
2da4a15e |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Rename KEY_... to BKEY_... This enum values conflict with linux/input.h so rename them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
64550274 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: avoid SetVariable between GetNextVariableName calls The current code calls efi_set_variable_int() to delete the invalid boot option between calls to efi_get_next_variable_name_int(), it may produce unpredictable results. This commit moves removal of the invalid boot option outside of the efi_get_next_variable_name_int() calls. EFI_NOT_FOUND returned from efi_get_next_variable_name_int() indicates we retrieved all EFI variables, it should be treated as EFI_SUCEESS. To address the checkpatch warning of too many leading tabs, combine two if statement into one. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
ce327084 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: carve out efi_get_next_variable_name_int calls To retrieve the EFI variable name by efi_get_next_variable_name_int(), the sequence of alloc -> efi_get_next_variable_name_int -> realloc -> efi_get_next_variable_name_int is required. In current code, this sequence repeatedly appears in the several functions. It should be curved out a common function. This commit also fixes the missing free() of var_name16 in eficonfig_delete_invalid_boot_option(). Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
140a8959 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use efi_get_next_variable_name_int() eficonfig command reads all possible UEFI load options from 0x0000 to 0xFFFF to construct the menu. This takes too much time in some environment. This commit uses efi_get_next_variable_name_int() to read all existing UEFI load options to significantlly reduce the count of efi_get_var() call. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
78b1ccc4 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use u16_strsize() to get u16 string buffer size Use u16_strsize() to simplify the u16 string buffer size calculation. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c67d3c9e |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix going one directory up issue The directory name in eficonfig menu entry contains the '\' separator. strcmp() argument ".." is wrong and one directory up handling does not work correctly. strcmp() argument must include '\' separator. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c3b5af63 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add UEFI Secure Boot Key enrollment interface This commit adds the menu-driven UEFI Secure Boot Key enrollment interface. User can enroll PK, KEK, db and dbx by selecting file. Only the signed EFI Signature List(s) with an authenticated header, typically '.auth' file, is accepted. To clear the PK, KEK, db and dbx, user needs to enroll the null key signed by PK or KEK. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
21faf4ef |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use protocol interface for file selection EFI_SIMPLE_FILE_SYSTEM_PROTOCOL is not always provided by U-Boot. Use protocol interface functions instead of U-Boot internal functions. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d6566113 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose eficonfig_create_device_path() Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use eficonfig_create_device_path() to construct the full device path from device path of the volume and file path, so move it out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d571f9b2 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation All the eficonfig menus other than "Change Boot Order" use 'eficonfig_entry' structure for each menu entry. This commit refactors change boot order implementation to use 'eficonfig_entry' structure same as other menus to have consistent menu handling. This commit also simplifies the data->active handling when KEY_SPACE is pressed, and sizeof() parameter. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
8961e93e |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose append entry function Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use append_entry() and append_quit_entry() to construct the menu, so move them out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
a84040ab |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor file selection handling eficonfig_select_file_handler() is commonly used to select the file. eficonfig_display_select_file_option() adds an additional menu to clear the selected file. eficonfig_display_select_file_option() is not always necessary for the file selection process, so it must be outside of eficonfig_select_file_handler(). This commit also renames the following functions to avoid confusion. eficonfig_select_file_handler() -> eficonfig_process_select_file() eficonfig_select_file() -> eficonfig_show_file_selection() eficonfig_display_select_file_option() -> eficonfig_process_show_file_option() Finally, test_eficonfig.py need to be updated to get aligned with the above modification. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
1167e88a |
|
14-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix missing variable initialization The 'ret' variable must be initialized before use in eficonfig_delete_invalid_boot_option(). Fixes: c416f1c0bc ("bootmenu: add removable media entries") Addresses-Coverity: 376207 ("Uninitialized variables") Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
3d595ac5 |
|
09-Nov-2022 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: remove superfluous if in eficonfig_edit_boot_option Goto for an immediately succeeding label is superfluous. Fixes: 87d791423ac6 ("eficonfig: menu-driven addition of UEFI boot option") Addresses-Coverity: 376202 ("Identical code for different branches") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
2c0b0c31 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_SECURE_BOOT This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_SECURE_BOOT defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
83f3d121 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_MM_COMM_TEE This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_MM_COMM_TEE defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
88df3634 |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: CTRL+S to save the boot order 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>
|
#
45f5319f |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
menu: remove CTRL+C to quit On the sandbox called without "--terminal raw" CTRL+C leaves U-Boot, "ESC/CTRL+C to quit" is misleading. Let's remove CTRL+C to quit key handling from bootmenu and eficonfig menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
|
#
8dbd0a0f |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add vertical scroll support The current eficonfig menu does not support vertical scroll, so it can not display the menu entries greater than the console row size. This commit add the vertial scroll support. The console size is retrieved by SIMPLE_TEXT_OUTPUT_PROTOCOL.QueryMode() service, then calculates the row size for menu entry by subtracting menu header and description row size from the console row size. "start" and "end" are added in the efimenu structure. "start" keeps the menu entry index at the top, "end" keeps the bottom menu entry index. item_data_print() menu function only draws the menu entry between "start" and "end". This commit also fixes the issue that "Save" and "Quit" entries can be moved by BKEY_PLUS in change boot order menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
0d590852 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation This commit removes the change boot order specific menu implementation. The change boot order implementation calls eficonfig_process_common() same as other menus. The change boot order menu requires own item_data_print and item_choice implementation, but display_statusline function can be a same function as other menus. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
cd160b27 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor eficonfig_process_common function Current change boot order implementation does not call eficonfig_process_common() and call own menu functions for display_statusline, item_data_print and item_choice. Change boot order functionality should call eficonfig_process_common() to improve maintenanceability. This commit is a preparation to remove the change boot order specific implementation. The menu functions (display_statusline, item_data_print and item_choice) are added as argument of eficonfig_process_common(). The menu description string displayed at the bottom of the menu is also added as argument. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
32bab0ea |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Make use of CLI character processing Avoid duplicating some of the escape-sequence processing here and use the CLI function instead. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
d0ca98db |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Update bootmenu_loop() to return the code Use the return value to save having to pass around a pointer. This also resolves any ambiguity about what *key contains when the function is called. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
2da4a15e |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Rename KEY_... to BKEY_... This enum values conflict with linux/input.h so rename them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
64550274 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: avoid SetVariable between GetNextVariableName calls The current code calls efi_set_variable_int() to delete the invalid boot option between calls to efi_get_next_variable_name_int(), it may produce unpredictable results. This commit moves removal of the invalid boot option outside of the efi_get_next_variable_name_int() calls. EFI_NOT_FOUND returned from efi_get_next_variable_name_int() indicates we retrieved all EFI variables, it should be treated as EFI_SUCEESS. To address the checkpatch warning of too many leading tabs, combine two if statement into one. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
ce327084 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: carve out efi_get_next_variable_name_int calls To retrieve the EFI variable name by efi_get_next_variable_name_int(), the sequence of alloc -> efi_get_next_variable_name_int -> realloc -> efi_get_next_variable_name_int is required. In current code, this sequence repeatedly appears in the several functions. It should be curved out a common function. This commit also fixes the missing free() of var_name16 in eficonfig_delete_invalid_boot_option(). Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
140a8959 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use efi_get_next_variable_name_int() eficonfig command reads all possible UEFI load options from 0x0000 to 0xFFFF to construct the menu. This takes too much time in some environment. This commit uses efi_get_next_variable_name_int() to read all existing UEFI load options to significantlly reduce the count of efi_get_var() call. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
78b1ccc4 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use u16_strsize() to get u16 string buffer size Use u16_strsize() to simplify the u16 string buffer size calculation. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c67d3c9e |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix going one directory up issue The directory name in eficonfig menu entry contains the '\' separator. strcmp() argument ".." is wrong and one directory up handling does not work correctly. strcmp() argument must include '\' separator. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c3b5af63 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add UEFI Secure Boot Key enrollment interface This commit adds the menu-driven UEFI Secure Boot Key enrollment interface. User can enroll PK, KEK, db and dbx by selecting file. Only the signed EFI Signature List(s) with an authenticated header, typically '.auth' file, is accepted. To clear the PK, KEK, db and dbx, user needs to enroll the null key signed by PK or KEK. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
21faf4ef |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use protocol interface for file selection EFI_SIMPLE_FILE_SYSTEM_PROTOCOL is not always provided by U-Boot. Use protocol interface functions instead of U-Boot internal functions. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d6566113 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose eficonfig_create_device_path() Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use eficonfig_create_device_path() to construct the full device path from device path of the volume and file path, so move it out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d571f9b2 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation All the eficonfig menus other than "Change Boot Order" use 'eficonfig_entry' structure for each menu entry. This commit refactors change boot order implementation to use 'eficonfig_entry' structure same as other menus to have consistent menu handling. This commit also simplifies the data->active handling when KEY_SPACE is pressed, and sizeof() parameter. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
8961e93e |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose append entry function Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use append_entry() and append_quit_entry() to construct the menu, so move them out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
a84040ab |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor file selection handling eficonfig_select_file_handler() is commonly used to select the file. eficonfig_display_select_file_option() adds an additional menu to clear the selected file. eficonfig_display_select_file_option() is not always necessary for the file selection process, so it must be outside of eficonfig_select_file_handler(). This commit also renames the following functions to avoid confusion. eficonfig_select_file_handler() -> eficonfig_process_select_file() eficonfig_select_file() -> eficonfig_show_file_selection() eficonfig_display_select_file_option() -> eficonfig_process_show_file_option() Finally, test_eficonfig.py need to be updated to get aligned with the above modification. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
1167e88a |
|
14-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix missing variable initialization The 'ret' variable must be initialized before use in eficonfig_delete_invalid_boot_option(). Fixes: c416f1c0bc ("bootmenu: add removable media entries") Addresses-Coverity: 376207 ("Uninitialized variables") Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
3d595ac5 |
|
09-Nov-2022 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: remove superfluous if in eficonfig_edit_boot_option Goto for an immediately succeeding label is superfluous. Fixes: 87d791423ac6 ("eficonfig: menu-driven addition of UEFI boot option") Addresses-Coverity: 376202 ("Identical code for different branches") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
2c0b0c31 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_SECURE_BOOT This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_SECURE_BOOT defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
83f3d121 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_MM_COMM_TEE This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_MM_COMM_TEE defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
88df3634 |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: CTRL+S to save the boot order 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>
|
#
45f5319f |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
menu: remove CTRL+C to quit On the sandbox called without "--terminal raw" CTRL+C leaves U-Boot, "ESC/CTRL+C to quit" is misleading. Let's remove CTRL+C to quit key handling from bootmenu and eficonfig menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
|
#
8dbd0a0f |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add vertical scroll support The current eficonfig menu does not support vertical scroll, so it can not display the menu entries greater than the console row size. This commit add the vertial scroll support. The console size is retrieved by SIMPLE_TEXT_OUTPUT_PROTOCOL.QueryMode() service, then calculates the row size for menu entry by subtracting menu header and description row size from the console row size. "start" and "end" are added in the efimenu structure. "start" keeps the menu entry index at the top, "end" keeps the bottom menu entry index. item_data_print() menu function only draws the menu entry between "start" and "end". This commit also fixes the issue that "Save" and "Quit" entries can be moved by BKEY_PLUS in change boot order menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
0d590852 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation This commit removes the change boot order specific menu implementation. The change boot order implementation calls eficonfig_process_common() same as other menus. The change boot order menu requires own item_data_print and item_choice implementation, but display_statusline function can be a same function as other menus. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
cd160b27 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor eficonfig_process_common function Current change boot order implementation does not call eficonfig_process_common() and call own menu functions for display_statusline, item_data_print and item_choice. Change boot order functionality should call eficonfig_process_common() to improve maintenanceability. This commit is a preparation to remove the change boot order specific implementation. The menu functions (display_statusline, item_data_print and item_choice) are added as argument of eficonfig_process_common(). The menu description string displayed at the bottom of the menu is also added as argument. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
32bab0ea |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Make use of CLI character processing Avoid duplicating some of the escape-sequence processing here and use the CLI function instead. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
d0ca98db |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Update bootmenu_loop() to return the code Use the return value to save having to pass around a pointer. This also resolves any ambiguity about what *key contains when the function is called. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
2da4a15e |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Rename KEY_... to BKEY_... This enum values conflict with linux/input.h so rename them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
64550274 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: avoid SetVariable between GetNextVariableName calls The current code calls efi_set_variable_int() to delete the invalid boot option between calls to efi_get_next_variable_name_int(), it may produce unpredictable results. This commit moves removal of the invalid boot option outside of the efi_get_next_variable_name_int() calls. EFI_NOT_FOUND returned from efi_get_next_variable_name_int() indicates we retrieved all EFI variables, it should be treated as EFI_SUCEESS. To address the checkpatch warning of too many leading tabs, combine two if statement into one. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
ce327084 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: carve out efi_get_next_variable_name_int calls To retrieve the EFI variable name by efi_get_next_variable_name_int(), the sequence of alloc -> efi_get_next_variable_name_int -> realloc -> efi_get_next_variable_name_int is required. In current code, this sequence repeatedly appears in the several functions. It should be curved out a common function. This commit also fixes the missing free() of var_name16 in eficonfig_delete_invalid_boot_option(). Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
140a8959 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use efi_get_next_variable_name_int() eficonfig command reads all possible UEFI load options from 0x0000 to 0xFFFF to construct the menu. This takes too much time in some environment. This commit uses efi_get_next_variable_name_int() to read all existing UEFI load options to significantlly reduce the count of efi_get_var() call. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
78b1ccc4 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use u16_strsize() to get u16 string buffer size Use u16_strsize() to simplify the u16 string buffer size calculation. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c67d3c9e |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix going one directory up issue The directory name in eficonfig menu entry contains the '\' separator. strcmp() argument ".." is wrong and one directory up handling does not work correctly. strcmp() argument must include '\' separator. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c3b5af63 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add UEFI Secure Boot Key enrollment interface This commit adds the menu-driven UEFI Secure Boot Key enrollment interface. User can enroll PK, KEK, db and dbx by selecting file. Only the signed EFI Signature List(s) with an authenticated header, typically '.auth' file, is accepted. To clear the PK, KEK, db and dbx, user needs to enroll the null key signed by PK or KEK. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
21faf4ef |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use protocol interface for file selection EFI_SIMPLE_FILE_SYSTEM_PROTOCOL is not always provided by U-Boot. Use protocol interface functions instead of U-Boot internal functions. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d6566113 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose eficonfig_create_device_path() Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use eficonfig_create_device_path() to construct the full device path from device path of the volume and file path, so move it out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d571f9b2 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation All the eficonfig menus other than "Change Boot Order" use 'eficonfig_entry' structure for each menu entry. This commit refactors change boot order implementation to use 'eficonfig_entry' structure same as other menus to have consistent menu handling. This commit also simplifies the data->active handling when KEY_SPACE is pressed, and sizeof() parameter. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
8961e93e |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose append entry function Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use append_entry() and append_quit_entry() to construct the menu, so move them out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
a84040ab |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor file selection handling eficonfig_select_file_handler() is commonly used to select the file. eficonfig_display_select_file_option() adds an additional menu to clear the selected file. eficonfig_display_select_file_option() is not always necessary for the file selection process, so it must be outside of eficonfig_select_file_handler(). This commit also renames the following functions to avoid confusion. eficonfig_select_file_handler() -> eficonfig_process_select_file() eficonfig_select_file() -> eficonfig_show_file_selection() eficonfig_display_select_file_option() -> eficonfig_process_show_file_option() Finally, test_eficonfig.py need to be updated to get aligned with the above modification. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
1167e88a |
|
14-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix missing variable initialization The 'ret' variable must be initialized before use in eficonfig_delete_invalid_boot_option(). Fixes: c416f1c0bc ("bootmenu: add removable media entries") Addresses-Coverity: 376207 ("Uninitialized variables") Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
3d595ac5 |
|
09-Nov-2022 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: remove superfluous if in eficonfig_edit_boot_option Goto for an immediately succeeding label is superfluous. Fixes: 87d791423ac6 ("eficonfig: menu-driven addition of UEFI boot option") Addresses-Coverity: 376202 ("Identical code for different branches") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
2c0b0c31 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_SECURE_BOOT This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_SECURE_BOOT defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
83f3d121 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_MM_COMM_TEE This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_MM_COMM_TEE defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
88df3634 |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: CTRL+S to save the boot order 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>
|
#
45f5319f |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
menu: remove CTRL+C to quit On the sandbox called without "--terminal raw" CTRL+C leaves U-Boot, "ESC/CTRL+C to quit" is misleading. Let's remove CTRL+C to quit key handling from bootmenu and eficonfig menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
|
#
8dbd0a0f |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add vertical scroll support The current eficonfig menu does not support vertical scroll, so it can not display the menu entries greater than the console row size. This commit add the vertial scroll support. The console size is retrieved by SIMPLE_TEXT_OUTPUT_PROTOCOL.QueryMode() service, then calculates the row size for menu entry by subtracting menu header and description row size from the console row size. "start" and "end" are added in the efimenu structure. "start" keeps the menu entry index at the top, "end" keeps the bottom menu entry index. item_data_print() menu function only draws the menu entry between "start" and "end". This commit also fixes the issue that "Save" and "Quit" entries can be moved by BKEY_PLUS in change boot order menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
0d590852 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation This commit removes the change boot order specific menu implementation. The change boot order implementation calls eficonfig_process_common() same as other menus. The change boot order menu requires own item_data_print and item_choice implementation, but display_statusline function can be a same function as other menus. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
cd160b27 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor eficonfig_process_common function Current change boot order implementation does not call eficonfig_process_common() and call own menu functions for display_statusline, item_data_print and item_choice. Change boot order functionality should call eficonfig_process_common() to improve maintenanceability. This commit is a preparation to remove the change boot order specific implementation. The menu functions (display_statusline, item_data_print and item_choice) are added as argument of eficonfig_process_common(). The menu description string displayed at the bottom of the menu is also added as argument. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
32bab0ea |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Make use of CLI character processing Avoid duplicating some of the escape-sequence processing here and use the CLI function instead. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
d0ca98db |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Update bootmenu_loop() to return the code Use the return value to save having to pass around a pointer. This also resolves any ambiguity about what *key contains when the function is called. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
2da4a15e |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Rename KEY_... to BKEY_... This enum values conflict with linux/input.h so rename them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
64550274 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: avoid SetVariable between GetNextVariableName calls The current code calls efi_set_variable_int() to delete the invalid boot option between calls to efi_get_next_variable_name_int(), it may produce unpredictable results. This commit moves removal of the invalid boot option outside of the efi_get_next_variable_name_int() calls. EFI_NOT_FOUND returned from efi_get_next_variable_name_int() indicates we retrieved all EFI variables, it should be treated as EFI_SUCEESS. To address the checkpatch warning of too many leading tabs, combine two if statement into one. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
ce327084 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: carve out efi_get_next_variable_name_int calls To retrieve the EFI variable name by efi_get_next_variable_name_int(), the sequence of alloc -> efi_get_next_variable_name_int -> realloc -> efi_get_next_variable_name_int is required. In current code, this sequence repeatedly appears in the several functions. It should be curved out a common function. This commit also fixes the missing free() of var_name16 in eficonfig_delete_invalid_boot_option(). Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
140a8959 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use efi_get_next_variable_name_int() eficonfig command reads all possible UEFI load options from 0x0000 to 0xFFFF to construct the menu. This takes too much time in some environment. This commit uses efi_get_next_variable_name_int() to read all existing UEFI load options to significantlly reduce the count of efi_get_var() call. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
78b1ccc4 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use u16_strsize() to get u16 string buffer size Use u16_strsize() to simplify the u16 string buffer size calculation. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c67d3c9e |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix going one directory up issue The directory name in eficonfig menu entry contains the '\' separator. strcmp() argument ".." is wrong and one directory up handling does not work correctly. strcmp() argument must include '\' separator. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c3b5af63 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add UEFI Secure Boot Key enrollment interface This commit adds the menu-driven UEFI Secure Boot Key enrollment interface. User can enroll PK, KEK, db and dbx by selecting file. Only the signed EFI Signature List(s) with an authenticated header, typically '.auth' file, is accepted. To clear the PK, KEK, db and dbx, user needs to enroll the null key signed by PK or KEK. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
21faf4ef |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use protocol interface for file selection EFI_SIMPLE_FILE_SYSTEM_PROTOCOL is not always provided by U-Boot. Use protocol interface functions instead of U-Boot internal functions. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d6566113 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose eficonfig_create_device_path() Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use eficonfig_create_device_path() to construct the full device path from device path of the volume and file path, so move it out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d571f9b2 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation All the eficonfig menus other than "Change Boot Order" use 'eficonfig_entry' structure for each menu entry. This commit refactors change boot order implementation to use 'eficonfig_entry' structure same as other menus to have consistent menu handling. This commit also simplifies the data->active handling when KEY_SPACE is pressed, and sizeof() parameter. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
8961e93e |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose append entry function Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use append_entry() and append_quit_entry() to construct the menu, so move them out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
a84040ab |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor file selection handling eficonfig_select_file_handler() is commonly used to select the file. eficonfig_display_select_file_option() adds an additional menu to clear the selected file. eficonfig_display_select_file_option() is not always necessary for the file selection process, so it must be outside of eficonfig_select_file_handler(). This commit also renames the following functions to avoid confusion. eficonfig_select_file_handler() -> eficonfig_process_select_file() eficonfig_select_file() -> eficonfig_show_file_selection() eficonfig_display_select_file_option() -> eficonfig_process_show_file_option() Finally, test_eficonfig.py need to be updated to get aligned with the above modification. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
1167e88a |
|
14-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix missing variable initialization The 'ret' variable must be initialized before use in eficonfig_delete_invalid_boot_option(). Fixes: c416f1c0bc ("bootmenu: add removable media entries") Addresses-Coverity: 376207 ("Uninitialized variables") Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
3d595ac5 |
|
09-Nov-2022 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: remove superfluous if in eficonfig_edit_boot_option Goto for an immediately succeeding label is superfluous. Fixes: 87d791423ac6 ("eficonfig: menu-driven addition of UEFI boot option") Addresses-Coverity: 376202 ("Identical code for different branches") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
2c0b0c31 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_SECURE_BOOT This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_SECURE_BOOT defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
83f3d121 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_MM_COMM_TEE This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_MM_COMM_TEE defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
88df3634 |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: CTRL+S to save the boot order 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>
|
#
45f5319f |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
menu: remove CTRL+C to quit On the sandbox called without "--terminal raw" CTRL+C leaves U-Boot, "ESC/CTRL+C to quit" is misleading. Let's remove CTRL+C to quit key handling from bootmenu and eficonfig menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
|
#
8dbd0a0f |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add vertical scroll support The current eficonfig menu does not support vertical scroll, so it can not display the menu entries greater than the console row size. This commit add the vertial scroll support. The console size is retrieved by SIMPLE_TEXT_OUTPUT_PROTOCOL.QueryMode() service, then calculates the row size for menu entry by subtracting menu header and description row size from the console row size. "start" and "end" are added in the efimenu structure. "start" keeps the menu entry index at the top, "end" keeps the bottom menu entry index. item_data_print() menu function only draws the menu entry between "start" and "end". This commit also fixes the issue that "Save" and "Quit" entries can be moved by BKEY_PLUS in change boot order menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
0d590852 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation This commit removes the change boot order specific menu implementation. The change boot order implementation calls eficonfig_process_common() same as other menus. The change boot order menu requires own item_data_print and item_choice implementation, but display_statusline function can be a same function as other menus. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
cd160b27 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor eficonfig_process_common function Current change boot order implementation does not call eficonfig_process_common() and call own menu functions for display_statusline, item_data_print and item_choice. Change boot order functionality should call eficonfig_process_common() to improve maintenanceability. This commit is a preparation to remove the change boot order specific implementation. The menu functions (display_statusline, item_data_print and item_choice) are added as argument of eficonfig_process_common(). The menu description string displayed at the bottom of the menu is also added as argument. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
32bab0ea |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Make use of CLI character processing Avoid duplicating some of the escape-sequence processing here and use the CLI function instead. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
d0ca98db |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Update bootmenu_loop() to return the code Use the return value to save having to pass around a pointer. This also resolves any ambiguity about what *key contains when the function is called. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
2da4a15e |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Rename KEY_... to BKEY_... This enum values conflict with linux/input.h so rename them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
64550274 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: avoid SetVariable between GetNextVariableName calls The current code calls efi_set_variable_int() to delete the invalid boot option between calls to efi_get_next_variable_name_int(), it may produce unpredictable results. This commit moves removal of the invalid boot option outside of the efi_get_next_variable_name_int() calls. EFI_NOT_FOUND returned from efi_get_next_variable_name_int() indicates we retrieved all EFI variables, it should be treated as EFI_SUCEESS. To address the checkpatch warning of too many leading tabs, combine two if statement into one. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
ce327084 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: carve out efi_get_next_variable_name_int calls To retrieve the EFI variable name by efi_get_next_variable_name_int(), the sequence of alloc -> efi_get_next_variable_name_int -> realloc -> efi_get_next_variable_name_int is required. In current code, this sequence repeatedly appears in the several functions. It should be curved out a common function. This commit also fixes the missing free() of var_name16 in eficonfig_delete_invalid_boot_option(). Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
140a8959 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use efi_get_next_variable_name_int() eficonfig command reads all possible UEFI load options from 0x0000 to 0xFFFF to construct the menu. This takes too much time in some environment. This commit uses efi_get_next_variable_name_int() to read all existing UEFI load options to significantlly reduce the count of efi_get_var() call. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
78b1ccc4 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use u16_strsize() to get u16 string buffer size Use u16_strsize() to simplify the u16 string buffer size calculation. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c67d3c9e |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix going one directory up issue The directory name in eficonfig menu entry contains the '\' separator. strcmp() argument ".." is wrong and one directory up handling does not work correctly. strcmp() argument must include '\' separator. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c3b5af63 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add UEFI Secure Boot Key enrollment interface This commit adds the menu-driven UEFI Secure Boot Key enrollment interface. User can enroll PK, KEK, db and dbx by selecting file. Only the signed EFI Signature List(s) with an authenticated header, typically '.auth' file, is accepted. To clear the PK, KEK, db and dbx, user needs to enroll the null key signed by PK or KEK. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
21faf4ef |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use protocol interface for file selection EFI_SIMPLE_FILE_SYSTEM_PROTOCOL is not always provided by U-Boot. Use protocol interface functions instead of U-Boot internal functions. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d6566113 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose eficonfig_create_device_path() Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use eficonfig_create_device_path() to construct the full device path from device path of the volume and file path, so move it out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d571f9b2 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation All the eficonfig menus other than "Change Boot Order" use 'eficonfig_entry' structure for each menu entry. This commit refactors change boot order implementation to use 'eficonfig_entry' structure same as other menus to have consistent menu handling. This commit also simplifies the data->active handling when KEY_SPACE is pressed, and sizeof() parameter. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
8961e93e |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose append entry function Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use append_entry() and append_quit_entry() to construct the menu, so move them out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
a84040ab |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor file selection handling eficonfig_select_file_handler() is commonly used to select the file. eficonfig_display_select_file_option() adds an additional menu to clear the selected file. eficonfig_display_select_file_option() is not always necessary for the file selection process, so it must be outside of eficonfig_select_file_handler(). This commit also renames the following functions to avoid confusion. eficonfig_select_file_handler() -> eficonfig_process_select_file() eficonfig_select_file() -> eficonfig_show_file_selection() eficonfig_display_select_file_option() -> eficonfig_process_show_file_option() Finally, test_eficonfig.py need to be updated to get aligned with the above modification. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
1167e88a |
|
14-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix missing variable initialization The 'ret' variable must be initialized before use in eficonfig_delete_invalid_boot_option(). Fixes: c416f1c0bc ("bootmenu: add removable media entries") Addresses-Coverity: 376207 ("Uninitialized variables") Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
3d595ac5 |
|
09-Nov-2022 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: remove superfluous if in eficonfig_edit_boot_option Goto for an immediately succeeding label is superfluous. Fixes: 87d791423ac6 ("eficonfig: menu-driven addition of UEFI boot option") Addresses-Coverity: 376202 ("Identical code for different branches") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
2c0b0c31 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_SECURE_BOOT This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_SECURE_BOOT defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
83f3d121 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_MM_COMM_TEE This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_MM_COMM_TEE defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
88df3634 |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: CTRL+S to save the boot order 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>
|
#
45f5319f |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
menu: remove CTRL+C to quit On the sandbox called without "--terminal raw" CTRL+C leaves U-Boot, "ESC/CTRL+C to quit" is misleading. Let's remove CTRL+C to quit key handling from bootmenu and eficonfig menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
|
#
8dbd0a0f |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add vertical scroll support The current eficonfig menu does not support vertical scroll, so it can not display the menu entries greater than the console row size. This commit add the vertial scroll support. The console size is retrieved by SIMPLE_TEXT_OUTPUT_PROTOCOL.QueryMode() service, then calculates the row size for menu entry by subtracting menu header and description row size from the console row size. "start" and "end" are added in the efimenu structure. "start" keeps the menu entry index at the top, "end" keeps the bottom menu entry index. item_data_print() menu function only draws the menu entry between "start" and "end". This commit also fixes the issue that "Save" and "Quit" entries can be moved by BKEY_PLUS in change boot order menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
0d590852 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation This commit removes the change boot order specific menu implementation. The change boot order implementation calls eficonfig_process_common() same as other menus. The change boot order menu requires own item_data_print and item_choice implementation, but display_statusline function can be a same function as other menus. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
cd160b27 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor eficonfig_process_common function Current change boot order implementation does not call eficonfig_process_common() and call own menu functions for display_statusline, item_data_print and item_choice. Change boot order functionality should call eficonfig_process_common() to improve maintenanceability. This commit is a preparation to remove the change boot order specific implementation. The menu functions (display_statusline, item_data_print and item_choice) are added as argument of eficonfig_process_common(). The menu description string displayed at the bottom of the menu is also added as argument. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
32bab0ea |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Make use of CLI character processing Avoid duplicating some of the escape-sequence processing here and use the CLI function instead. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
d0ca98db |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Update bootmenu_loop() to return the code Use the return value to save having to pass around a pointer. This also resolves any ambiguity about what *key contains when the function is called. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
2da4a15e |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Rename KEY_... to BKEY_... This enum values conflict with linux/input.h so rename them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
64550274 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: avoid SetVariable between GetNextVariableName calls The current code calls efi_set_variable_int() to delete the invalid boot option between calls to efi_get_next_variable_name_int(), it may produce unpredictable results. This commit moves removal of the invalid boot option outside of the efi_get_next_variable_name_int() calls. EFI_NOT_FOUND returned from efi_get_next_variable_name_int() indicates we retrieved all EFI variables, it should be treated as EFI_SUCEESS. To address the checkpatch warning of too many leading tabs, combine two if statement into one. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
ce327084 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: carve out efi_get_next_variable_name_int calls To retrieve the EFI variable name by efi_get_next_variable_name_int(), the sequence of alloc -> efi_get_next_variable_name_int -> realloc -> efi_get_next_variable_name_int is required. In current code, this sequence repeatedly appears in the several functions. It should be curved out a common function. This commit also fixes the missing free() of var_name16 in eficonfig_delete_invalid_boot_option(). Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
140a8959 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use efi_get_next_variable_name_int() eficonfig command reads all possible UEFI load options from 0x0000 to 0xFFFF to construct the menu. This takes too much time in some environment. This commit uses efi_get_next_variable_name_int() to read all existing UEFI load options to significantlly reduce the count of efi_get_var() call. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
78b1ccc4 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use u16_strsize() to get u16 string buffer size Use u16_strsize() to simplify the u16 string buffer size calculation. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c67d3c9e |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix going one directory up issue The directory name in eficonfig menu entry contains the '\' separator. strcmp() argument ".." is wrong and one directory up handling does not work correctly. strcmp() argument must include '\' separator. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c3b5af63 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add UEFI Secure Boot Key enrollment interface This commit adds the menu-driven UEFI Secure Boot Key enrollment interface. User can enroll PK, KEK, db and dbx by selecting file. Only the signed EFI Signature List(s) with an authenticated header, typically '.auth' file, is accepted. To clear the PK, KEK, db and dbx, user needs to enroll the null key signed by PK or KEK. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
21faf4ef |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use protocol interface for file selection EFI_SIMPLE_FILE_SYSTEM_PROTOCOL is not always provided by U-Boot. Use protocol interface functions instead of U-Boot internal functions. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d6566113 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose eficonfig_create_device_path() Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use eficonfig_create_device_path() to construct the full device path from device path of the volume and file path, so move it out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d571f9b2 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation All the eficonfig menus other than "Change Boot Order" use 'eficonfig_entry' structure for each menu entry. This commit refactors change boot order implementation to use 'eficonfig_entry' structure same as other menus to have consistent menu handling. This commit also simplifies the data->active handling when KEY_SPACE is pressed, and sizeof() parameter. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
8961e93e |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose append entry function Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use append_entry() and append_quit_entry() to construct the menu, so move them out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
a84040ab |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor file selection handling eficonfig_select_file_handler() is commonly used to select the file. eficonfig_display_select_file_option() adds an additional menu to clear the selected file. eficonfig_display_select_file_option() is not always necessary for the file selection process, so it must be outside of eficonfig_select_file_handler(). This commit also renames the following functions to avoid confusion. eficonfig_select_file_handler() -> eficonfig_process_select_file() eficonfig_select_file() -> eficonfig_show_file_selection() eficonfig_display_select_file_option() -> eficonfig_process_show_file_option() Finally, test_eficonfig.py need to be updated to get aligned with the above modification. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
1167e88a |
|
14-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix missing variable initialization The 'ret' variable must be initialized before use in eficonfig_delete_invalid_boot_option(). Fixes: c416f1c0bc ("bootmenu: add removable media entries") Addresses-Coverity: 376207 ("Uninitialized variables") Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
3d595ac5 |
|
09-Nov-2022 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: remove superfluous if in eficonfig_edit_boot_option Goto for an immediately succeeding label is superfluous. Fixes: 87d791423ac6 ("eficonfig: menu-driven addition of UEFI boot option") Addresses-Coverity: 376202 ("Identical code for different branches") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
2c0b0c31 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_SECURE_BOOT This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_SECURE_BOOT defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
83f3d121 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_MM_COMM_TEE This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_MM_COMM_TEE defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
88df3634 |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: CTRL+S to save the boot order 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>
|
#
45f5319f |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
menu: remove CTRL+C to quit On the sandbox called without "--terminal raw" CTRL+C leaves U-Boot, "ESC/CTRL+C to quit" is misleading. Let's remove CTRL+C to quit key handling from bootmenu and eficonfig menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
|
#
8dbd0a0f |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add vertical scroll support The current eficonfig menu does not support vertical scroll, so it can not display the menu entries greater than the console row size. This commit add the vertial scroll support. The console size is retrieved by SIMPLE_TEXT_OUTPUT_PROTOCOL.QueryMode() service, then calculates the row size for menu entry by subtracting menu header and description row size from the console row size. "start" and "end" are added in the efimenu structure. "start" keeps the menu entry index at the top, "end" keeps the bottom menu entry index. item_data_print() menu function only draws the menu entry between "start" and "end". This commit also fixes the issue that "Save" and "Quit" entries can be moved by BKEY_PLUS in change boot order menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
0d590852 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation This commit removes the change boot order specific menu implementation. The change boot order implementation calls eficonfig_process_common() same as other menus. The change boot order menu requires own item_data_print and item_choice implementation, but display_statusline function can be a same function as other menus. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
cd160b27 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor eficonfig_process_common function Current change boot order implementation does not call eficonfig_process_common() and call own menu functions for display_statusline, item_data_print and item_choice. Change boot order functionality should call eficonfig_process_common() to improve maintenanceability. This commit is a preparation to remove the change boot order specific implementation. The menu functions (display_statusline, item_data_print and item_choice) are added as argument of eficonfig_process_common(). The menu description string displayed at the bottom of the menu is also added as argument. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
32bab0ea |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Make use of CLI character processing Avoid duplicating some of the escape-sequence processing here and use the CLI function instead. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
d0ca98db |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Update bootmenu_loop() to return the code Use the return value to save having to pass around a pointer. This also resolves any ambiguity about what *key contains when the function is called. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
2da4a15e |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Rename KEY_... to BKEY_... This enum values conflict with linux/input.h so rename them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
64550274 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: avoid SetVariable between GetNextVariableName calls The current code calls efi_set_variable_int() to delete the invalid boot option between calls to efi_get_next_variable_name_int(), it may produce unpredictable results. This commit moves removal of the invalid boot option outside of the efi_get_next_variable_name_int() calls. EFI_NOT_FOUND returned from efi_get_next_variable_name_int() indicates we retrieved all EFI variables, it should be treated as EFI_SUCEESS. To address the checkpatch warning of too many leading tabs, combine two if statement into one. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
ce327084 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: carve out efi_get_next_variable_name_int calls To retrieve the EFI variable name by efi_get_next_variable_name_int(), the sequence of alloc -> efi_get_next_variable_name_int -> realloc -> efi_get_next_variable_name_int is required. In current code, this sequence repeatedly appears in the several functions. It should be curved out a common function. This commit also fixes the missing free() of var_name16 in eficonfig_delete_invalid_boot_option(). Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
140a8959 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use efi_get_next_variable_name_int() eficonfig command reads all possible UEFI load options from 0x0000 to 0xFFFF to construct the menu. This takes too much time in some environment. This commit uses efi_get_next_variable_name_int() to read all existing UEFI load options to significantlly reduce the count of efi_get_var() call. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
78b1ccc4 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use u16_strsize() to get u16 string buffer size Use u16_strsize() to simplify the u16 string buffer size calculation. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c67d3c9e |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix going one directory up issue The directory name in eficonfig menu entry contains the '\' separator. strcmp() argument ".." is wrong and one directory up handling does not work correctly. strcmp() argument must include '\' separator. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c3b5af63 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add UEFI Secure Boot Key enrollment interface This commit adds the menu-driven UEFI Secure Boot Key enrollment interface. User can enroll PK, KEK, db and dbx by selecting file. Only the signed EFI Signature List(s) with an authenticated header, typically '.auth' file, is accepted. To clear the PK, KEK, db and dbx, user needs to enroll the null key signed by PK or KEK. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
21faf4ef |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use protocol interface for file selection EFI_SIMPLE_FILE_SYSTEM_PROTOCOL is not always provided by U-Boot. Use protocol interface functions instead of U-Boot internal functions. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d6566113 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose eficonfig_create_device_path() Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use eficonfig_create_device_path() to construct the full device path from device path of the volume and file path, so move it out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d571f9b2 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation All the eficonfig menus other than "Change Boot Order" use 'eficonfig_entry' structure for each menu entry. This commit refactors change boot order implementation to use 'eficonfig_entry' structure same as other menus to have consistent menu handling. This commit also simplifies the data->active handling when KEY_SPACE is pressed, and sizeof() parameter. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
8961e93e |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose append entry function Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use append_entry() and append_quit_entry() to construct the menu, so move them out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
a84040ab |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor file selection handling eficonfig_select_file_handler() is commonly used to select the file. eficonfig_display_select_file_option() adds an additional menu to clear the selected file. eficonfig_display_select_file_option() is not always necessary for the file selection process, so it must be outside of eficonfig_select_file_handler(). This commit also renames the following functions to avoid confusion. eficonfig_select_file_handler() -> eficonfig_process_select_file() eficonfig_select_file() -> eficonfig_show_file_selection() eficonfig_display_select_file_option() -> eficonfig_process_show_file_option() Finally, test_eficonfig.py need to be updated to get aligned with the above modification. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
1167e88a |
|
14-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix missing variable initialization The 'ret' variable must be initialized before use in eficonfig_delete_invalid_boot_option(). Fixes: c416f1c0bc ("bootmenu: add removable media entries") Addresses-Coverity: 376207 ("Uninitialized variables") Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
3d595ac5 |
|
09-Nov-2022 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: remove superfluous if in eficonfig_edit_boot_option Goto for an immediately succeeding label is superfluous. Fixes: 87d791423ac6 ("eficonfig: menu-driven addition of UEFI boot option") Addresses-Coverity: 376202 ("Identical code for different branches") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
2c0b0c31 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_SECURE_BOOT This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_SECURE_BOOT defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
83f3d121 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_MM_COMM_TEE This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_MM_COMM_TEE defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
88df3634 |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: CTRL+S to save the boot order 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>
|
#
45f5319f |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
menu: remove CTRL+C to quit On the sandbox called without "--terminal raw" CTRL+C leaves U-Boot, "ESC/CTRL+C to quit" is misleading. Let's remove CTRL+C to quit key handling from bootmenu and eficonfig menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
|
#
8dbd0a0f |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add vertical scroll support The current eficonfig menu does not support vertical scroll, so it can not display the menu entries greater than the console row size. This commit add the vertial scroll support. The console size is retrieved by SIMPLE_TEXT_OUTPUT_PROTOCOL.QueryMode() service, then calculates the row size for menu entry by subtracting menu header and description row size from the console row size. "start" and "end" are added in the efimenu structure. "start" keeps the menu entry index at the top, "end" keeps the bottom menu entry index. item_data_print() menu function only draws the menu entry between "start" and "end". This commit also fixes the issue that "Save" and "Quit" entries can be moved by BKEY_PLUS in change boot order menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
0d590852 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation This commit removes the change boot order specific menu implementation. The change boot order implementation calls eficonfig_process_common() same as other menus. The change boot order menu requires own item_data_print and item_choice implementation, but display_statusline function can be a same function as other menus. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
cd160b27 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor eficonfig_process_common function Current change boot order implementation does not call eficonfig_process_common() and call own menu functions for display_statusline, item_data_print and item_choice. Change boot order functionality should call eficonfig_process_common() to improve maintenanceability. This commit is a preparation to remove the change boot order specific implementation. The menu functions (display_statusline, item_data_print and item_choice) are added as argument of eficonfig_process_common(). The menu description string displayed at the bottom of the menu is also added as argument. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
32bab0ea |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Make use of CLI character processing Avoid duplicating some of the escape-sequence processing here and use the CLI function instead. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
d0ca98db |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Update bootmenu_loop() to return the code Use the return value to save having to pass around a pointer. This also resolves any ambiguity about what *key contains when the function is called. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
2da4a15e |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Rename KEY_... to BKEY_... This enum values conflict with linux/input.h so rename them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
64550274 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: avoid SetVariable between GetNextVariableName calls The current code calls efi_set_variable_int() to delete the invalid boot option between calls to efi_get_next_variable_name_int(), it may produce unpredictable results. This commit moves removal of the invalid boot option outside of the efi_get_next_variable_name_int() calls. EFI_NOT_FOUND returned from efi_get_next_variable_name_int() indicates we retrieved all EFI variables, it should be treated as EFI_SUCEESS. To address the checkpatch warning of too many leading tabs, combine two if statement into one. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
ce327084 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: carve out efi_get_next_variable_name_int calls To retrieve the EFI variable name by efi_get_next_variable_name_int(), the sequence of alloc -> efi_get_next_variable_name_int -> realloc -> efi_get_next_variable_name_int is required. In current code, this sequence repeatedly appears in the several functions. It should be curved out a common function. This commit also fixes the missing free() of var_name16 in eficonfig_delete_invalid_boot_option(). Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
140a8959 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use efi_get_next_variable_name_int() eficonfig command reads all possible UEFI load options from 0x0000 to 0xFFFF to construct the menu. This takes too much time in some environment. This commit uses efi_get_next_variable_name_int() to read all existing UEFI load options to significantlly reduce the count of efi_get_var() call. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
78b1ccc4 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use u16_strsize() to get u16 string buffer size Use u16_strsize() to simplify the u16 string buffer size calculation. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c67d3c9e |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix going one directory up issue The directory name in eficonfig menu entry contains the '\' separator. strcmp() argument ".." is wrong and one directory up handling does not work correctly. strcmp() argument must include '\' separator. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c3b5af63 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add UEFI Secure Boot Key enrollment interface This commit adds the menu-driven UEFI Secure Boot Key enrollment interface. User can enroll PK, KEK, db and dbx by selecting file. Only the signed EFI Signature List(s) with an authenticated header, typically '.auth' file, is accepted. To clear the PK, KEK, db and dbx, user needs to enroll the null key signed by PK or KEK. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
21faf4ef |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use protocol interface for file selection EFI_SIMPLE_FILE_SYSTEM_PROTOCOL is not always provided by U-Boot. Use protocol interface functions instead of U-Boot internal functions. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d6566113 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose eficonfig_create_device_path() Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use eficonfig_create_device_path() to construct the full device path from device path of the volume and file path, so move it out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d571f9b2 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation All the eficonfig menus other than "Change Boot Order" use 'eficonfig_entry' structure for each menu entry. This commit refactors change boot order implementation to use 'eficonfig_entry' structure same as other menus to have consistent menu handling. This commit also simplifies the data->active handling when KEY_SPACE is pressed, and sizeof() parameter. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
8961e93e |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose append entry function Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use append_entry() and append_quit_entry() to construct the menu, so move them out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
a84040ab |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor file selection handling eficonfig_select_file_handler() is commonly used to select the file. eficonfig_display_select_file_option() adds an additional menu to clear the selected file. eficonfig_display_select_file_option() is not always necessary for the file selection process, so it must be outside of eficonfig_select_file_handler(). This commit also renames the following functions to avoid confusion. eficonfig_select_file_handler() -> eficonfig_process_select_file() eficonfig_select_file() -> eficonfig_show_file_selection() eficonfig_display_select_file_option() -> eficonfig_process_show_file_option() Finally, test_eficonfig.py need to be updated to get aligned with the above modification. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
1167e88a |
|
14-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix missing variable initialization The 'ret' variable must be initialized before use in eficonfig_delete_invalid_boot_option(). Fixes: c416f1c0bc ("bootmenu: add removable media entries") Addresses-Coverity: 376207 ("Uninitialized variables") Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
3d595ac5 |
|
09-Nov-2022 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: remove superfluous if in eficonfig_edit_boot_option Goto for an immediately succeeding label is superfluous. Fixes: 87d791423ac6 ("eficonfig: menu-driven addition of UEFI boot option") Addresses-Coverity: 376202 ("Identical code for different branches") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
2c0b0c31 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_SECURE_BOOT This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_SECURE_BOOT defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
83f3d121 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_MM_COMM_TEE This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_MM_COMM_TEE defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
88df3634 |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: CTRL+S to save the boot order 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>
|
#
45f5319f |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
menu: remove CTRL+C to quit On the sandbox called without "--terminal raw" CTRL+C leaves U-Boot, "ESC/CTRL+C to quit" is misleading. Let's remove CTRL+C to quit key handling from bootmenu and eficonfig menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
|
#
8dbd0a0f |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add vertical scroll support The current eficonfig menu does not support vertical scroll, so it can not display the menu entries greater than the console row size. This commit add the vertial scroll support. The console size is retrieved by SIMPLE_TEXT_OUTPUT_PROTOCOL.QueryMode() service, then calculates the row size for menu entry by subtracting menu header and description row size from the console row size. "start" and "end" are added in the efimenu structure. "start" keeps the menu entry index at the top, "end" keeps the bottom menu entry index. item_data_print() menu function only draws the menu entry between "start" and "end". This commit also fixes the issue that "Save" and "Quit" entries can be moved by BKEY_PLUS in change boot order menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
0d590852 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation This commit removes the change boot order specific menu implementation. The change boot order implementation calls eficonfig_process_common() same as other menus. The change boot order menu requires own item_data_print and item_choice implementation, but display_statusline function can be a same function as other menus. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
cd160b27 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor eficonfig_process_common function Current change boot order implementation does not call eficonfig_process_common() and call own menu functions for display_statusline, item_data_print and item_choice. Change boot order functionality should call eficonfig_process_common() to improve maintenanceability. This commit is a preparation to remove the change boot order specific implementation. The menu functions (display_statusline, item_data_print and item_choice) are added as argument of eficonfig_process_common(). The menu description string displayed at the bottom of the menu is also added as argument. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
32bab0ea |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Make use of CLI character processing Avoid duplicating some of the escape-sequence processing here and use the CLI function instead. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
d0ca98db |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Update bootmenu_loop() to return the code Use the return value to save having to pass around a pointer. This also resolves any ambiguity about what *key contains when the function is called. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
2da4a15e |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Rename KEY_... to BKEY_... This enum values conflict with linux/input.h so rename them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
64550274 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: avoid SetVariable between GetNextVariableName calls The current code calls efi_set_variable_int() to delete the invalid boot option between calls to efi_get_next_variable_name_int(), it may produce unpredictable results. This commit moves removal of the invalid boot option outside of the efi_get_next_variable_name_int() calls. EFI_NOT_FOUND returned from efi_get_next_variable_name_int() indicates we retrieved all EFI variables, it should be treated as EFI_SUCEESS. To address the checkpatch warning of too many leading tabs, combine two if statement into one. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
ce327084 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: carve out efi_get_next_variable_name_int calls To retrieve the EFI variable name by efi_get_next_variable_name_int(), the sequence of alloc -> efi_get_next_variable_name_int -> realloc -> efi_get_next_variable_name_int is required. In current code, this sequence repeatedly appears in the several functions. It should be curved out a common function. This commit also fixes the missing free() of var_name16 in eficonfig_delete_invalid_boot_option(). Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
140a8959 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use efi_get_next_variable_name_int() eficonfig command reads all possible UEFI load options from 0x0000 to 0xFFFF to construct the menu. This takes too much time in some environment. This commit uses efi_get_next_variable_name_int() to read all existing UEFI load options to significantlly reduce the count of efi_get_var() call. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
78b1ccc4 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use u16_strsize() to get u16 string buffer size Use u16_strsize() to simplify the u16 string buffer size calculation. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c67d3c9e |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix going one directory up issue The directory name in eficonfig menu entry contains the '\' separator. strcmp() argument ".." is wrong and one directory up handling does not work correctly. strcmp() argument must include '\' separator. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c3b5af63 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add UEFI Secure Boot Key enrollment interface This commit adds the menu-driven UEFI Secure Boot Key enrollment interface. User can enroll PK, KEK, db and dbx by selecting file. Only the signed EFI Signature List(s) with an authenticated header, typically '.auth' file, is accepted. To clear the PK, KEK, db and dbx, user needs to enroll the null key signed by PK or KEK. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
21faf4ef |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use protocol interface for file selection EFI_SIMPLE_FILE_SYSTEM_PROTOCOL is not always provided by U-Boot. Use protocol interface functions instead of U-Boot internal functions. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d6566113 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose eficonfig_create_device_path() Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use eficonfig_create_device_path() to construct the full device path from device path of the volume and file path, so move it out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d571f9b2 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation All the eficonfig menus other than "Change Boot Order" use 'eficonfig_entry' structure for each menu entry. This commit refactors change boot order implementation to use 'eficonfig_entry' structure same as other menus to have consistent menu handling. This commit also simplifies the data->active handling when KEY_SPACE is pressed, and sizeof() parameter. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
8961e93e |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose append entry function Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use append_entry() and append_quit_entry() to construct the menu, so move them out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
a84040ab |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor file selection handling eficonfig_select_file_handler() is commonly used to select the file. eficonfig_display_select_file_option() adds an additional menu to clear the selected file. eficonfig_display_select_file_option() is not always necessary for the file selection process, so it must be outside of eficonfig_select_file_handler(). This commit also renames the following functions to avoid confusion. eficonfig_select_file_handler() -> eficonfig_process_select_file() eficonfig_select_file() -> eficonfig_show_file_selection() eficonfig_display_select_file_option() -> eficonfig_process_show_file_option() Finally, test_eficonfig.py need to be updated to get aligned with the above modification. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
1167e88a |
|
14-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix missing variable initialization The 'ret' variable must be initialized before use in eficonfig_delete_invalid_boot_option(). Fixes: c416f1c0bc ("bootmenu: add removable media entries") Addresses-Coverity: 376207 ("Uninitialized variables") Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
3d595ac5 |
|
09-Nov-2022 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: remove superfluous if in eficonfig_edit_boot_option Goto for an immediately succeeding label is superfluous. Fixes: 87d791423ac6 ("eficonfig: menu-driven addition of UEFI boot option") Addresses-Coverity: 376202 ("Identical code for different branches") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
2c0b0c31 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_SECURE_BOOT This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_SECURE_BOOT defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
83f3d121 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_MM_COMM_TEE This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_MM_COMM_TEE defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
88df3634 |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: CTRL+S to save the boot order 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>
|
#
45f5319f |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
menu: remove CTRL+C to quit On the sandbox called without "--terminal raw" CTRL+C leaves U-Boot, "ESC/CTRL+C to quit" is misleading. Let's remove CTRL+C to quit key handling from bootmenu and eficonfig menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
|
#
8dbd0a0f |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add vertical scroll support The current eficonfig menu does not support vertical scroll, so it can not display the menu entries greater than the console row size. This commit add the vertial scroll support. The console size is retrieved by SIMPLE_TEXT_OUTPUT_PROTOCOL.QueryMode() service, then calculates the row size for menu entry by subtracting menu header and description row size from the console row size. "start" and "end" are added in the efimenu structure. "start" keeps the menu entry index at the top, "end" keeps the bottom menu entry index. item_data_print() menu function only draws the menu entry between "start" and "end". This commit also fixes the issue that "Save" and "Quit" entries can be moved by BKEY_PLUS in change boot order menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
0d590852 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation This commit removes the change boot order specific menu implementation. The change boot order implementation calls eficonfig_process_common() same as other menus. The change boot order menu requires own item_data_print and item_choice implementation, but display_statusline function can be a same function as other menus. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
cd160b27 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor eficonfig_process_common function Current change boot order implementation does not call eficonfig_process_common() and call own menu functions for display_statusline, item_data_print and item_choice. Change boot order functionality should call eficonfig_process_common() to improve maintenanceability. This commit is a preparation to remove the change boot order specific implementation. The menu functions (display_statusline, item_data_print and item_choice) are added as argument of eficonfig_process_common(). The menu description string displayed at the bottom of the menu is also added as argument. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
32bab0ea |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Make use of CLI character processing Avoid duplicating some of the escape-sequence processing here and use the CLI function instead. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
d0ca98db |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Update bootmenu_loop() to return the code Use the return value to save having to pass around a pointer. This also resolves any ambiguity about what *key contains when the function is called. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
2da4a15e |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Rename KEY_... to BKEY_... This enum values conflict with linux/input.h so rename them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
64550274 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: avoid SetVariable between GetNextVariableName calls The current code calls efi_set_variable_int() to delete the invalid boot option between calls to efi_get_next_variable_name_int(), it may produce unpredictable results. This commit moves removal of the invalid boot option outside of the efi_get_next_variable_name_int() calls. EFI_NOT_FOUND returned from efi_get_next_variable_name_int() indicates we retrieved all EFI variables, it should be treated as EFI_SUCEESS. To address the checkpatch warning of too many leading tabs, combine two if statement into one. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
ce327084 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: carve out efi_get_next_variable_name_int calls To retrieve the EFI variable name by efi_get_next_variable_name_int(), the sequence of alloc -> efi_get_next_variable_name_int -> realloc -> efi_get_next_variable_name_int is required. In current code, this sequence repeatedly appears in the several functions. It should be curved out a common function. This commit also fixes the missing free() of var_name16 in eficonfig_delete_invalid_boot_option(). Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
140a8959 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use efi_get_next_variable_name_int() eficonfig command reads all possible UEFI load options from 0x0000 to 0xFFFF to construct the menu. This takes too much time in some environment. This commit uses efi_get_next_variable_name_int() to read all existing UEFI load options to significantlly reduce the count of efi_get_var() call. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
78b1ccc4 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use u16_strsize() to get u16 string buffer size Use u16_strsize() to simplify the u16 string buffer size calculation. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c67d3c9e |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix going one directory up issue The directory name in eficonfig menu entry contains the '\' separator. strcmp() argument ".." is wrong and one directory up handling does not work correctly. strcmp() argument must include '\' separator. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c3b5af63 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add UEFI Secure Boot Key enrollment interface This commit adds the menu-driven UEFI Secure Boot Key enrollment interface. User can enroll PK, KEK, db and dbx by selecting file. Only the signed EFI Signature List(s) with an authenticated header, typically '.auth' file, is accepted. To clear the PK, KEK, db and dbx, user needs to enroll the null key signed by PK or KEK. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
21faf4ef |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use protocol interface for file selection EFI_SIMPLE_FILE_SYSTEM_PROTOCOL is not always provided by U-Boot. Use protocol interface functions instead of U-Boot internal functions. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d6566113 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose eficonfig_create_device_path() Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use eficonfig_create_device_path() to construct the full device path from device path of the volume and file path, so move it out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d571f9b2 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation All the eficonfig menus other than "Change Boot Order" use 'eficonfig_entry' structure for each menu entry. This commit refactors change boot order implementation to use 'eficonfig_entry' structure same as other menus to have consistent menu handling. This commit also simplifies the data->active handling when KEY_SPACE is pressed, and sizeof() parameter. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
8961e93e |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose append entry function Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use append_entry() and append_quit_entry() to construct the menu, so move them out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
a84040ab |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor file selection handling eficonfig_select_file_handler() is commonly used to select the file. eficonfig_display_select_file_option() adds an additional menu to clear the selected file. eficonfig_display_select_file_option() is not always necessary for the file selection process, so it must be outside of eficonfig_select_file_handler(). This commit also renames the following functions to avoid confusion. eficonfig_select_file_handler() -> eficonfig_process_select_file() eficonfig_select_file() -> eficonfig_show_file_selection() eficonfig_display_select_file_option() -> eficonfig_process_show_file_option() Finally, test_eficonfig.py need to be updated to get aligned with the above modification. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
1167e88a |
|
14-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix missing variable initialization The 'ret' variable must be initialized before use in eficonfig_delete_invalid_boot_option(). Fixes: c416f1c0bc ("bootmenu: add removable media entries") Addresses-Coverity: 376207 ("Uninitialized variables") Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
3d595ac5 |
|
09-Nov-2022 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: remove superfluous if in eficonfig_edit_boot_option Goto for an immediately succeeding label is superfluous. Fixes: 87d791423ac6 ("eficonfig: menu-driven addition of UEFI boot option") Addresses-Coverity: 376202 ("Identical code for different branches") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
2c0b0c31 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_SECURE_BOOT This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_SECURE_BOOT defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
83f3d121 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_MM_COMM_TEE This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_MM_COMM_TEE defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
88df3634 |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: CTRL+S to save the boot order 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>
|
#
45f5319f |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
menu: remove CTRL+C to quit On the sandbox called without "--terminal raw" CTRL+C leaves U-Boot, "ESC/CTRL+C to quit" is misleading. Let's remove CTRL+C to quit key handling from bootmenu and eficonfig menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
|
#
8dbd0a0f |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add vertical scroll support The current eficonfig menu does not support vertical scroll, so it can not display the menu entries greater than the console row size. This commit add the vertial scroll support. The console size is retrieved by SIMPLE_TEXT_OUTPUT_PROTOCOL.QueryMode() service, then calculates the row size for menu entry by subtracting menu header and description row size from the console row size. "start" and "end" are added in the efimenu structure. "start" keeps the menu entry index at the top, "end" keeps the bottom menu entry index. item_data_print() menu function only draws the menu entry between "start" and "end". This commit also fixes the issue that "Save" and "Quit" entries can be moved by BKEY_PLUS in change boot order menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
0d590852 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation This commit removes the change boot order specific menu implementation. The change boot order implementation calls eficonfig_process_common() same as other menus. The change boot order menu requires own item_data_print and item_choice implementation, but display_statusline function can be a same function as other menus. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
cd160b27 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor eficonfig_process_common function Current change boot order implementation does not call eficonfig_process_common() and call own menu functions for display_statusline, item_data_print and item_choice. Change boot order functionality should call eficonfig_process_common() to improve maintenanceability. This commit is a preparation to remove the change boot order specific implementation. The menu functions (display_statusline, item_data_print and item_choice) are added as argument of eficonfig_process_common(). The menu description string displayed at the bottom of the menu is also added as argument. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
32bab0ea |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Make use of CLI character processing Avoid duplicating some of the escape-sequence processing here and use the CLI function instead. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
d0ca98db |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Update bootmenu_loop() to return the code Use the return value to save having to pass around a pointer. This also resolves any ambiguity about what *key contains when the function is called. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
2da4a15e |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Rename KEY_... to BKEY_... This enum values conflict with linux/input.h so rename them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
64550274 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: avoid SetVariable between GetNextVariableName calls The current code calls efi_set_variable_int() to delete the invalid boot option between calls to efi_get_next_variable_name_int(), it may produce unpredictable results. This commit moves removal of the invalid boot option outside of the efi_get_next_variable_name_int() calls. EFI_NOT_FOUND returned from efi_get_next_variable_name_int() indicates we retrieved all EFI variables, it should be treated as EFI_SUCEESS. To address the checkpatch warning of too many leading tabs, combine two if statement into one. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
ce327084 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: carve out efi_get_next_variable_name_int calls To retrieve the EFI variable name by efi_get_next_variable_name_int(), the sequence of alloc -> efi_get_next_variable_name_int -> realloc -> efi_get_next_variable_name_int is required. In current code, this sequence repeatedly appears in the several functions. It should be curved out a common function. This commit also fixes the missing free() of var_name16 in eficonfig_delete_invalid_boot_option(). Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
140a8959 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use efi_get_next_variable_name_int() eficonfig command reads all possible UEFI load options from 0x0000 to 0xFFFF to construct the menu. This takes too much time in some environment. This commit uses efi_get_next_variable_name_int() to read all existing UEFI load options to significantlly reduce the count of efi_get_var() call. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
78b1ccc4 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use u16_strsize() to get u16 string buffer size Use u16_strsize() to simplify the u16 string buffer size calculation. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c67d3c9e |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix going one directory up issue The directory name in eficonfig menu entry contains the '\' separator. strcmp() argument ".." is wrong and one directory up handling does not work correctly. strcmp() argument must include '\' separator. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c3b5af63 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add UEFI Secure Boot Key enrollment interface This commit adds the menu-driven UEFI Secure Boot Key enrollment interface. User can enroll PK, KEK, db and dbx by selecting file. Only the signed EFI Signature List(s) with an authenticated header, typically '.auth' file, is accepted. To clear the PK, KEK, db and dbx, user needs to enroll the null key signed by PK or KEK. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
21faf4ef |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use protocol interface for file selection EFI_SIMPLE_FILE_SYSTEM_PROTOCOL is not always provided by U-Boot. Use protocol interface functions instead of U-Boot internal functions. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d6566113 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose eficonfig_create_device_path() Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use eficonfig_create_device_path() to construct the full device path from device path of the volume and file path, so move it out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d571f9b2 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation All the eficonfig menus other than "Change Boot Order" use 'eficonfig_entry' structure for each menu entry. This commit refactors change boot order implementation to use 'eficonfig_entry' structure same as other menus to have consistent menu handling. This commit also simplifies the data->active handling when KEY_SPACE is pressed, and sizeof() parameter. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
8961e93e |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose append entry function Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use append_entry() and append_quit_entry() to construct the menu, so move them out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
a84040ab |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor file selection handling eficonfig_select_file_handler() is commonly used to select the file. eficonfig_display_select_file_option() adds an additional menu to clear the selected file. eficonfig_display_select_file_option() is not always necessary for the file selection process, so it must be outside of eficonfig_select_file_handler(). This commit also renames the following functions to avoid confusion. eficonfig_select_file_handler() -> eficonfig_process_select_file() eficonfig_select_file() -> eficonfig_show_file_selection() eficonfig_display_select_file_option() -> eficonfig_process_show_file_option() Finally, test_eficonfig.py need to be updated to get aligned with the above modification. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
1167e88a |
|
14-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix missing variable initialization The 'ret' variable must be initialized before use in eficonfig_delete_invalid_boot_option(). Fixes: c416f1c0bc ("bootmenu: add removable media entries") Addresses-Coverity: 376207 ("Uninitialized variables") Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
3d595ac5 |
|
09-Nov-2022 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: remove superfluous if in eficonfig_edit_boot_option Goto for an immediately succeeding label is superfluous. Fixes: 87d791423ac6 ("eficonfig: menu-driven addition of UEFI boot option") Addresses-Coverity: 376202 ("Identical code for different branches") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
2c0b0c31 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_SECURE_BOOT This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_SECURE_BOOT defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
83f3d121 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_MM_COMM_TEE This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_MM_COMM_TEE defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
88df3634 |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: CTRL+S to save the boot order 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>
|
#
45f5319f |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
menu: remove CTRL+C to quit On the sandbox called without "--terminal raw" CTRL+C leaves U-Boot, "ESC/CTRL+C to quit" is misleading. Let's remove CTRL+C to quit key handling from bootmenu and eficonfig menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
|
#
8dbd0a0f |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add vertical scroll support The current eficonfig menu does not support vertical scroll, so it can not display the menu entries greater than the console row size. This commit add the vertial scroll support. The console size is retrieved by SIMPLE_TEXT_OUTPUT_PROTOCOL.QueryMode() service, then calculates the row size for menu entry by subtracting menu header and description row size from the console row size. "start" and "end" are added in the efimenu structure. "start" keeps the menu entry index at the top, "end" keeps the bottom menu entry index. item_data_print() menu function only draws the menu entry between "start" and "end". This commit also fixes the issue that "Save" and "Quit" entries can be moved by BKEY_PLUS in change boot order menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
0d590852 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation This commit removes the change boot order specific menu implementation. The change boot order implementation calls eficonfig_process_common() same as other menus. The change boot order menu requires own item_data_print and item_choice implementation, but display_statusline function can be a same function as other menus. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
cd160b27 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor eficonfig_process_common function Current change boot order implementation does not call eficonfig_process_common() and call own menu functions for display_statusline, item_data_print and item_choice. Change boot order functionality should call eficonfig_process_common() to improve maintenanceability. This commit is a preparation to remove the change boot order specific implementation. The menu functions (display_statusline, item_data_print and item_choice) are added as argument of eficonfig_process_common(). The menu description string displayed at the bottom of the menu is also added as argument. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
32bab0ea |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Make use of CLI character processing Avoid duplicating some of the escape-sequence processing here and use the CLI function instead. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
d0ca98db |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Update bootmenu_loop() to return the code Use the return value to save having to pass around a pointer. This also resolves any ambiguity about what *key contains when the function is called. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
2da4a15e |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Rename KEY_... to BKEY_... This enum values conflict with linux/input.h so rename them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
64550274 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: avoid SetVariable between GetNextVariableName calls The current code calls efi_set_variable_int() to delete the invalid boot option between calls to efi_get_next_variable_name_int(), it may produce unpredictable results. This commit moves removal of the invalid boot option outside of the efi_get_next_variable_name_int() calls. EFI_NOT_FOUND returned from efi_get_next_variable_name_int() indicates we retrieved all EFI variables, it should be treated as EFI_SUCEESS. To address the checkpatch warning of too many leading tabs, combine two if statement into one. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
ce327084 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: carve out efi_get_next_variable_name_int calls To retrieve the EFI variable name by efi_get_next_variable_name_int(), the sequence of alloc -> efi_get_next_variable_name_int -> realloc -> efi_get_next_variable_name_int is required. In current code, this sequence repeatedly appears in the several functions. It should be curved out a common function. This commit also fixes the missing free() of var_name16 in eficonfig_delete_invalid_boot_option(). Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
140a8959 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use efi_get_next_variable_name_int() eficonfig command reads all possible UEFI load options from 0x0000 to 0xFFFF to construct the menu. This takes too much time in some environment. This commit uses efi_get_next_variable_name_int() to read all existing UEFI load options to significantlly reduce the count of efi_get_var() call. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
78b1ccc4 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use u16_strsize() to get u16 string buffer size Use u16_strsize() to simplify the u16 string buffer size calculation. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c67d3c9e |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix going one directory up issue The directory name in eficonfig menu entry contains the '\' separator. strcmp() argument ".." is wrong and one directory up handling does not work correctly. strcmp() argument must include '\' separator. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c3b5af63 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add UEFI Secure Boot Key enrollment interface This commit adds the menu-driven UEFI Secure Boot Key enrollment interface. User can enroll PK, KEK, db and dbx by selecting file. Only the signed EFI Signature List(s) with an authenticated header, typically '.auth' file, is accepted. To clear the PK, KEK, db and dbx, user needs to enroll the null key signed by PK or KEK. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
21faf4ef |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use protocol interface for file selection EFI_SIMPLE_FILE_SYSTEM_PROTOCOL is not always provided by U-Boot. Use protocol interface functions instead of U-Boot internal functions. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d6566113 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose eficonfig_create_device_path() Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use eficonfig_create_device_path() to construct the full device path from device path of the volume and file path, so move it out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d571f9b2 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation All the eficonfig menus other than "Change Boot Order" use 'eficonfig_entry' structure for each menu entry. This commit refactors change boot order implementation to use 'eficonfig_entry' structure same as other menus to have consistent menu handling. This commit also simplifies the data->active handling when KEY_SPACE is pressed, and sizeof() parameter. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
8961e93e |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose append entry function Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use append_entry() and append_quit_entry() to construct the menu, so move them out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
a84040ab |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor file selection handling eficonfig_select_file_handler() is commonly used to select the file. eficonfig_display_select_file_option() adds an additional menu to clear the selected file. eficonfig_display_select_file_option() is not always necessary for the file selection process, so it must be outside of eficonfig_select_file_handler(). This commit also renames the following functions to avoid confusion. eficonfig_select_file_handler() -> eficonfig_process_select_file() eficonfig_select_file() -> eficonfig_show_file_selection() eficonfig_display_select_file_option() -> eficonfig_process_show_file_option() Finally, test_eficonfig.py need to be updated to get aligned with the above modification. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
1167e88a |
|
14-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix missing variable initialization The 'ret' variable must be initialized before use in eficonfig_delete_invalid_boot_option(). Fixes: c416f1c0bc ("bootmenu: add removable media entries") Addresses-Coverity: 376207 ("Uninitialized variables") Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
3d595ac5 |
|
09-Nov-2022 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: remove superfluous if in eficonfig_edit_boot_option Goto for an immediately succeeding label is superfluous. Fixes: 87d791423ac6 ("eficonfig: menu-driven addition of UEFI boot option") Addresses-Coverity: 376202 ("Identical code for different branches") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
2c0b0c31 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_SECURE_BOOT This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_SECURE_BOOT defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
83f3d121 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_MM_COMM_TEE This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_MM_COMM_TEE defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
88df3634 |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: CTRL+S to save the boot order 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>
|
#
45f5319f |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
menu: remove CTRL+C to quit On the sandbox called without "--terminal raw" CTRL+C leaves U-Boot, "ESC/CTRL+C to quit" is misleading. Let's remove CTRL+C to quit key handling from bootmenu and eficonfig menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
|
#
8dbd0a0f |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add vertical scroll support The current eficonfig menu does not support vertical scroll, so it can not display the menu entries greater than the console row size. This commit add the vertial scroll support. The console size is retrieved by SIMPLE_TEXT_OUTPUT_PROTOCOL.QueryMode() service, then calculates the row size for menu entry by subtracting menu header and description row size from the console row size. "start" and "end" are added in the efimenu structure. "start" keeps the menu entry index at the top, "end" keeps the bottom menu entry index. item_data_print() menu function only draws the menu entry between "start" and "end". This commit also fixes the issue that "Save" and "Quit" entries can be moved by BKEY_PLUS in change boot order menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
0d590852 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation This commit removes the change boot order specific menu implementation. The change boot order implementation calls eficonfig_process_common() same as other menus. The change boot order menu requires own item_data_print and item_choice implementation, but display_statusline function can be a same function as other menus. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
cd160b27 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor eficonfig_process_common function Current change boot order implementation does not call eficonfig_process_common() and call own menu functions for display_statusline, item_data_print and item_choice. Change boot order functionality should call eficonfig_process_common() to improve maintenanceability. This commit is a preparation to remove the change boot order specific implementation. The menu functions (display_statusline, item_data_print and item_choice) are added as argument of eficonfig_process_common(). The menu description string displayed at the bottom of the menu is also added as argument. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
32bab0ea |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Make use of CLI character processing Avoid duplicating some of the escape-sequence processing here and use the CLI function instead. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
d0ca98db |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Update bootmenu_loop() to return the code Use the return value to save having to pass around a pointer. This also resolves any ambiguity about what *key contains when the function is called. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
2da4a15e |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Rename KEY_... to BKEY_... This enum values conflict with linux/input.h so rename them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
64550274 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: avoid SetVariable between GetNextVariableName calls The current code calls efi_set_variable_int() to delete the invalid boot option between calls to efi_get_next_variable_name_int(), it may produce unpredictable results. This commit moves removal of the invalid boot option outside of the efi_get_next_variable_name_int() calls. EFI_NOT_FOUND returned from efi_get_next_variable_name_int() indicates we retrieved all EFI variables, it should be treated as EFI_SUCEESS. To address the checkpatch warning of too many leading tabs, combine two if statement into one. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
ce327084 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: carve out efi_get_next_variable_name_int calls To retrieve the EFI variable name by efi_get_next_variable_name_int(), the sequence of alloc -> efi_get_next_variable_name_int -> realloc -> efi_get_next_variable_name_int is required. In current code, this sequence repeatedly appears in the several functions. It should be curved out a common function. This commit also fixes the missing free() of var_name16 in eficonfig_delete_invalid_boot_option(). Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
140a8959 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use efi_get_next_variable_name_int() eficonfig command reads all possible UEFI load options from 0x0000 to 0xFFFF to construct the menu. This takes too much time in some environment. This commit uses efi_get_next_variable_name_int() to read all existing UEFI load options to significantlly reduce the count of efi_get_var() call. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
78b1ccc4 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use u16_strsize() to get u16 string buffer size Use u16_strsize() to simplify the u16 string buffer size calculation. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c67d3c9e |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix going one directory up issue The directory name in eficonfig menu entry contains the '\' separator. strcmp() argument ".." is wrong and one directory up handling does not work correctly. strcmp() argument must include '\' separator. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c3b5af63 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add UEFI Secure Boot Key enrollment interface This commit adds the menu-driven UEFI Secure Boot Key enrollment interface. User can enroll PK, KEK, db and dbx by selecting file. Only the signed EFI Signature List(s) with an authenticated header, typically '.auth' file, is accepted. To clear the PK, KEK, db and dbx, user needs to enroll the null key signed by PK or KEK. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
21faf4ef |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use protocol interface for file selection EFI_SIMPLE_FILE_SYSTEM_PROTOCOL is not always provided by U-Boot. Use protocol interface functions instead of U-Boot internal functions. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d6566113 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose eficonfig_create_device_path() Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use eficonfig_create_device_path() to construct the full device path from device path of the volume and file path, so move it out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d571f9b2 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation All the eficonfig menus other than "Change Boot Order" use 'eficonfig_entry' structure for each menu entry. This commit refactors change boot order implementation to use 'eficonfig_entry' structure same as other menus to have consistent menu handling. This commit also simplifies the data->active handling when KEY_SPACE is pressed, and sizeof() parameter. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
8961e93e |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose append entry function Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use append_entry() and append_quit_entry() to construct the menu, so move them out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
a84040ab |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor file selection handling eficonfig_select_file_handler() is commonly used to select the file. eficonfig_display_select_file_option() adds an additional menu to clear the selected file. eficonfig_display_select_file_option() is not always necessary for the file selection process, so it must be outside of eficonfig_select_file_handler(). This commit also renames the following functions to avoid confusion. eficonfig_select_file_handler() -> eficonfig_process_select_file() eficonfig_select_file() -> eficonfig_show_file_selection() eficonfig_display_select_file_option() -> eficonfig_process_show_file_option() Finally, test_eficonfig.py need to be updated to get aligned with the above modification. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
1167e88a |
|
14-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix missing variable initialization The 'ret' variable must be initialized before use in eficonfig_delete_invalid_boot_option(). Fixes: c416f1c0bc ("bootmenu: add removable media entries") Addresses-Coverity: 376207 ("Uninitialized variables") Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
3d595ac5 |
|
09-Nov-2022 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: remove superfluous if in eficonfig_edit_boot_option Goto for an immediately succeeding label is superfluous. Fixes: 87d791423ac6 ("eficonfig: menu-driven addition of UEFI boot option") Addresses-Coverity: 376202 ("Identical code for different branches") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
2c0b0c31 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_SECURE_BOOT This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_SECURE_BOOT defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
83f3d121 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_MM_COMM_TEE This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_MM_COMM_TEE defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
88df3634 |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: CTRL+S to save the boot order 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>
|
#
45f5319f |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
menu: remove CTRL+C to quit On the sandbox called without "--terminal raw" CTRL+C leaves U-Boot, "ESC/CTRL+C to quit" is misleading. Let's remove CTRL+C to quit key handling from bootmenu and eficonfig menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
|
#
8dbd0a0f |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add vertical scroll support The current eficonfig menu does not support vertical scroll, so it can not display the menu entries greater than the console row size. This commit add the vertial scroll support. The console size is retrieved by SIMPLE_TEXT_OUTPUT_PROTOCOL.QueryMode() service, then calculates the row size for menu entry by subtracting menu header and description row size from the console row size. "start" and "end" are added in the efimenu structure. "start" keeps the menu entry index at the top, "end" keeps the bottom menu entry index. item_data_print() menu function only draws the menu entry between "start" and "end". This commit also fixes the issue that "Save" and "Quit" entries can be moved by BKEY_PLUS in change boot order menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
0d590852 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation This commit removes the change boot order specific menu implementation. The change boot order implementation calls eficonfig_process_common() same as other menus. The change boot order menu requires own item_data_print and item_choice implementation, but display_statusline function can be a same function as other menus. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
cd160b27 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor eficonfig_process_common function Current change boot order implementation does not call eficonfig_process_common() and call own menu functions for display_statusline, item_data_print and item_choice. Change boot order functionality should call eficonfig_process_common() to improve maintenanceability. This commit is a preparation to remove the change boot order specific implementation. The menu functions (display_statusline, item_data_print and item_choice) are added as argument of eficonfig_process_common(). The menu description string displayed at the bottom of the menu is also added as argument. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
32bab0ea |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Make use of CLI character processing Avoid duplicating some of the escape-sequence processing here and use the CLI function instead. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
d0ca98db |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Update bootmenu_loop() to return the code Use the return value to save having to pass around a pointer. This also resolves any ambiguity about what *key contains when the function is called. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
2da4a15e |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Rename KEY_... to BKEY_... This enum values conflict with linux/input.h so rename them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
64550274 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: avoid SetVariable between GetNextVariableName calls The current code calls efi_set_variable_int() to delete the invalid boot option between calls to efi_get_next_variable_name_int(), it may produce unpredictable results. This commit moves removal of the invalid boot option outside of the efi_get_next_variable_name_int() calls. EFI_NOT_FOUND returned from efi_get_next_variable_name_int() indicates we retrieved all EFI variables, it should be treated as EFI_SUCEESS. To address the checkpatch warning of too many leading tabs, combine two if statement into one. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
ce327084 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: carve out efi_get_next_variable_name_int calls To retrieve the EFI variable name by efi_get_next_variable_name_int(), the sequence of alloc -> efi_get_next_variable_name_int -> realloc -> efi_get_next_variable_name_int is required. In current code, this sequence repeatedly appears in the several functions. It should be curved out a common function. This commit also fixes the missing free() of var_name16 in eficonfig_delete_invalid_boot_option(). Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
140a8959 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use efi_get_next_variable_name_int() eficonfig command reads all possible UEFI load options from 0x0000 to 0xFFFF to construct the menu. This takes too much time in some environment. This commit uses efi_get_next_variable_name_int() to read all existing UEFI load options to significantlly reduce the count of efi_get_var() call. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
78b1ccc4 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use u16_strsize() to get u16 string buffer size Use u16_strsize() to simplify the u16 string buffer size calculation. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c67d3c9e |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix going one directory up issue The directory name in eficonfig menu entry contains the '\' separator. strcmp() argument ".." is wrong and one directory up handling does not work correctly. strcmp() argument must include '\' separator. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c3b5af63 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add UEFI Secure Boot Key enrollment interface This commit adds the menu-driven UEFI Secure Boot Key enrollment interface. User can enroll PK, KEK, db and dbx by selecting file. Only the signed EFI Signature List(s) with an authenticated header, typically '.auth' file, is accepted. To clear the PK, KEK, db and dbx, user needs to enroll the null key signed by PK or KEK. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
21faf4ef |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use protocol interface for file selection EFI_SIMPLE_FILE_SYSTEM_PROTOCOL is not always provided by U-Boot. Use protocol interface functions instead of U-Boot internal functions. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d6566113 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose eficonfig_create_device_path() Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use eficonfig_create_device_path() to construct the full device path from device path of the volume and file path, so move it out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d571f9b2 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation All the eficonfig menus other than "Change Boot Order" use 'eficonfig_entry' structure for each menu entry. This commit refactors change boot order implementation to use 'eficonfig_entry' structure same as other menus to have consistent menu handling. This commit also simplifies the data->active handling when KEY_SPACE is pressed, and sizeof() parameter. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
8961e93e |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose append entry function Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use append_entry() and append_quit_entry() to construct the menu, so move them out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
a84040ab |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor file selection handling eficonfig_select_file_handler() is commonly used to select the file. eficonfig_display_select_file_option() adds an additional menu to clear the selected file. eficonfig_display_select_file_option() is not always necessary for the file selection process, so it must be outside of eficonfig_select_file_handler(). This commit also renames the following functions to avoid confusion. eficonfig_select_file_handler() -> eficonfig_process_select_file() eficonfig_select_file() -> eficonfig_show_file_selection() eficonfig_display_select_file_option() -> eficonfig_process_show_file_option() Finally, test_eficonfig.py need to be updated to get aligned with the above modification. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
1167e88a |
|
14-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix missing variable initialization The 'ret' variable must be initialized before use in eficonfig_delete_invalid_boot_option(). Fixes: c416f1c0bc ("bootmenu: add removable media entries") Addresses-Coverity: 376207 ("Uninitialized variables") Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
3d595ac5 |
|
09-Nov-2022 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: remove superfluous if in eficonfig_edit_boot_option Goto for an immediately succeeding label is superfluous. Fixes: 87d791423ac6 ("eficonfig: menu-driven addition of UEFI boot option") Addresses-Coverity: 376202 ("Identical code for different branches") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
2c0b0c31 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_SECURE_BOOT This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_SECURE_BOOT defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
83f3d121 |
|
05-Feb-2023 |
Simon Glass <sjg@chromium.org> |
Correct SPL use of EFI_MM_COMM_TEE This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_MM_COMM_TEE defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
88df3634 |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: CTRL+S to save the boot order 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>
|
#
45f5319f |
|
02-Feb-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
menu: remove CTRL+C to quit On the sandbox called without "--terminal raw" CTRL+C leaves U-Boot, "ESC/CTRL+C to quit" is misleading. Let's remove CTRL+C to quit key handling from bootmenu and eficonfig menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
|
#
8dbd0a0f |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add vertical scroll support The current eficonfig menu does not support vertical scroll, so it can not display the menu entries greater than the console row size. This commit add the vertial scroll support. The console size is retrieved by SIMPLE_TEXT_OUTPUT_PROTOCOL.QueryMode() service, then calculates the row size for menu entry by subtracting menu header and description row size from the console row size. "start" and "end" are added in the efimenu structure. "start" keeps the menu entry index at the top, "end" keeps the bottom menu entry index. item_data_print() menu function only draws the menu entry between "start" and "end". This commit also fixes the issue that "Save" and "Quit" entries can be moved by BKEY_PLUS in change boot order menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
0d590852 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation This commit removes the change boot order specific menu implementation. The change boot order implementation calls eficonfig_process_common() same as other menus. The change boot order menu requires own item_data_print and item_choice implementation, but display_statusline function can be a same function as other menus. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
cd160b27 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor eficonfig_process_common function Current change boot order implementation does not call eficonfig_process_common() and call own menu functions for display_statusline, item_data_print and item_choice. Change boot order functionality should call eficonfig_process_common() to improve maintenanceability. This commit is a preparation to remove the change boot order specific implementation. The menu functions (display_statusline, item_data_print and item_choice) are added as argument of eficonfig_process_common(). The menu description string displayed at the bottom of the menu is also added as argument. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
32bab0ea |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Make use of CLI character processing Avoid duplicating some of the escape-sequence processing here and use the CLI function instead. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
d0ca98db |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Update bootmenu_loop() to return the code Use the return value to save having to pass around a pointer. This also resolves any ambiguity about what *key contains when the function is called. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
2da4a15e |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Rename KEY_... to BKEY_... This enum values conflict with linux/input.h so rename them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
64550274 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: avoid SetVariable between GetNextVariableName calls The current code calls efi_set_variable_int() to delete the invalid boot option between calls to efi_get_next_variable_name_int(), it may produce unpredictable results. This commit moves removal of the invalid boot option outside of the efi_get_next_variable_name_int() calls. EFI_NOT_FOUND returned from efi_get_next_variable_name_int() indicates we retrieved all EFI variables, it should be treated as EFI_SUCEESS. To address the checkpatch warning of too many leading tabs, combine two if statement into one. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
ce327084 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: carve out efi_get_next_variable_name_int calls To retrieve the EFI variable name by efi_get_next_variable_name_int(), the sequence of alloc -> efi_get_next_variable_name_int -> realloc -> efi_get_next_variable_name_int is required. In current code, this sequence repeatedly appears in the several functions. It should be curved out a common function. This commit also fixes the missing free() of var_name16 in eficonfig_delete_invalid_boot_option(). Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
140a8959 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use efi_get_next_variable_name_int() eficonfig command reads all possible UEFI load options from 0x0000 to 0xFFFF to construct the menu. This takes too much time in some environment. This commit uses efi_get_next_variable_name_int() to read all existing UEFI load options to significantlly reduce the count of efi_get_var() call. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
78b1ccc4 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use u16_strsize() to get u16 string buffer size Use u16_strsize() to simplify the u16 string buffer size calculation. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c67d3c9e |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix going one directory up issue The directory name in eficonfig menu entry contains the '\' separator. strcmp() argument ".." is wrong and one directory up handling does not work correctly. strcmp() argument must include '\' separator. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c3b5af63 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add UEFI Secure Boot Key enrollment interface This commit adds the menu-driven UEFI Secure Boot Key enrollment interface. User can enroll PK, KEK, db and dbx by selecting file. Only the signed EFI Signature List(s) with an authenticated header, typically '.auth' file, is accepted. To clear the PK, KEK, db and dbx, user needs to enroll the null key signed by PK or KEK. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
21faf4ef |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use protocol interface for file selection EFI_SIMPLE_FILE_SYSTEM_PROTOCOL is not always provided by U-Boot. Use protocol interface functions instead of U-Boot internal functions. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d6566113 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose eficonfig_create_device_path() Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use eficonfig_create_device_path() to construct the full device path from device path of the volume and file path, so move it out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d571f9b2 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation All the eficonfig menus other than "Change Boot Order" use 'eficonfig_entry' structure for each menu entry. This commit refactors change boot order implementation to use 'eficonfig_entry' structure same as other menus to have consistent menu handling. This commit also simplifies the data->active handling when KEY_SPACE is pressed, and sizeof() parameter. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
8961e93e |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose append entry function Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use append_entry() and append_quit_entry() to construct the menu, so move them out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
a84040ab |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor file selection handling eficonfig_select_file_handler() is commonly used to select the file. eficonfig_display_select_file_option() adds an additional menu to clear the selected file. eficonfig_display_select_file_option() is not always necessary for the file selection process, so it must be outside of eficonfig_select_file_handler(). This commit also renames the following functions to avoid confusion. eficonfig_select_file_handler() -> eficonfig_process_select_file() eficonfig_select_file() -> eficonfig_show_file_selection() eficonfig_display_select_file_option() -> eficonfig_process_show_file_option() Finally, test_eficonfig.py need to be updated to get aligned with the above modification. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
1167e88a |
|
14-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix missing variable initialization The 'ret' variable must be initialized before use in eficonfig_delete_invalid_boot_option(). Fixes: c416f1c0bc ("bootmenu: add removable media entries") Addresses-Coverity: 376207 ("Uninitialized variables") Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
3d595ac5 |
|
09-Nov-2022 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: remove superfluous if in eficonfig_edit_boot_option Goto for an immediately succeeding label is superfluous. Fixes: 87d791423ac6 ("eficonfig: menu-driven addition of UEFI boot option") Addresses-Coverity: 376202 ("Identical code for different branches") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
8dbd0a0f |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add vertical scroll support The current eficonfig menu does not support vertical scroll, so it can not display the menu entries greater than the console row size. This commit add the vertial scroll support. The console size is retrieved by SIMPLE_TEXT_OUTPUT_PROTOCOL.QueryMode() service, then calculates the row size for menu entry by subtracting menu header and description row size from the console row size. "start" and "end" are added in the efimenu structure. "start" keeps the menu entry index at the top, "end" keeps the bottom menu entry index. item_data_print() menu function only draws the menu entry between "start" and "end". This commit also fixes the issue that "Save" and "Quit" entries can be moved by BKEY_PLUS in change boot order menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
0d590852 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation This commit removes the change boot order specific menu implementation. The change boot order implementation calls eficonfig_process_common() same as other menus. The change boot order menu requires own item_data_print and item_choice implementation, but display_statusline function can be a same function as other menus. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
cd160b27 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor eficonfig_process_common function Current change boot order implementation does not call eficonfig_process_common() and call own menu functions for display_statusline, item_data_print and item_choice. Change boot order functionality should call eficonfig_process_common() to improve maintenanceability. This commit is a preparation to remove the change boot order specific implementation. The menu functions (display_statusline, item_data_print and item_choice) are added as argument of eficonfig_process_common(). The menu description string displayed at the bottom of the menu is also added as argument. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
32bab0ea |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Make use of CLI character processing Avoid duplicating some of the escape-sequence processing here and use the CLI function instead. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
d0ca98db |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Update bootmenu_loop() to return the code Use the return value to save having to pass around a pointer. This also resolves any ambiguity about what *key contains when the function is called. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
2da4a15e |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Rename KEY_... to BKEY_... This enum values conflict with linux/input.h so rename them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
64550274 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: avoid SetVariable between GetNextVariableName calls The current code calls efi_set_variable_int() to delete the invalid boot option between calls to efi_get_next_variable_name_int(), it may produce unpredictable results. This commit moves removal of the invalid boot option outside of the efi_get_next_variable_name_int() calls. EFI_NOT_FOUND returned from efi_get_next_variable_name_int() indicates we retrieved all EFI variables, it should be treated as EFI_SUCEESS. To address the checkpatch warning of too many leading tabs, combine two if statement into one. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
ce327084 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: carve out efi_get_next_variable_name_int calls To retrieve the EFI variable name by efi_get_next_variable_name_int(), the sequence of alloc -> efi_get_next_variable_name_int -> realloc -> efi_get_next_variable_name_int is required. In current code, this sequence repeatedly appears in the several functions. It should be curved out a common function. This commit also fixes the missing free() of var_name16 in eficonfig_delete_invalid_boot_option(). Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
140a8959 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use efi_get_next_variable_name_int() eficonfig command reads all possible UEFI load options from 0x0000 to 0xFFFF to construct the menu. This takes too much time in some environment. This commit uses efi_get_next_variable_name_int() to read all existing UEFI load options to significantlly reduce the count of efi_get_var() call. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
78b1ccc4 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use u16_strsize() to get u16 string buffer size Use u16_strsize() to simplify the u16 string buffer size calculation. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c67d3c9e |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix going one directory up issue The directory name in eficonfig menu entry contains the '\' separator. strcmp() argument ".." is wrong and one directory up handling does not work correctly. strcmp() argument must include '\' separator. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c3b5af63 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add UEFI Secure Boot Key enrollment interface This commit adds the menu-driven UEFI Secure Boot Key enrollment interface. User can enroll PK, KEK, db and dbx by selecting file. Only the signed EFI Signature List(s) with an authenticated header, typically '.auth' file, is accepted. To clear the PK, KEK, db and dbx, user needs to enroll the null key signed by PK or KEK. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
21faf4ef |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use protocol interface for file selection EFI_SIMPLE_FILE_SYSTEM_PROTOCOL is not always provided by U-Boot. Use protocol interface functions instead of U-Boot internal functions. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d6566113 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose eficonfig_create_device_path() Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use eficonfig_create_device_path() to construct the full device path from device path of the volume and file path, so move it out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d571f9b2 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation All the eficonfig menus other than "Change Boot Order" use 'eficonfig_entry' structure for each menu entry. This commit refactors change boot order implementation to use 'eficonfig_entry' structure same as other menus to have consistent menu handling. This commit also simplifies the data->active handling when KEY_SPACE is pressed, and sizeof() parameter. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
8961e93e |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose append entry function Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use append_entry() and append_quit_entry() to construct the menu, so move them out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
a84040ab |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor file selection handling eficonfig_select_file_handler() is commonly used to select the file. eficonfig_display_select_file_option() adds an additional menu to clear the selected file. eficonfig_display_select_file_option() is not always necessary for the file selection process, so it must be outside of eficonfig_select_file_handler(). This commit also renames the following functions to avoid confusion. eficonfig_select_file_handler() -> eficonfig_process_select_file() eficonfig_select_file() -> eficonfig_show_file_selection() eficonfig_display_select_file_option() -> eficonfig_process_show_file_option() Finally, test_eficonfig.py need to be updated to get aligned with the above modification. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
1167e88a |
|
14-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix missing variable initialization The 'ret' variable must be initialized before use in eficonfig_delete_invalid_boot_option(). Fixes: c416f1c0bc ("bootmenu: add removable media entries") Addresses-Coverity: 376207 ("Uninitialized variables") Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
3d595ac5 |
|
09-Nov-2022 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: remove superfluous if in eficonfig_edit_boot_option Goto for an immediately succeeding label is superfluous. Fixes: 87d791423ac6 ("eficonfig: menu-driven addition of UEFI boot option") Addresses-Coverity: 376202 ("Identical code for different branches") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
8dbd0a0f |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add vertical scroll support The current eficonfig menu does not support vertical scroll, so it can not display the menu entries greater than the console row size. This commit add the vertial scroll support. The console size is retrieved by SIMPLE_TEXT_OUTPUT_PROTOCOL.QueryMode() service, then calculates the row size for menu entry by subtracting menu header and description row size from the console row size. "start" and "end" are added in the efimenu structure. "start" keeps the menu entry index at the top, "end" keeps the bottom menu entry index. item_data_print() menu function only draws the menu entry between "start" and "end". This commit also fixes the issue that "Save" and "Quit" entries can be moved by BKEY_PLUS in change boot order menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
0d590852 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation This commit removes the change boot order specific menu implementation. The change boot order implementation calls eficonfig_process_common() same as other menus. The change boot order menu requires own item_data_print and item_choice implementation, but display_statusline function can be a same function as other menus. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
cd160b27 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor eficonfig_process_common function Current change boot order implementation does not call eficonfig_process_common() and call own menu functions for display_statusline, item_data_print and item_choice. Change boot order functionality should call eficonfig_process_common() to improve maintenanceability. This commit is a preparation to remove the change boot order specific implementation. The menu functions (display_statusline, item_data_print and item_choice) are added as argument of eficonfig_process_common(). The menu description string displayed at the bottom of the menu is also added as argument. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
32bab0ea |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Make use of CLI character processing Avoid duplicating some of the escape-sequence processing here and use the CLI function instead. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
d0ca98db |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Update bootmenu_loop() to return the code Use the return value to save having to pass around a pointer. This also resolves any ambiguity about what *key contains when the function is called. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
2da4a15e |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Rename KEY_... to BKEY_... This enum values conflict with linux/input.h so rename them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
64550274 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: avoid SetVariable between GetNextVariableName calls The current code calls efi_set_variable_int() to delete the invalid boot option between calls to efi_get_next_variable_name_int(), it may produce unpredictable results. This commit moves removal of the invalid boot option outside of the efi_get_next_variable_name_int() calls. EFI_NOT_FOUND returned from efi_get_next_variable_name_int() indicates we retrieved all EFI variables, it should be treated as EFI_SUCEESS. To address the checkpatch warning of too many leading tabs, combine two if statement into one. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
ce327084 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: carve out efi_get_next_variable_name_int calls To retrieve the EFI variable name by efi_get_next_variable_name_int(), the sequence of alloc -> efi_get_next_variable_name_int -> realloc -> efi_get_next_variable_name_int is required. In current code, this sequence repeatedly appears in the several functions. It should be curved out a common function. This commit also fixes the missing free() of var_name16 in eficonfig_delete_invalid_boot_option(). Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
140a8959 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use efi_get_next_variable_name_int() eficonfig command reads all possible UEFI load options from 0x0000 to 0xFFFF to construct the menu. This takes too much time in some environment. This commit uses efi_get_next_variable_name_int() to read all existing UEFI load options to significantlly reduce the count of efi_get_var() call. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
78b1ccc4 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use u16_strsize() to get u16 string buffer size Use u16_strsize() to simplify the u16 string buffer size calculation. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c67d3c9e |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix going one directory up issue The directory name in eficonfig menu entry contains the '\' separator. strcmp() argument ".." is wrong and one directory up handling does not work correctly. strcmp() argument must include '\' separator. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c3b5af63 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add UEFI Secure Boot Key enrollment interface This commit adds the menu-driven UEFI Secure Boot Key enrollment interface. User can enroll PK, KEK, db and dbx by selecting file. Only the signed EFI Signature List(s) with an authenticated header, typically '.auth' file, is accepted. To clear the PK, KEK, db and dbx, user needs to enroll the null key signed by PK or KEK. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
21faf4ef |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use protocol interface for file selection EFI_SIMPLE_FILE_SYSTEM_PROTOCOL is not always provided by U-Boot. Use protocol interface functions instead of U-Boot internal functions. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d6566113 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose eficonfig_create_device_path() Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use eficonfig_create_device_path() to construct the full device path from device path of the volume and file path, so move it out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d571f9b2 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation All the eficonfig menus other than "Change Boot Order" use 'eficonfig_entry' structure for each menu entry. This commit refactors change boot order implementation to use 'eficonfig_entry' structure same as other menus to have consistent menu handling. This commit also simplifies the data->active handling when KEY_SPACE is pressed, and sizeof() parameter. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
8961e93e |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose append entry function Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use append_entry() and append_quit_entry() to construct the menu, so move them out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
a84040ab |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor file selection handling eficonfig_select_file_handler() is commonly used to select the file. eficonfig_display_select_file_option() adds an additional menu to clear the selected file. eficonfig_display_select_file_option() is not always necessary for the file selection process, so it must be outside of eficonfig_select_file_handler(). This commit also renames the following functions to avoid confusion. eficonfig_select_file_handler() -> eficonfig_process_select_file() eficonfig_select_file() -> eficonfig_show_file_selection() eficonfig_display_select_file_option() -> eficonfig_process_show_file_option() Finally, test_eficonfig.py need to be updated to get aligned with the above modification. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
1167e88a |
|
14-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix missing variable initialization The 'ret' variable must be initialized before use in eficonfig_delete_invalid_boot_option(). Fixes: c416f1c0bc ("bootmenu: add removable media entries") Addresses-Coverity: 376207 ("Uninitialized variables") Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
3d595ac5 |
|
09-Nov-2022 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: remove superfluous if in eficonfig_edit_boot_option Goto for an immediately succeeding label is superfluous. Fixes: 87d791423ac6 ("eficonfig: menu-driven addition of UEFI boot option") Addresses-Coverity: 376202 ("Identical code for different branches") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
8dbd0a0f |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add vertical scroll support The current eficonfig menu does not support vertical scroll, so it can not display the menu entries greater than the console row size. This commit add the vertial scroll support. The console size is retrieved by SIMPLE_TEXT_OUTPUT_PROTOCOL.QueryMode() service, then calculates the row size for menu entry by subtracting menu header and description row size from the console row size. "start" and "end" are added in the efimenu structure. "start" keeps the menu entry index at the top, "end" keeps the bottom menu entry index. item_data_print() menu function only draws the menu entry between "start" and "end". This commit also fixes the issue that "Save" and "Quit" entries can be moved by BKEY_PLUS in change boot order menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
0d590852 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation This commit removes the change boot order specific menu implementation. The change boot order implementation calls eficonfig_process_common() same as other menus. The change boot order menu requires own item_data_print and item_choice implementation, but display_statusline function can be a same function as other menus. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
cd160b27 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor eficonfig_process_common function Current change boot order implementation does not call eficonfig_process_common() and call own menu functions for display_statusline, item_data_print and item_choice. Change boot order functionality should call eficonfig_process_common() to improve maintenanceability. This commit is a preparation to remove the change boot order specific implementation. The menu functions (display_statusline, item_data_print and item_choice) are added as argument of eficonfig_process_common(). The menu description string displayed at the bottom of the menu is also added as argument. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
32bab0ea |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Make use of CLI character processing Avoid duplicating some of the escape-sequence processing here and use the CLI function instead. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
d0ca98db |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Update bootmenu_loop() to return the code Use the return value to save having to pass around a pointer. This also resolves any ambiguity about what *key contains when the function is called. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
2da4a15e |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Rename KEY_... to BKEY_... This enum values conflict with linux/input.h so rename them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
64550274 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: avoid SetVariable between GetNextVariableName calls The current code calls efi_set_variable_int() to delete the invalid boot option between calls to efi_get_next_variable_name_int(), it may produce unpredictable results. This commit moves removal of the invalid boot option outside of the efi_get_next_variable_name_int() calls. EFI_NOT_FOUND returned from efi_get_next_variable_name_int() indicates we retrieved all EFI variables, it should be treated as EFI_SUCEESS. To address the checkpatch warning of too many leading tabs, combine two if statement into one. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
ce327084 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: carve out efi_get_next_variable_name_int calls To retrieve the EFI variable name by efi_get_next_variable_name_int(), the sequence of alloc -> efi_get_next_variable_name_int -> realloc -> efi_get_next_variable_name_int is required. In current code, this sequence repeatedly appears in the several functions. It should be curved out a common function. This commit also fixes the missing free() of var_name16 in eficonfig_delete_invalid_boot_option(). Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
140a8959 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use efi_get_next_variable_name_int() eficonfig command reads all possible UEFI load options from 0x0000 to 0xFFFF to construct the menu. This takes too much time in some environment. This commit uses efi_get_next_variable_name_int() to read all existing UEFI load options to significantlly reduce the count of efi_get_var() call. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
78b1ccc4 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use u16_strsize() to get u16 string buffer size Use u16_strsize() to simplify the u16 string buffer size calculation. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c67d3c9e |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix going one directory up issue The directory name in eficonfig menu entry contains the '\' separator. strcmp() argument ".." is wrong and one directory up handling does not work correctly. strcmp() argument must include '\' separator. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c3b5af63 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add UEFI Secure Boot Key enrollment interface This commit adds the menu-driven UEFI Secure Boot Key enrollment interface. User can enroll PK, KEK, db and dbx by selecting file. Only the signed EFI Signature List(s) with an authenticated header, typically '.auth' file, is accepted. To clear the PK, KEK, db and dbx, user needs to enroll the null key signed by PK or KEK. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
21faf4ef |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use protocol interface for file selection EFI_SIMPLE_FILE_SYSTEM_PROTOCOL is not always provided by U-Boot. Use protocol interface functions instead of U-Boot internal functions. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d6566113 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose eficonfig_create_device_path() Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use eficonfig_create_device_path() to construct the full device path from device path of the volume and file path, so move it out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d571f9b2 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation All the eficonfig menus other than "Change Boot Order" use 'eficonfig_entry' structure for each menu entry. This commit refactors change boot order implementation to use 'eficonfig_entry' structure same as other menus to have consistent menu handling. This commit also simplifies the data->active handling when KEY_SPACE is pressed, and sizeof() parameter. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
8961e93e |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose append entry function Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use append_entry() and append_quit_entry() to construct the menu, so move them out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
a84040ab |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor file selection handling eficonfig_select_file_handler() is commonly used to select the file. eficonfig_display_select_file_option() adds an additional menu to clear the selected file. eficonfig_display_select_file_option() is not always necessary for the file selection process, so it must be outside of eficonfig_select_file_handler(). This commit also renames the following functions to avoid confusion. eficonfig_select_file_handler() -> eficonfig_process_select_file() eficonfig_select_file() -> eficonfig_show_file_selection() eficonfig_display_select_file_option() -> eficonfig_process_show_file_option() Finally, test_eficonfig.py need to be updated to get aligned with the above modification. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
1167e88a |
|
14-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix missing variable initialization The 'ret' variable must be initialized before use in eficonfig_delete_invalid_boot_option(). Fixes: c416f1c0bc ("bootmenu: add removable media entries") Addresses-Coverity: 376207 ("Uninitialized variables") Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
3d595ac5 |
|
09-Nov-2022 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: remove superfluous if in eficonfig_edit_boot_option Goto for an immediately succeeding label is superfluous. Fixes: 87d791423ac6 ("eficonfig: menu-driven addition of UEFI boot option") Addresses-Coverity: 376202 ("Identical code for different branches") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
8dbd0a0f |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add vertical scroll support The current eficonfig menu does not support vertical scroll, so it can not display the menu entries greater than the console row size. This commit add the vertial scroll support. The console size is retrieved by SIMPLE_TEXT_OUTPUT_PROTOCOL.QueryMode() service, then calculates the row size for menu entry by subtracting menu header and description row size from the console row size. "start" and "end" are added in the efimenu structure. "start" keeps the menu entry index at the top, "end" keeps the bottom menu entry index. item_data_print() menu function only draws the menu entry between "start" and "end". This commit also fixes the issue that "Save" and "Quit" entries can be moved by BKEY_PLUS in change boot order menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
0d590852 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation This commit removes the change boot order specific menu implementation. The change boot order implementation calls eficonfig_process_common() same as other menus. The change boot order menu requires own item_data_print and item_choice implementation, but display_statusline function can be a same function as other menus. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
cd160b27 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor eficonfig_process_common function Current change boot order implementation does not call eficonfig_process_common() and call own menu functions for display_statusline, item_data_print and item_choice. Change boot order functionality should call eficonfig_process_common() to improve maintenanceability. This commit is a preparation to remove the change boot order specific implementation. The menu functions (display_statusline, item_data_print and item_choice) are added as argument of eficonfig_process_common(). The menu description string displayed at the bottom of the menu is also added as argument. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
32bab0ea |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Make use of CLI character processing Avoid duplicating some of the escape-sequence processing here and use the CLI function instead. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
d0ca98db |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Update bootmenu_loop() to return the code Use the return value to save having to pass around a pointer. This also resolves any ambiguity about what *key contains when the function is called. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
2da4a15e |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Rename KEY_... to BKEY_... This enum values conflict with linux/input.h so rename them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
64550274 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: avoid SetVariable between GetNextVariableName calls The current code calls efi_set_variable_int() to delete the invalid boot option between calls to efi_get_next_variable_name_int(), it may produce unpredictable results. This commit moves removal of the invalid boot option outside of the efi_get_next_variable_name_int() calls. EFI_NOT_FOUND returned from efi_get_next_variable_name_int() indicates we retrieved all EFI variables, it should be treated as EFI_SUCEESS. To address the checkpatch warning of too many leading tabs, combine two if statement into one. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
ce327084 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: carve out efi_get_next_variable_name_int calls To retrieve the EFI variable name by efi_get_next_variable_name_int(), the sequence of alloc -> efi_get_next_variable_name_int -> realloc -> efi_get_next_variable_name_int is required. In current code, this sequence repeatedly appears in the several functions. It should be curved out a common function. This commit also fixes the missing free() of var_name16 in eficonfig_delete_invalid_boot_option(). Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
140a8959 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use efi_get_next_variable_name_int() eficonfig command reads all possible UEFI load options from 0x0000 to 0xFFFF to construct the menu. This takes too much time in some environment. This commit uses efi_get_next_variable_name_int() to read all existing UEFI load options to significantlly reduce the count of efi_get_var() call. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
78b1ccc4 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use u16_strsize() to get u16 string buffer size Use u16_strsize() to simplify the u16 string buffer size calculation. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c67d3c9e |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix going one directory up issue The directory name in eficonfig menu entry contains the '\' separator. strcmp() argument ".." is wrong and one directory up handling does not work correctly. strcmp() argument must include '\' separator. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c3b5af63 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add UEFI Secure Boot Key enrollment interface This commit adds the menu-driven UEFI Secure Boot Key enrollment interface. User can enroll PK, KEK, db and dbx by selecting file. Only the signed EFI Signature List(s) with an authenticated header, typically '.auth' file, is accepted. To clear the PK, KEK, db and dbx, user needs to enroll the null key signed by PK or KEK. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
21faf4ef |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use protocol interface for file selection EFI_SIMPLE_FILE_SYSTEM_PROTOCOL is not always provided by U-Boot. Use protocol interface functions instead of U-Boot internal functions. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d6566113 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose eficonfig_create_device_path() Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use eficonfig_create_device_path() to construct the full device path from device path of the volume and file path, so move it out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d571f9b2 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation All the eficonfig menus other than "Change Boot Order" use 'eficonfig_entry' structure for each menu entry. This commit refactors change boot order implementation to use 'eficonfig_entry' structure same as other menus to have consistent menu handling. This commit also simplifies the data->active handling when KEY_SPACE is pressed, and sizeof() parameter. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
8961e93e |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose append entry function Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use append_entry() and append_quit_entry() to construct the menu, so move them out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
a84040ab |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor file selection handling eficonfig_select_file_handler() is commonly used to select the file. eficonfig_display_select_file_option() adds an additional menu to clear the selected file. eficonfig_display_select_file_option() is not always necessary for the file selection process, so it must be outside of eficonfig_select_file_handler(). This commit also renames the following functions to avoid confusion. eficonfig_select_file_handler() -> eficonfig_process_select_file() eficonfig_select_file() -> eficonfig_show_file_selection() eficonfig_display_select_file_option() -> eficonfig_process_show_file_option() Finally, test_eficonfig.py need to be updated to get aligned with the above modification. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
1167e88a |
|
14-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix missing variable initialization The 'ret' variable must be initialized before use in eficonfig_delete_invalid_boot_option(). Fixes: c416f1c0bc ("bootmenu: add removable media entries") Addresses-Coverity: 376207 ("Uninitialized variables") Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
3d595ac5 |
|
09-Nov-2022 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: remove superfluous if in eficonfig_edit_boot_option Goto for an immediately succeeding label is superfluous. Fixes: 87d791423ac6 ("eficonfig: menu-driven addition of UEFI boot option") Addresses-Coverity: 376202 ("Identical code for different branches") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
8dbd0a0f |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add vertical scroll support The current eficonfig menu does not support vertical scroll, so it can not display the menu entries greater than the console row size. This commit add the vertial scroll support. The console size is retrieved by SIMPLE_TEXT_OUTPUT_PROTOCOL.QueryMode() service, then calculates the row size for menu entry by subtracting menu header and description row size from the console row size. "start" and "end" are added in the efimenu structure. "start" keeps the menu entry index at the top, "end" keeps the bottom menu entry index. item_data_print() menu function only draws the menu entry between "start" and "end". This commit also fixes the issue that "Save" and "Quit" entries can be moved by BKEY_PLUS in change boot order menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
0d590852 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation This commit removes the change boot order specific menu implementation. The change boot order implementation calls eficonfig_process_common() same as other menus. The change boot order menu requires own item_data_print and item_choice implementation, but display_statusline function can be a same function as other menus. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
cd160b27 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor eficonfig_process_common function Current change boot order implementation does not call eficonfig_process_common() and call own menu functions for display_statusline, item_data_print and item_choice. Change boot order functionality should call eficonfig_process_common() to improve maintenanceability. This commit is a preparation to remove the change boot order specific implementation. The menu functions (display_statusline, item_data_print and item_choice) are added as argument of eficonfig_process_common(). The menu description string displayed at the bottom of the menu is also added as argument. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
32bab0ea |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Make use of CLI character processing Avoid duplicating some of the escape-sequence processing here and use the CLI function instead. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
d0ca98db |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Update bootmenu_loop() to return the code Use the return value to save having to pass around a pointer. This also resolves any ambiguity about what *key contains when the function is called. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
2da4a15e |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Rename KEY_... to BKEY_... This enum values conflict with linux/input.h so rename them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
64550274 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: avoid SetVariable between GetNextVariableName calls The current code calls efi_set_variable_int() to delete the invalid boot option between calls to efi_get_next_variable_name_int(), it may produce unpredictable results. This commit moves removal of the invalid boot option outside of the efi_get_next_variable_name_int() calls. EFI_NOT_FOUND returned from efi_get_next_variable_name_int() indicates we retrieved all EFI variables, it should be treated as EFI_SUCEESS. To address the checkpatch warning of too many leading tabs, combine two if statement into one. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
ce327084 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: carve out efi_get_next_variable_name_int calls To retrieve the EFI variable name by efi_get_next_variable_name_int(), the sequence of alloc -> efi_get_next_variable_name_int -> realloc -> efi_get_next_variable_name_int is required. In current code, this sequence repeatedly appears in the several functions. It should be curved out a common function. This commit also fixes the missing free() of var_name16 in eficonfig_delete_invalid_boot_option(). Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
140a8959 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use efi_get_next_variable_name_int() eficonfig command reads all possible UEFI load options from 0x0000 to 0xFFFF to construct the menu. This takes too much time in some environment. This commit uses efi_get_next_variable_name_int() to read all existing UEFI load options to significantlly reduce the count of efi_get_var() call. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
78b1ccc4 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use u16_strsize() to get u16 string buffer size Use u16_strsize() to simplify the u16 string buffer size calculation. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c67d3c9e |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix going one directory up issue The directory name in eficonfig menu entry contains the '\' separator. strcmp() argument ".." is wrong and one directory up handling does not work correctly. strcmp() argument must include '\' separator. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c3b5af63 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add UEFI Secure Boot Key enrollment interface This commit adds the menu-driven UEFI Secure Boot Key enrollment interface. User can enroll PK, KEK, db and dbx by selecting file. Only the signed EFI Signature List(s) with an authenticated header, typically '.auth' file, is accepted. To clear the PK, KEK, db and dbx, user needs to enroll the null key signed by PK or KEK. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
21faf4ef |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use protocol interface for file selection EFI_SIMPLE_FILE_SYSTEM_PROTOCOL is not always provided by U-Boot. Use protocol interface functions instead of U-Boot internal functions. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d6566113 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose eficonfig_create_device_path() Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use eficonfig_create_device_path() to construct the full device path from device path of the volume and file path, so move it out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d571f9b2 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation All the eficonfig menus other than "Change Boot Order" use 'eficonfig_entry' structure for each menu entry. This commit refactors change boot order implementation to use 'eficonfig_entry' structure same as other menus to have consistent menu handling. This commit also simplifies the data->active handling when KEY_SPACE is pressed, and sizeof() parameter. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
8961e93e |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose append entry function Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use append_entry() and append_quit_entry() to construct the menu, so move them out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
a84040ab |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor file selection handling eficonfig_select_file_handler() is commonly used to select the file. eficonfig_display_select_file_option() adds an additional menu to clear the selected file. eficonfig_display_select_file_option() is not always necessary for the file selection process, so it must be outside of eficonfig_select_file_handler(). This commit also renames the following functions to avoid confusion. eficonfig_select_file_handler() -> eficonfig_process_select_file() eficonfig_select_file() -> eficonfig_show_file_selection() eficonfig_display_select_file_option() -> eficonfig_process_show_file_option() Finally, test_eficonfig.py need to be updated to get aligned with the above modification. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
1167e88a |
|
14-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix missing variable initialization The 'ret' variable must be initialized before use in eficonfig_delete_invalid_boot_option(). Fixes: c416f1c0bc ("bootmenu: add removable media entries") Addresses-Coverity: 376207 ("Uninitialized variables") Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
3d595ac5 |
|
09-Nov-2022 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: remove superfluous if in eficonfig_edit_boot_option Goto for an immediately succeeding label is superfluous. Fixes: 87d791423ac6 ("eficonfig: menu-driven addition of UEFI boot option") Addresses-Coverity: 376202 ("Identical code for different branches") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
8dbd0a0f |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add vertical scroll support The current eficonfig menu does not support vertical scroll, so it can not display the menu entries greater than the console row size. This commit add the vertial scroll support. The console size is retrieved by SIMPLE_TEXT_OUTPUT_PROTOCOL.QueryMode() service, then calculates the row size for menu entry by subtracting menu header and description row size from the console row size. "start" and "end" are added in the efimenu structure. "start" keeps the menu entry index at the top, "end" keeps the bottom menu entry index. item_data_print() menu function only draws the menu entry between "start" and "end". This commit also fixes the issue that "Save" and "Quit" entries can be moved by BKEY_PLUS in change boot order menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
0d590852 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation This commit removes the change boot order specific menu implementation. The change boot order implementation calls eficonfig_process_common() same as other menus. The change boot order menu requires own item_data_print and item_choice implementation, but display_statusline function can be a same function as other menus. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
cd160b27 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor eficonfig_process_common function Current change boot order implementation does not call eficonfig_process_common() and call own menu functions for display_statusline, item_data_print and item_choice. Change boot order functionality should call eficonfig_process_common() to improve maintenanceability. This commit is a preparation to remove the change boot order specific implementation. The menu functions (display_statusline, item_data_print and item_choice) are added as argument of eficonfig_process_common(). The menu description string displayed at the bottom of the menu is also added as argument. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
32bab0ea |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Make use of CLI character processing Avoid duplicating some of the escape-sequence processing here and use the CLI function instead. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
d0ca98db |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Update bootmenu_loop() to return the code Use the return value to save having to pass around a pointer. This also resolves any ambiguity about what *key contains when the function is called. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
2da4a15e |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Rename KEY_... to BKEY_... This enum values conflict with linux/input.h so rename them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
64550274 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: avoid SetVariable between GetNextVariableName calls The current code calls efi_set_variable_int() to delete the invalid boot option between calls to efi_get_next_variable_name_int(), it may produce unpredictable results. This commit moves removal of the invalid boot option outside of the efi_get_next_variable_name_int() calls. EFI_NOT_FOUND returned from efi_get_next_variable_name_int() indicates we retrieved all EFI variables, it should be treated as EFI_SUCEESS. To address the checkpatch warning of too many leading tabs, combine two if statement into one. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
ce327084 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: carve out efi_get_next_variable_name_int calls To retrieve the EFI variable name by efi_get_next_variable_name_int(), the sequence of alloc -> efi_get_next_variable_name_int -> realloc -> efi_get_next_variable_name_int is required. In current code, this sequence repeatedly appears in the several functions. It should be curved out a common function. This commit also fixes the missing free() of var_name16 in eficonfig_delete_invalid_boot_option(). Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
140a8959 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use efi_get_next_variable_name_int() eficonfig command reads all possible UEFI load options from 0x0000 to 0xFFFF to construct the menu. This takes too much time in some environment. This commit uses efi_get_next_variable_name_int() to read all existing UEFI load options to significantlly reduce the count of efi_get_var() call. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
78b1ccc4 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use u16_strsize() to get u16 string buffer size Use u16_strsize() to simplify the u16 string buffer size calculation. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c67d3c9e |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix going one directory up issue The directory name in eficonfig menu entry contains the '\' separator. strcmp() argument ".." is wrong and one directory up handling does not work correctly. strcmp() argument must include '\' separator. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c3b5af63 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add UEFI Secure Boot Key enrollment interface This commit adds the menu-driven UEFI Secure Boot Key enrollment interface. User can enroll PK, KEK, db and dbx by selecting file. Only the signed EFI Signature List(s) with an authenticated header, typically '.auth' file, is accepted. To clear the PK, KEK, db and dbx, user needs to enroll the null key signed by PK or KEK. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
21faf4ef |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use protocol interface for file selection EFI_SIMPLE_FILE_SYSTEM_PROTOCOL is not always provided by U-Boot. Use protocol interface functions instead of U-Boot internal functions. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d6566113 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose eficonfig_create_device_path() Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use eficonfig_create_device_path() to construct the full device path from device path of the volume and file path, so move it out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d571f9b2 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation All the eficonfig menus other than "Change Boot Order" use 'eficonfig_entry' structure for each menu entry. This commit refactors change boot order implementation to use 'eficonfig_entry' structure same as other menus to have consistent menu handling. This commit also simplifies the data->active handling when KEY_SPACE is pressed, and sizeof() parameter. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
8961e93e |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose append entry function Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use append_entry() and append_quit_entry() to construct the menu, so move them out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
a84040ab |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor file selection handling eficonfig_select_file_handler() is commonly used to select the file. eficonfig_display_select_file_option() adds an additional menu to clear the selected file. eficonfig_display_select_file_option() is not always necessary for the file selection process, so it must be outside of eficonfig_select_file_handler(). This commit also renames the following functions to avoid confusion. eficonfig_select_file_handler() -> eficonfig_process_select_file() eficonfig_select_file() -> eficonfig_show_file_selection() eficonfig_display_select_file_option() -> eficonfig_process_show_file_option() Finally, test_eficonfig.py need to be updated to get aligned with the above modification. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
1167e88a |
|
14-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix missing variable initialization The 'ret' variable must be initialized before use in eficonfig_delete_invalid_boot_option(). Fixes: c416f1c0bc ("bootmenu: add removable media entries") Addresses-Coverity: 376207 ("Uninitialized variables") Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
3d595ac5 |
|
09-Nov-2022 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: remove superfluous if in eficonfig_edit_boot_option Goto for an immediately succeeding label is superfluous. Fixes: 87d791423ac6 ("eficonfig: menu-driven addition of UEFI boot option") Addresses-Coverity: 376202 ("Identical code for different branches") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
8dbd0a0f |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add vertical scroll support The current eficonfig menu does not support vertical scroll, so it can not display the menu entries greater than the console row size. This commit add the vertial scroll support. The console size is retrieved by SIMPLE_TEXT_OUTPUT_PROTOCOL.QueryMode() service, then calculates the row size for menu entry by subtracting menu header and description row size from the console row size. "start" and "end" are added in the efimenu structure. "start" keeps the menu entry index at the top, "end" keeps the bottom menu entry index. item_data_print() menu function only draws the menu entry between "start" and "end". This commit also fixes the issue that "Save" and "Quit" entries can be moved by BKEY_PLUS in change boot order menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
0d590852 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation This commit removes the change boot order specific menu implementation. The change boot order implementation calls eficonfig_process_common() same as other menus. The change boot order menu requires own item_data_print and item_choice implementation, but display_statusline function can be a same function as other menus. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
cd160b27 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor eficonfig_process_common function Current change boot order implementation does not call eficonfig_process_common() and call own menu functions for display_statusline, item_data_print and item_choice. Change boot order functionality should call eficonfig_process_common() to improve maintenanceability. This commit is a preparation to remove the change boot order specific implementation. The menu functions (display_statusline, item_data_print and item_choice) are added as argument of eficonfig_process_common(). The menu description string displayed at the bottom of the menu is also added as argument. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
32bab0ea |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Make use of CLI character processing Avoid duplicating some of the escape-sequence processing here and use the CLI function instead. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
d0ca98db |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Update bootmenu_loop() to return the code Use the return value to save having to pass around a pointer. This also resolves any ambiguity about what *key contains when the function is called. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
2da4a15e |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Rename KEY_... to BKEY_... This enum values conflict with linux/input.h so rename them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
64550274 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: avoid SetVariable between GetNextVariableName calls The current code calls efi_set_variable_int() to delete the invalid boot option between calls to efi_get_next_variable_name_int(), it may produce unpredictable results. This commit moves removal of the invalid boot option outside of the efi_get_next_variable_name_int() calls. EFI_NOT_FOUND returned from efi_get_next_variable_name_int() indicates we retrieved all EFI variables, it should be treated as EFI_SUCEESS. To address the checkpatch warning of too many leading tabs, combine two if statement into one. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
ce327084 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: carve out efi_get_next_variable_name_int calls To retrieve the EFI variable name by efi_get_next_variable_name_int(), the sequence of alloc -> efi_get_next_variable_name_int -> realloc -> efi_get_next_variable_name_int is required. In current code, this sequence repeatedly appears in the several functions. It should be curved out a common function. This commit also fixes the missing free() of var_name16 in eficonfig_delete_invalid_boot_option(). Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
140a8959 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use efi_get_next_variable_name_int() eficonfig command reads all possible UEFI load options from 0x0000 to 0xFFFF to construct the menu. This takes too much time in some environment. This commit uses efi_get_next_variable_name_int() to read all existing UEFI load options to significantlly reduce the count of efi_get_var() call. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
78b1ccc4 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use u16_strsize() to get u16 string buffer size Use u16_strsize() to simplify the u16 string buffer size calculation. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c67d3c9e |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix going one directory up issue The directory name in eficonfig menu entry contains the '\' separator. strcmp() argument ".." is wrong and one directory up handling does not work correctly. strcmp() argument must include '\' separator. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c3b5af63 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add UEFI Secure Boot Key enrollment interface This commit adds the menu-driven UEFI Secure Boot Key enrollment interface. User can enroll PK, KEK, db and dbx by selecting file. Only the signed EFI Signature List(s) with an authenticated header, typically '.auth' file, is accepted. To clear the PK, KEK, db and dbx, user needs to enroll the null key signed by PK or KEK. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
21faf4ef |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use protocol interface for file selection EFI_SIMPLE_FILE_SYSTEM_PROTOCOL is not always provided by U-Boot. Use protocol interface functions instead of U-Boot internal functions. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d6566113 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose eficonfig_create_device_path() Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use eficonfig_create_device_path() to construct the full device path from device path of the volume and file path, so move it out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d571f9b2 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation All the eficonfig menus other than "Change Boot Order" use 'eficonfig_entry' structure for each menu entry. This commit refactors change boot order implementation to use 'eficonfig_entry' structure same as other menus to have consistent menu handling. This commit also simplifies the data->active handling when KEY_SPACE is pressed, and sizeof() parameter. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
8961e93e |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose append entry function Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use append_entry() and append_quit_entry() to construct the menu, so move them out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
a84040ab |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor file selection handling eficonfig_select_file_handler() is commonly used to select the file. eficonfig_display_select_file_option() adds an additional menu to clear the selected file. eficonfig_display_select_file_option() is not always necessary for the file selection process, so it must be outside of eficonfig_select_file_handler(). This commit also renames the following functions to avoid confusion. eficonfig_select_file_handler() -> eficonfig_process_select_file() eficonfig_select_file() -> eficonfig_show_file_selection() eficonfig_display_select_file_option() -> eficonfig_process_show_file_option() Finally, test_eficonfig.py need to be updated to get aligned with the above modification. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
1167e88a |
|
14-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix missing variable initialization The 'ret' variable must be initialized before use in eficonfig_delete_invalid_boot_option(). Fixes: c416f1c0bc ("bootmenu: add removable media entries") Addresses-Coverity: 376207 ("Uninitialized variables") Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
3d595ac5 |
|
09-Nov-2022 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: remove superfluous if in eficonfig_edit_boot_option Goto for an immediately succeeding label is superfluous. Fixes: 87d791423ac6 ("eficonfig: menu-driven addition of UEFI boot option") Addresses-Coverity: 376202 ("Identical code for different branches") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
8dbd0a0f |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add vertical scroll support The current eficonfig menu does not support vertical scroll, so it can not display the menu entries greater than the console row size. This commit add the vertial scroll support. The console size is retrieved by SIMPLE_TEXT_OUTPUT_PROTOCOL.QueryMode() service, then calculates the row size for menu entry by subtracting menu header and description row size from the console row size. "start" and "end" are added in the efimenu structure. "start" keeps the menu entry index at the top, "end" keeps the bottom menu entry index. item_data_print() menu function only draws the menu entry between "start" and "end". This commit also fixes the issue that "Save" and "Quit" entries can be moved by BKEY_PLUS in change boot order menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
0d590852 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation This commit removes the change boot order specific menu implementation. The change boot order implementation calls eficonfig_process_common() same as other menus. The change boot order menu requires own item_data_print and item_choice implementation, but display_statusline function can be a same function as other menus. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
cd160b27 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor eficonfig_process_common function Current change boot order implementation does not call eficonfig_process_common() and call own menu functions for display_statusline, item_data_print and item_choice. Change boot order functionality should call eficonfig_process_common() to improve maintenanceability. This commit is a preparation to remove the change boot order specific implementation. The menu functions (display_statusline, item_data_print and item_choice) are added as argument of eficonfig_process_common(). The menu description string displayed at the bottom of the menu is also added as argument. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
32bab0ea |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Make use of CLI character processing Avoid duplicating some of the escape-sequence processing here and use the CLI function instead. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
d0ca98db |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Update bootmenu_loop() to return the code Use the return value to save having to pass around a pointer. This also resolves any ambiguity about what *key contains when the function is called. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
2da4a15e |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Rename KEY_... to BKEY_... This enum values conflict with linux/input.h so rename them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
64550274 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: avoid SetVariable between GetNextVariableName calls The current code calls efi_set_variable_int() to delete the invalid boot option between calls to efi_get_next_variable_name_int(), it may produce unpredictable results. This commit moves removal of the invalid boot option outside of the efi_get_next_variable_name_int() calls. EFI_NOT_FOUND returned from efi_get_next_variable_name_int() indicates we retrieved all EFI variables, it should be treated as EFI_SUCEESS. To address the checkpatch warning of too many leading tabs, combine two if statement into one. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
ce327084 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: carve out efi_get_next_variable_name_int calls To retrieve the EFI variable name by efi_get_next_variable_name_int(), the sequence of alloc -> efi_get_next_variable_name_int -> realloc -> efi_get_next_variable_name_int is required. In current code, this sequence repeatedly appears in the several functions. It should be curved out a common function. This commit also fixes the missing free() of var_name16 in eficonfig_delete_invalid_boot_option(). Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
140a8959 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use efi_get_next_variable_name_int() eficonfig command reads all possible UEFI load options from 0x0000 to 0xFFFF to construct the menu. This takes too much time in some environment. This commit uses efi_get_next_variable_name_int() to read all existing UEFI load options to significantlly reduce the count of efi_get_var() call. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
78b1ccc4 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use u16_strsize() to get u16 string buffer size Use u16_strsize() to simplify the u16 string buffer size calculation. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c67d3c9e |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix going one directory up issue The directory name in eficonfig menu entry contains the '\' separator. strcmp() argument ".." is wrong and one directory up handling does not work correctly. strcmp() argument must include '\' separator. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c3b5af63 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add UEFI Secure Boot Key enrollment interface This commit adds the menu-driven UEFI Secure Boot Key enrollment interface. User can enroll PK, KEK, db and dbx by selecting file. Only the signed EFI Signature List(s) with an authenticated header, typically '.auth' file, is accepted. To clear the PK, KEK, db and dbx, user needs to enroll the null key signed by PK or KEK. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
21faf4ef |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use protocol interface for file selection EFI_SIMPLE_FILE_SYSTEM_PROTOCOL is not always provided by U-Boot. Use protocol interface functions instead of U-Boot internal functions. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d6566113 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose eficonfig_create_device_path() Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use eficonfig_create_device_path() to construct the full device path from device path of the volume and file path, so move it out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d571f9b2 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation All the eficonfig menus other than "Change Boot Order" use 'eficonfig_entry' structure for each menu entry. This commit refactors change boot order implementation to use 'eficonfig_entry' structure same as other menus to have consistent menu handling. This commit also simplifies the data->active handling when KEY_SPACE is pressed, and sizeof() parameter. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
8961e93e |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose append entry function Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use append_entry() and append_quit_entry() to construct the menu, so move them out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
a84040ab |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor file selection handling eficonfig_select_file_handler() is commonly used to select the file. eficonfig_display_select_file_option() adds an additional menu to clear the selected file. eficonfig_display_select_file_option() is not always necessary for the file selection process, so it must be outside of eficonfig_select_file_handler(). This commit also renames the following functions to avoid confusion. eficonfig_select_file_handler() -> eficonfig_process_select_file() eficonfig_select_file() -> eficonfig_show_file_selection() eficonfig_display_select_file_option() -> eficonfig_process_show_file_option() Finally, test_eficonfig.py need to be updated to get aligned with the above modification. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
1167e88a |
|
14-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix missing variable initialization The 'ret' variable must be initialized before use in eficonfig_delete_invalid_boot_option(). Fixes: c416f1c0bc ("bootmenu: add removable media entries") Addresses-Coverity: 376207 ("Uninitialized variables") Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
3d595ac5 |
|
09-Nov-2022 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: remove superfluous if in eficonfig_edit_boot_option Goto for an immediately succeeding label is superfluous. Fixes: 87d791423ac6 ("eficonfig: menu-driven addition of UEFI boot option") Addresses-Coverity: 376202 ("Identical code for different branches") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
8dbd0a0f |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add vertical scroll support The current eficonfig menu does not support vertical scroll, so it can not display the menu entries greater than the console row size. This commit add the vertial scroll support. The console size is retrieved by SIMPLE_TEXT_OUTPUT_PROTOCOL.QueryMode() service, then calculates the row size for menu entry by subtracting menu header and description row size from the console row size. "start" and "end" are added in the efimenu structure. "start" keeps the menu entry index at the top, "end" keeps the bottom menu entry index. item_data_print() menu function only draws the menu entry between "start" and "end". This commit also fixes the issue that "Save" and "Quit" entries can be moved by BKEY_PLUS in change boot order menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
0d590852 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation This commit removes the change boot order specific menu implementation. The change boot order implementation calls eficonfig_process_common() same as other menus. The change boot order menu requires own item_data_print and item_choice implementation, but display_statusline function can be a same function as other menus. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
cd160b27 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor eficonfig_process_common function Current change boot order implementation does not call eficonfig_process_common() and call own menu functions for display_statusline, item_data_print and item_choice. Change boot order functionality should call eficonfig_process_common() to improve maintenanceability. This commit is a preparation to remove the change boot order specific implementation. The menu functions (display_statusline, item_data_print and item_choice) are added as argument of eficonfig_process_common(). The menu description string displayed at the bottom of the menu is also added as argument. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
32bab0ea |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Make use of CLI character processing Avoid duplicating some of the escape-sequence processing here and use the CLI function instead. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
d0ca98db |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Update bootmenu_loop() to return the code Use the return value to save having to pass around a pointer. This also resolves any ambiguity about what *key contains when the function is called. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
2da4a15e |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Rename KEY_... to BKEY_... This enum values conflict with linux/input.h so rename them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
64550274 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: avoid SetVariable between GetNextVariableName calls The current code calls efi_set_variable_int() to delete the invalid boot option between calls to efi_get_next_variable_name_int(), it may produce unpredictable results. This commit moves removal of the invalid boot option outside of the efi_get_next_variable_name_int() calls. EFI_NOT_FOUND returned from efi_get_next_variable_name_int() indicates we retrieved all EFI variables, it should be treated as EFI_SUCEESS. To address the checkpatch warning of too many leading tabs, combine two if statement into one. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
ce327084 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: carve out efi_get_next_variable_name_int calls To retrieve the EFI variable name by efi_get_next_variable_name_int(), the sequence of alloc -> efi_get_next_variable_name_int -> realloc -> efi_get_next_variable_name_int is required. In current code, this sequence repeatedly appears in the several functions. It should be curved out a common function. This commit also fixes the missing free() of var_name16 in eficonfig_delete_invalid_boot_option(). Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
140a8959 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use efi_get_next_variable_name_int() eficonfig command reads all possible UEFI load options from 0x0000 to 0xFFFF to construct the menu. This takes too much time in some environment. This commit uses efi_get_next_variable_name_int() to read all existing UEFI load options to significantlly reduce the count of efi_get_var() call. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
78b1ccc4 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use u16_strsize() to get u16 string buffer size Use u16_strsize() to simplify the u16 string buffer size calculation. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c67d3c9e |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix going one directory up issue The directory name in eficonfig menu entry contains the '\' separator. strcmp() argument ".." is wrong and one directory up handling does not work correctly. strcmp() argument must include '\' separator. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c3b5af63 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add UEFI Secure Boot Key enrollment interface This commit adds the menu-driven UEFI Secure Boot Key enrollment interface. User can enroll PK, KEK, db and dbx by selecting file. Only the signed EFI Signature List(s) with an authenticated header, typically '.auth' file, is accepted. To clear the PK, KEK, db and dbx, user needs to enroll the null key signed by PK or KEK. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
21faf4ef |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use protocol interface for file selection EFI_SIMPLE_FILE_SYSTEM_PROTOCOL is not always provided by U-Boot. Use protocol interface functions instead of U-Boot internal functions. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d6566113 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose eficonfig_create_device_path() Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use eficonfig_create_device_path() to construct the full device path from device path of the volume and file path, so move it out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d571f9b2 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation All the eficonfig menus other than "Change Boot Order" use 'eficonfig_entry' structure for each menu entry. This commit refactors change boot order implementation to use 'eficonfig_entry' structure same as other menus to have consistent menu handling. This commit also simplifies the data->active handling when KEY_SPACE is pressed, and sizeof() parameter. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
8961e93e |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose append entry function Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use append_entry() and append_quit_entry() to construct the menu, so move them out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
a84040ab |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor file selection handling eficonfig_select_file_handler() is commonly used to select the file. eficonfig_display_select_file_option() adds an additional menu to clear the selected file. eficonfig_display_select_file_option() is not always necessary for the file selection process, so it must be outside of eficonfig_select_file_handler(). This commit also renames the following functions to avoid confusion. eficonfig_select_file_handler() -> eficonfig_process_select_file() eficonfig_select_file() -> eficonfig_show_file_selection() eficonfig_display_select_file_option() -> eficonfig_process_show_file_option() Finally, test_eficonfig.py need to be updated to get aligned with the above modification. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
1167e88a |
|
14-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix missing variable initialization The 'ret' variable must be initialized before use in eficonfig_delete_invalid_boot_option(). Fixes: c416f1c0bc ("bootmenu: add removable media entries") Addresses-Coverity: 376207 ("Uninitialized variables") Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
3d595ac5 |
|
09-Nov-2022 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: remove superfluous if in eficonfig_edit_boot_option Goto for an immediately succeeding label is superfluous. Fixes: 87d791423ac6 ("eficonfig: menu-driven addition of UEFI boot option") Addresses-Coverity: 376202 ("Identical code for different branches") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
8dbd0a0f |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add vertical scroll support The current eficonfig menu does not support vertical scroll, so it can not display the menu entries greater than the console row size. This commit add the vertial scroll support. The console size is retrieved by SIMPLE_TEXT_OUTPUT_PROTOCOL.QueryMode() service, then calculates the row size for menu entry by subtracting menu header and description row size from the console row size. "start" and "end" are added in the efimenu structure. "start" keeps the menu entry index at the top, "end" keeps the bottom menu entry index. item_data_print() menu function only draws the menu entry between "start" and "end". This commit also fixes the issue that "Save" and "Quit" entries can be moved by BKEY_PLUS in change boot order menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
0d590852 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation This commit removes the change boot order specific menu implementation. The change boot order implementation calls eficonfig_process_common() same as other menus. The change boot order menu requires own item_data_print and item_choice implementation, but display_statusline function can be a same function as other menus. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
cd160b27 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor eficonfig_process_common function Current change boot order implementation does not call eficonfig_process_common() and call own menu functions for display_statusline, item_data_print and item_choice. Change boot order functionality should call eficonfig_process_common() to improve maintenanceability. This commit is a preparation to remove the change boot order specific implementation. The menu functions (display_statusline, item_data_print and item_choice) are added as argument of eficonfig_process_common(). The menu description string displayed at the bottom of the menu is also added as argument. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
32bab0ea |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Make use of CLI character processing Avoid duplicating some of the escape-sequence processing here and use the CLI function instead. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
d0ca98db |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Update bootmenu_loop() to return the code Use the return value to save having to pass around a pointer. This also resolves any ambiguity about what *key contains when the function is called. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
2da4a15e |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Rename KEY_... to BKEY_... This enum values conflict with linux/input.h so rename them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
64550274 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: avoid SetVariable between GetNextVariableName calls The current code calls efi_set_variable_int() to delete the invalid boot option between calls to efi_get_next_variable_name_int(), it may produce unpredictable results. This commit moves removal of the invalid boot option outside of the efi_get_next_variable_name_int() calls. EFI_NOT_FOUND returned from efi_get_next_variable_name_int() indicates we retrieved all EFI variables, it should be treated as EFI_SUCEESS. To address the checkpatch warning of too many leading tabs, combine two if statement into one. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
ce327084 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: carve out efi_get_next_variable_name_int calls To retrieve the EFI variable name by efi_get_next_variable_name_int(), the sequence of alloc -> efi_get_next_variable_name_int -> realloc -> efi_get_next_variable_name_int is required. In current code, this sequence repeatedly appears in the several functions. It should be curved out a common function. This commit also fixes the missing free() of var_name16 in eficonfig_delete_invalid_boot_option(). Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
140a8959 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use efi_get_next_variable_name_int() eficonfig command reads all possible UEFI load options from 0x0000 to 0xFFFF to construct the menu. This takes too much time in some environment. This commit uses efi_get_next_variable_name_int() to read all existing UEFI load options to significantlly reduce the count of efi_get_var() call. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
78b1ccc4 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use u16_strsize() to get u16 string buffer size Use u16_strsize() to simplify the u16 string buffer size calculation. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c67d3c9e |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix going one directory up issue The directory name in eficonfig menu entry contains the '\' separator. strcmp() argument ".." is wrong and one directory up handling does not work correctly. strcmp() argument must include '\' separator. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c3b5af63 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add UEFI Secure Boot Key enrollment interface This commit adds the menu-driven UEFI Secure Boot Key enrollment interface. User can enroll PK, KEK, db and dbx by selecting file. Only the signed EFI Signature List(s) with an authenticated header, typically '.auth' file, is accepted. To clear the PK, KEK, db and dbx, user needs to enroll the null key signed by PK or KEK. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
21faf4ef |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use protocol interface for file selection EFI_SIMPLE_FILE_SYSTEM_PROTOCOL is not always provided by U-Boot. Use protocol interface functions instead of U-Boot internal functions. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d6566113 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose eficonfig_create_device_path() Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use eficonfig_create_device_path() to construct the full device path from device path of the volume and file path, so move it out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d571f9b2 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation All the eficonfig menus other than "Change Boot Order" use 'eficonfig_entry' structure for each menu entry. This commit refactors change boot order implementation to use 'eficonfig_entry' structure same as other menus to have consistent menu handling. This commit also simplifies the data->active handling when KEY_SPACE is pressed, and sizeof() parameter. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
8961e93e |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose append entry function Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use append_entry() and append_quit_entry() to construct the menu, so move them out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
a84040ab |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor file selection handling eficonfig_select_file_handler() is commonly used to select the file. eficonfig_display_select_file_option() adds an additional menu to clear the selected file. eficonfig_display_select_file_option() is not always necessary for the file selection process, so it must be outside of eficonfig_select_file_handler(). This commit also renames the following functions to avoid confusion. eficonfig_select_file_handler() -> eficonfig_process_select_file() eficonfig_select_file() -> eficonfig_show_file_selection() eficonfig_display_select_file_option() -> eficonfig_process_show_file_option() Finally, test_eficonfig.py need to be updated to get aligned with the above modification. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
1167e88a |
|
14-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix missing variable initialization The 'ret' variable must be initialized before use in eficonfig_delete_invalid_boot_option(). Fixes: c416f1c0bc ("bootmenu: add removable media entries") Addresses-Coverity: 376207 ("Uninitialized variables") Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
3d595ac5 |
|
09-Nov-2022 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: remove superfluous if in eficonfig_edit_boot_option Goto for an immediately succeeding label is superfluous. Fixes: 87d791423ac6 ("eficonfig: menu-driven addition of UEFI boot option") Addresses-Coverity: 376202 ("Identical code for different branches") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
8dbd0a0f |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add vertical scroll support The current eficonfig menu does not support vertical scroll, so it can not display the menu entries greater than the console row size. This commit add the vertial scroll support. The console size is retrieved by SIMPLE_TEXT_OUTPUT_PROTOCOL.QueryMode() service, then calculates the row size for menu entry by subtracting menu header and description row size from the console row size. "start" and "end" are added in the efimenu structure. "start" keeps the menu entry index at the top, "end" keeps the bottom menu entry index. item_data_print() menu function only draws the menu entry between "start" and "end". This commit also fixes the issue that "Save" and "Quit" entries can be moved by BKEY_PLUS in change boot order menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
0d590852 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation This commit removes the change boot order specific menu implementation. The change boot order implementation calls eficonfig_process_common() same as other menus. The change boot order menu requires own item_data_print and item_choice implementation, but display_statusline function can be a same function as other menus. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
cd160b27 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor eficonfig_process_common function Current change boot order implementation does not call eficonfig_process_common() and call own menu functions for display_statusline, item_data_print and item_choice. Change boot order functionality should call eficonfig_process_common() to improve maintenanceability. This commit is a preparation to remove the change boot order specific implementation. The menu functions (display_statusline, item_data_print and item_choice) are added as argument of eficonfig_process_common(). The menu description string displayed at the bottom of the menu is also added as argument. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
32bab0ea |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Make use of CLI character processing Avoid duplicating some of the escape-sequence processing here and use the CLI function instead. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
d0ca98db |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Update bootmenu_loop() to return the code Use the return value to save having to pass around a pointer. This also resolves any ambiguity about what *key contains when the function is called. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
2da4a15e |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Rename KEY_... to BKEY_... This enum values conflict with linux/input.h so rename them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
64550274 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: avoid SetVariable between GetNextVariableName calls The current code calls efi_set_variable_int() to delete the invalid boot option between calls to efi_get_next_variable_name_int(), it may produce unpredictable results. This commit moves removal of the invalid boot option outside of the efi_get_next_variable_name_int() calls. EFI_NOT_FOUND returned from efi_get_next_variable_name_int() indicates we retrieved all EFI variables, it should be treated as EFI_SUCEESS. To address the checkpatch warning of too many leading tabs, combine two if statement into one. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
ce327084 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: carve out efi_get_next_variable_name_int calls To retrieve the EFI variable name by efi_get_next_variable_name_int(), the sequence of alloc -> efi_get_next_variable_name_int -> realloc -> efi_get_next_variable_name_int is required. In current code, this sequence repeatedly appears in the several functions. It should be curved out a common function. This commit also fixes the missing free() of var_name16 in eficonfig_delete_invalid_boot_option(). Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
140a8959 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use efi_get_next_variable_name_int() eficonfig command reads all possible UEFI load options from 0x0000 to 0xFFFF to construct the menu. This takes too much time in some environment. This commit uses efi_get_next_variable_name_int() to read all existing UEFI load options to significantlly reduce the count of efi_get_var() call. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
78b1ccc4 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use u16_strsize() to get u16 string buffer size Use u16_strsize() to simplify the u16 string buffer size calculation. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c67d3c9e |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix going one directory up issue The directory name in eficonfig menu entry contains the '\' separator. strcmp() argument ".." is wrong and one directory up handling does not work correctly. strcmp() argument must include '\' separator. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c3b5af63 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add UEFI Secure Boot Key enrollment interface This commit adds the menu-driven UEFI Secure Boot Key enrollment interface. User can enroll PK, KEK, db and dbx by selecting file. Only the signed EFI Signature List(s) with an authenticated header, typically '.auth' file, is accepted. To clear the PK, KEK, db and dbx, user needs to enroll the null key signed by PK or KEK. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
21faf4ef |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use protocol interface for file selection EFI_SIMPLE_FILE_SYSTEM_PROTOCOL is not always provided by U-Boot. Use protocol interface functions instead of U-Boot internal functions. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d6566113 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose eficonfig_create_device_path() Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use eficonfig_create_device_path() to construct the full device path from device path of the volume and file path, so move it out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d571f9b2 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation All the eficonfig menus other than "Change Boot Order" use 'eficonfig_entry' structure for each menu entry. This commit refactors change boot order implementation to use 'eficonfig_entry' structure same as other menus to have consistent menu handling. This commit also simplifies the data->active handling when KEY_SPACE is pressed, and sizeof() parameter. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
8961e93e |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose append entry function Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use append_entry() and append_quit_entry() to construct the menu, so move them out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
a84040ab |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor file selection handling eficonfig_select_file_handler() is commonly used to select the file. eficonfig_display_select_file_option() adds an additional menu to clear the selected file. eficonfig_display_select_file_option() is not always necessary for the file selection process, so it must be outside of eficonfig_select_file_handler(). This commit also renames the following functions to avoid confusion. eficonfig_select_file_handler() -> eficonfig_process_select_file() eficonfig_select_file() -> eficonfig_show_file_selection() eficonfig_display_select_file_option() -> eficonfig_process_show_file_option() Finally, test_eficonfig.py need to be updated to get aligned with the above modification. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
1167e88a |
|
14-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix missing variable initialization The 'ret' variable must be initialized before use in eficonfig_delete_invalid_boot_option(). Fixes: c416f1c0bc ("bootmenu: add removable media entries") Addresses-Coverity: 376207 ("Uninitialized variables") Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
3d595ac5 |
|
09-Nov-2022 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: remove superfluous if in eficonfig_edit_boot_option Goto for an immediately succeeding label is superfluous. Fixes: 87d791423ac6 ("eficonfig: menu-driven addition of UEFI boot option") Addresses-Coverity: 376202 ("Identical code for different branches") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
8dbd0a0f |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add vertical scroll support The current eficonfig menu does not support vertical scroll, so it can not display the menu entries greater than the console row size. This commit add the vertial scroll support. The console size is retrieved by SIMPLE_TEXT_OUTPUT_PROTOCOL.QueryMode() service, then calculates the row size for menu entry by subtracting menu header and description row size from the console row size. "start" and "end" are added in the efimenu structure. "start" keeps the menu entry index at the top, "end" keeps the bottom menu entry index. item_data_print() menu function only draws the menu entry between "start" and "end". This commit also fixes the issue that "Save" and "Quit" entries can be moved by BKEY_PLUS in change boot order menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
0d590852 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation This commit removes the change boot order specific menu implementation. The change boot order implementation calls eficonfig_process_common() same as other menus. The change boot order menu requires own item_data_print and item_choice implementation, but display_statusline function can be a same function as other menus. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
cd160b27 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor eficonfig_process_common function Current change boot order implementation does not call eficonfig_process_common() and call own menu functions for display_statusline, item_data_print and item_choice. Change boot order functionality should call eficonfig_process_common() to improve maintenanceability. This commit is a preparation to remove the change boot order specific implementation. The menu functions (display_statusline, item_data_print and item_choice) are added as argument of eficonfig_process_common(). The menu description string displayed at the bottom of the menu is also added as argument. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
32bab0ea |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Make use of CLI character processing Avoid duplicating some of the escape-sequence processing here and use the CLI function instead. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
d0ca98db |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Update bootmenu_loop() to return the code Use the return value to save having to pass around a pointer. This also resolves any ambiguity about what *key contains when the function is called. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
2da4a15e |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Rename KEY_... to BKEY_... This enum values conflict with linux/input.h so rename them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
64550274 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: avoid SetVariable between GetNextVariableName calls The current code calls efi_set_variable_int() to delete the invalid boot option between calls to efi_get_next_variable_name_int(), it may produce unpredictable results. This commit moves removal of the invalid boot option outside of the efi_get_next_variable_name_int() calls. EFI_NOT_FOUND returned from efi_get_next_variable_name_int() indicates we retrieved all EFI variables, it should be treated as EFI_SUCEESS. To address the checkpatch warning of too many leading tabs, combine two if statement into one. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
ce327084 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: carve out efi_get_next_variable_name_int calls To retrieve the EFI variable name by efi_get_next_variable_name_int(), the sequence of alloc -> efi_get_next_variable_name_int -> realloc -> efi_get_next_variable_name_int is required. In current code, this sequence repeatedly appears in the several functions. It should be curved out a common function. This commit also fixes the missing free() of var_name16 in eficonfig_delete_invalid_boot_option(). Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
140a8959 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use efi_get_next_variable_name_int() eficonfig command reads all possible UEFI load options from 0x0000 to 0xFFFF to construct the menu. This takes too much time in some environment. This commit uses efi_get_next_variable_name_int() to read all existing UEFI load options to significantlly reduce the count of efi_get_var() call. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
78b1ccc4 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use u16_strsize() to get u16 string buffer size Use u16_strsize() to simplify the u16 string buffer size calculation. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c67d3c9e |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix going one directory up issue The directory name in eficonfig menu entry contains the '\' separator. strcmp() argument ".." is wrong and one directory up handling does not work correctly. strcmp() argument must include '\' separator. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c3b5af63 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add UEFI Secure Boot Key enrollment interface This commit adds the menu-driven UEFI Secure Boot Key enrollment interface. User can enroll PK, KEK, db and dbx by selecting file. Only the signed EFI Signature List(s) with an authenticated header, typically '.auth' file, is accepted. To clear the PK, KEK, db and dbx, user needs to enroll the null key signed by PK or KEK. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
21faf4ef |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use protocol interface for file selection EFI_SIMPLE_FILE_SYSTEM_PROTOCOL is not always provided by U-Boot. Use protocol interface functions instead of U-Boot internal functions. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d6566113 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose eficonfig_create_device_path() Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use eficonfig_create_device_path() to construct the full device path from device path of the volume and file path, so move it out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d571f9b2 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation All the eficonfig menus other than "Change Boot Order" use 'eficonfig_entry' structure for each menu entry. This commit refactors change boot order implementation to use 'eficonfig_entry' structure same as other menus to have consistent menu handling. This commit also simplifies the data->active handling when KEY_SPACE is pressed, and sizeof() parameter. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
8961e93e |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose append entry function Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use append_entry() and append_quit_entry() to construct the menu, so move them out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
a84040ab |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor file selection handling eficonfig_select_file_handler() is commonly used to select the file. eficonfig_display_select_file_option() adds an additional menu to clear the selected file. eficonfig_display_select_file_option() is not always necessary for the file selection process, so it must be outside of eficonfig_select_file_handler(). This commit also renames the following functions to avoid confusion. eficonfig_select_file_handler() -> eficonfig_process_select_file() eficonfig_select_file() -> eficonfig_show_file_selection() eficonfig_display_select_file_option() -> eficonfig_process_show_file_option() Finally, test_eficonfig.py need to be updated to get aligned with the above modification. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
1167e88a |
|
14-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix missing variable initialization The 'ret' variable must be initialized before use in eficonfig_delete_invalid_boot_option(). Fixes: c416f1c0bc ("bootmenu: add removable media entries") Addresses-Coverity: 376207 ("Uninitialized variables") Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
3d595ac5 |
|
09-Nov-2022 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: remove superfluous if in eficonfig_edit_boot_option Goto for an immediately succeeding label is superfluous. Fixes: 87d791423ac6 ("eficonfig: menu-driven addition of UEFI boot option") Addresses-Coverity: 376202 ("Identical code for different branches") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
8dbd0a0f |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add vertical scroll support The current eficonfig menu does not support vertical scroll, so it can not display the menu entries greater than the console row size. This commit add the vertial scroll support. The console size is retrieved by SIMPLE_TEXT_OUTPUT_PROTOCOL.QueryMode() service, then calculates the row size for menu entry by subtracting menu header and description row size from the console row size. "start" and "end" are added in the efimenu structure. "start" keeps the menu entry index at the top, "end" keeps the bottom menu entry index. item_data_print() menu function only draws the menu entry between "start" and "end". This commit also fixes the issue that "Save" and "Quit" entries can be moved by BKEY_PLUS in change boot order menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
0d590852 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation This commit removes the change boot order specific menu implementation. The change boot order implementation calls eficonfig_process_common() same as other menus. The change boot order menu requires own item_data_print and item_choice implementation, but display_statusline function can be a same function as other menus. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
cd160b27 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor eficonfig_process_common function Current change boot order implementation does not call eficonfig_process_common() and call own menu functions for display_statusline, item_data_print and item_choice. Change boot order functionality should call eficonfig_process_common() to improve maintenanceability. This commit is a preparation to remove the change boot order specific implementation. The menu functions (display_statusline, item_data_print and item_choice) are added as argument of eficonfig_process_common(). The menu description string displayed at the bottom of the menu is also added as argument. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
32bab0ea |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Make use of CLI character processing Avoid duplicating some of the escape-sequence processing here and use the CLI function instead. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
d0ca98db |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Update bootmenu_loop() to return the code Use the return value to save having to pass around a pointer. This also resolves any ambiguity about what *key contains when the function is called. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
2da4a15e |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Rename KEY_... to BKEY_... This enum values conflict with linux/input.h so rename them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
64550274 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: avoid SetVariable between GetNextVariableName calls The current code calls efi_set_variable_int() to delete the invalid boot option between calls to efi_get_next_variable_name_int(), it may produce unpredictable results. This commit moves removal of the invalid boot option outside of the efi_get_next_variable_name_int() calls. EFI_NOT_FOUND returned from efi_get_next_variable_name_int() indicates we retrieved all EFI variables, it should be treated as EFI_SUCEESS. To address the checkpatch warning of too many leading tabs, combine two if statement into one. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
ce327084 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: carve out efi_get_next_variable_name_int calls To retrieve the EFI variable name by efi_get_next_variable_name_int(), the sequence of alloc -> efi_get_next_variable_name_int -> realloc -> efi_get_next_variable_name_int is required. In current code, this sequence repeatedly appears in the several functions. It should be curved out a common function. This commit also fixes the missing free() of var_name16 in eficonfig_delete_invalid_boot_option(). Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
140a8959 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use efi_get_next_variable_name_int() eficonfig command reads all possible UEFI load options from 0x0000 to 0xFFFF to construct the menu. This takes too much time in some environment. This commit uses efi_get_next_variable_name_int() to read all existing UEFI load options to significantlly reduce the count of efi_get_var() call. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
78b1ccc4 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use u16_strsize() to get u16 string buffer size Use u16_strsize() to simplify the u16 string buffer size calculation. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c67d3c9e |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix going one directory up issue The directory name in eficonfig menu entry contains the '\' separator. strcmp() argument ".." is wrong and one directory up handling does not work correctly. strcmp() argument must include '\' separator. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c3b5af63 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add UEFI Secure Boot Key enrollment interface This commit adds the menu-driven UEFI Secure Boot Key enrollment interface. User can enroll PK, KEK, db and dbx by selecting file. Only the signed EFI Signature List(s) with an authenticated header, typically '.auth' file, is accepted. To clear the PK, KEK, db and dbx, user needs to enroll the null key signed by PK or KEK. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
21faf4ef |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use protocol interface for file selection EFI_SIMPLE_FILE_SYSTEM_PROTOCOL is not always provided by U-Boot. Use protocol interface functions instead of U-Boot internal functions. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d6566113 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose eficonfig_create_device_path() Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use eficonfig_create_device_path() to construct the full device path from device path of the volume and file path, so move it out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d571f9b2 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation All the eficonfig menus other than "Change Boot Order" use 'eficonfig_entry' structure for each menu entry. This commit refactors change boot order implementation to use 'eficonfig_entry' structure same as other menus to have consistent menu handling. This commit also simplifies the data->active handling when KEY_SPACE is pressed, and sizeof() parameter. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
8961e93e |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose append entry function Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use append_entry() and append_quit_entry() to construct the menu, so move them out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
a84040ab |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor file selection handling eficonfig_select_file_handler() is commonly used to select the file. eficonfig_display_select_file_option() adds an additional menu to clear the selected file. eficonfig_display_select_file_option() is not always necessary for the file selection process, so it must be outside of eficonfig_select_file_handler(). This commit also renames the following functions to avoid confusion. eficonfig_select_file_handler() -> eficonfig_process_select_file() eficonfig_select_file() -> eficonfig_show_file_selection() eficonfig_display_select_file_option() -> eficonfig_process_show_file_option() Finally, test_eficonfig.py need to be updated to get aligned with the above modification. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
1167e88a |
|
14-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix missing variable initialization The 'ret' variable must be initialized before use in eficonfig_delete_invalid_boot_option(). Fixes: c416f1c0bc ("bootmenu: add removable media entries") Addresses-Coverity: 376207 ("Uninitialized variables") Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
3d595ac5 |
|
09-Nov-2022 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: remove superfluous if in eficonfig_edit_boot_option Goto for an immediately succeeding label is superfluous. Fixes: 87d791423ac6 ("eficonfig: menu-driven addition of UEFI boot option") Addresses-Coverity: 376202 ("Identical code for different branches") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
8dbd0a0f |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add vertical scroll support The current eficonfig menu does not support vertical scroll, so it can not display the menu entries greater than the console row size. This commit add the vertial scroll support. The console size is retrieved by SIMPLE_TEXT_OUTPUT_PROTOCOL.QueryMode() service, then calculates the row size for menu entry by subtracting menu header and description row size from the console row size. "start" and "end" are added in the efimenu structure. "start" keeps the menu entry index at the top, "end" keeps the bottom menu entry index. item_data_print() menu function only draws the menu entry between "start" and "end". This commit also fixes the issue that "Save" and "Quit" entries can be moved by BKEY_PLUS in change boot order menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
0d590852 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation This commit removes the change boot order specific menu implementation. The change boot order implementation calls eficonfig_process_common() same as other menus. The change boot order menu requires own item_data_print and item_choice implementation, but display_statusline function can be a same function as other menus. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
cd160b27 |
|
23-Jan-2023 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor eficonfig_process_common function Current change boot order implementation does not call eficonfig_process_common() and call own menu functions for display_statusline, item_data_print and item_choice. Change boot order functionality should call eficonfig_process_common() to improve maintenanceability. This commit is a preparation to remove the change boot order specific implementation. The menu functions (display_statusline, item_data_print and item_choice) are added as argument of eficonfig_process_common(). The menu description string displayed at the bottom of the menu is also added as argument. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
32bab0ea |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Make use of CLI character processing Avoid duplicating some of the escape-sequence processing here and use the CLI function instead. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
d0ca98db |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Update bootmenu_loop() to return the code Use the return value to save having to pass around a pointer. This also resolves any ambiguity about what *key contains when the function is called. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
2da4a15e |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Rename KEY_... to BKEY_... This enum values conflict with linux/input.h so rename them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
64550274 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: avoid SetVariable between GetNextVariableName calls The current code calls efi_set_variable_int() to delete the invalid boot option between calls to efi_get_next_variable_name_int(), it may produce unpredictable results. This commit moves removal of the invalid boot option outside of the efi_get_next_variable_name_int() calls. EFI_NOT_FOUND returned from efi_get_next_variable_name_int() indicates we retrieved all EFI variables, it should be treated as EFI_SUCEESS. To address the checkpatch warning of too many leading tabs, combine two if statement into one. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
ce327084 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: carve out efi_get_next_variable_name_int calls To retrieve the EFI variable name by efi_get_next_variable_name_int(), the sequence of alloc -> efi_get_next_variable_name_int -> realloc -> efi_get_next_variable_name_int is required. In current code, this sequence repeatedly appears in the several functions. It should be curved out a common function. This commit also fixes the missing free() of var_name16 in eficonfig_delete_invalid_boot_option(). Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
140a8959 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use efi_get_next_variable_name_int() eficonfig command reads all possible UEFI load options from 0x0000 to 0xFFFF to construct the menu. This takes too much time in some environment. This commit uses efi_get_next_variable_name_int() to read all existing UEFI load options to significantlly reduce the count of efi_get_var() call. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
78b1ccc4 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use u16_strsize() to get u16 string buffer size Use u16_strsize() to simplify the u16 string buffer size calculation. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c67d3c9e |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix going one directory up issue The directory name in eficonfig menu entry contains the '\' separator. strcmp() argument ".." is wrong and one directory up handling does not work correctly. strcmp() argument must include '\' separator. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c3b5af63 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add UEFI Secure Boot Key enrollment interface This commit adds the menu-driven UEFI Secure Boot Key enrollment interface. User can enroll PK, KEK, db and dbx by selecting file. Only the signed EFI Signature List(s) with an authenticated header, typically '.auth' file, is accepted. To clear the PK, KEK, db and dbx, user needs to enroll the null key signed by PK or KEK. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
21faf4ef |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use protocol interface for file selection EFI_SIMPLE_FILE_SYSTEM_PROTOCOL is not always provided by U-Boot. Use protocol interface functions instead of U-Boot internal functions. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d6566113 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose eficonfig_create_device_path() Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use eficonfig_create_device_path() to construct the full device path from device path of the volume and file path, so move it out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d571f9b2 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation All the eficonfig menus other than "Change Boot Order" use 'eficonfig_entry' structure for each menu entry. This commit refactors change boot order implementation to use 'eficonfig_entry' structure same as other menus to have consistent menu handling. This commit also simplifies the data->active handling when KEY_SPACE is pressed, and sizeof() parameter. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
8961e93e |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose append entry function Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use append_entry() and append_quit_entry() to construct the menu, so move them out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
a84040ab |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor file selection handling eficonfig_select_file_handler() is commonly used to select the file. eficonfig_display_select_file_option() adds an additional menu to clear the selected file. eficonfig_display_select_file_option() is not always necessary for the file selection process, so it must be outside of eficonfig_select_file_handler(). This commit also renames the following functions to avoid confusion. eficonfig_select_file_handler() -> eficonfig_process_select_file() eficonfig_select_file() -> eficonfig_show_file_selection() eficonfig_display_select_file_option() -> eficonfig_process_show_file_option() Finally, test_eficonfig.py need to be updated to get aligned with the above modification. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
1167e88a |
|
14-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix missing variable initialization The 'ret' variable must be initialized before use in eficonfig_delete_invalid_boot_option(). Fixes: c416f1c0bc ("bootmenu: add removable media entries") Addresses-Coverity: 376207 ("Uninitialized variables") Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
3d595ac5 |
|
09-Nov-2022 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: remove superfluous if in eficonfig_edit_boot_option Goto for an immediately succeeding label is superfluous. Fixes: 87d791423ac6 ("eficonfig: menu-driven addition of UEFI boot option") Addresses-Coverity: 376202 ("Identical code for different branches") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
32bab0ea |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Make use of CLI character processing Avoid duplicating some of the escape-sequence processing here and use the CLI function instead. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
d0ca98db |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Update bootmenu_loop() to return the code Use the return value to save having to pass around a pointer. This also resolves any ambiguity about what *key contains when the function is called. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
2da4a15e |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Rename KEY_... to BKEY_... This enum values conflict with linux/input.h so rename them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
64550274 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: avoid SetVariable between GetNextVariableName calls The current code calls efi_set_variable_int() to delete the invalid boot option between calls to efi_get_next_variable_name_int(), it may produce unpredictable results. This commit moves removal of the invalid boot option outside of the efi_get_next_variable_name_int() calls. EFI_NOT_FOUND returned from efi_get_next_variable_name_int() indicates we retrieved all EFI variables, it should be treated as EFI_SUCEESS. To address the checkpatch warning of too many leading tabs, combine two if statement into one. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
ce327084 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: carve out efi_get_next_variable_name_int calls To retrieve the EFI variable name by efi_get_next_variable_name_int(), the sequence of alloc -> efi_get_next_variable_name_int -> realloc -> efi_get_next_variable_name_int is required. In current code, this sequence repeatedly appears in the several functions. It should be curved out a common function. This commit also fixes the missing free() of var_name16 in eficonfig_delete_invalid_boot_option(). Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
140a8959 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use efi_get_next_variable_name_int() eficonfig command reads all possible UEFI load options from 0x0000 to 0xFFFF to construct the menu. This takes too much time in some environment. This commit uses efi_get_next_variable_name_int() to read all existing UEFI load options to significantlly reduce the count of efi_get_var() call. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
78b1ccc4 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use u16_strsize() to get u16 string buffer size Use u16_strsize() to simplify the u16 string buffer size calculation. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c67d3c9e |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix going one directory up issue The directory name in eficonfig menu entry contains the '\' separator. strcmp() argument ".." is wrong and one directory up handling does not work correctly. strcmp() argument must include '\' separator. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c3b5af63 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add UEFI Secure Boot Key enrollment interface This commit adds the menu-driven UEFI Secure Boot Key enrollment interface. User can enroll PK, KEK, db and dbx by selecting file. Only the signed EFI Signature List(s) with an authenticated header, typically '.auth' file, is accepted. To clear the PK, KEK, db and dbx, user needs to enroll the null key signed by PK or KEK. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
21faf4ef |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use protocol interface for file selection EFI_SIMPLE_FILE_SYSTEM_PROTOCOL is not always provided by U-Boot. Use protocol interface functions instead of U-Boot internal functions. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d6566113 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose eficonfig_create_device_path() Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use eficonfig_create_device_path() to construct the full device path from device path of the volume and file path, so move it out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d571f9b2 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation All the eficonfig menus other than "Change Boot Order" use 'eficonfig_entry' structure for each menu entry. This commit refactors change boot order implementation to use 'eficonfig_entry' structure same as other menus to have consistent menu handling. This commit also simplifies the data->active handling when KEY_SPACE is pressed, and sizeof() parameter. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
8961e93e |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose append entry function Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use append_entry() and append_quit_entry() to construct the menu, so move them out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
a84040ab |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor file selection handling eficonfig_select_file_handler() is commonly used to select the file. eficonfig_display_select_file_option() adds an additional menu to clear the selected file. eficonfig_display_select_file_option() is not always necessary for the file selection process, so it must be outside of eficonfig_select_file_handler(). This commit also renames the following functions to avoid confusion. eficonfig_select_file_handler() -> eficonfig_process_select_file() eficonfig_select_file() -> eficonfig_show_file_selection() eficonfig_display_select_file_option() -> eficonfig_process_show_file_option() Finally, test_eficonfig.py need to be updated to get aligned with the above modification. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
1167e88a |
|
14-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix missing variable initialization The 'ret' variable must be initialized before use in eficonfig_delete_invalid_boot_option(). Fixes: c416f1c0bc ("bootmenu: add removable media entries") Addresses-Coverity: 376207 ("Uninitialized variables") Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
3d595ac5 |
|
09-Nov-2022 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: remove superfluous if in eficonfig_edit_boot_option Goto for an immediately succeeding label is superfluous. Fixes: 87d791423ac6 ("eficonfig: menu-driven addition of UEFI boot option") Addresses-Coverity: 376202 ("Identical code for different branches") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
32bab0ea |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Make use of CLI character processing Avoid duplicating some of the escape-sequence processing here and use the CLI function instead. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
d0ca98db |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Update bootmenu_loop() to return the code Use the return value to save having to pass around a pointer. This also resolves any ambiguity about what *key contains when the function is called. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
2da4a15e |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Rename KEY_... to BKEY_... This enum values conflict with linux/input.h so rename them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
64550274 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: avoid SetVariable between GetNextVariableName calls The current code calls efi_set_variable_int() to delete the invalid boot option between calls to efi_get_next_variable_name_int(), it may produce unpredictable results. This commit moves removal of the invalid boot option outside of the efi_get_next_variable_name_int() calls. EFI_NOT_FOUND returned from efi_get_next_variable_name_int() indicates we retrieved all EFI variables, it should be treated as EFI_SUCEESS. To address the checkpatch warning of too many leading tabs, combine two if statement into one. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
ce327084 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: carve out efi_get_next_variable_name_int calls To retrieve the EFI variable name by efi_get_next_variable_name_int(), the sequence of alloc -> efi_get_next_variable_name_int -> realloc -> efi_get_next_variable_name_int is required. In current code, this sequence repeatedly appears in the several functions. It should be curved out a common function. This commit also fixes the missing free() of var_name16 in eficonfig_delete_invalid_boot_option(). Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
140a8959 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use efi_get_next_variable_name_int() eficonfig command reads all possible UEFI load options from 0x0000 to 0xFFFF to construct the menu. This takes too much time in some environment. This commit uses efi_get_next_variable_name_int() to read all existing UEFI load options to significantlly reduce the count of efi_get_var() call. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
78b1ccc4 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use u16_strsize() to get u16 string buffer size Use u16_strsize() to simplify the u16 string buffer size calculation. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c67d3c9e |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix going one directory up issue The directory name in eficonfig menu entry contains the '\' separator. strcmp() argument ".." is wrong and one directory up handling does not work correctly. strcmp() argument must include '\' separator. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c3b5af63 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add UEFI Secure Boot Key enrollment interface This commit adds the menu-driven UEFI Secure Boot Key enrollment interface. User can enroll PK, KEK, db and dbx by selecting file. Only the signed EFI Signature List(s) with an authenticated header, typically '.auth' file, is accepted. To clear the PK, KEK, db and dbx, user needs to enroll the null key signed by PK or KEK. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
21faf4ef |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use protocol interface for file selection EFI_SIMPLE_FILE_SYSTEM_PROTOCOL is not always provided by U-Boot. Use protocol interface functions instead of U-Boot internal functions. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d6566113 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose eficonfig_create_device_path() Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use eficonfig_create_device_path() to construct the full device path from device path of the volume and file path, so move it out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d571f9b2 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation All the eficonfig menus other than "Change Boot Order" use 'eficonfig_entry' structure for each menu entry. This commit refactors change boot order implementation to use 'eficonfig_entry' structure same as other menus to have consistent menu handling. This commit also simplifies the data->active handling when KEY_SPACE is pressed, and sizeof() parameter. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
8961e93e |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose append entry function Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use append_entry() and append_quit_entry() to construct the menu, so move them out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
a84040ab |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor file selection handling eficonfig_select_file_handler() is commonly used to select the file. eficonfig_display_select_file_option() adds an additional menu to clear the selected file. eficonfig_display_select_file_option() is not always necessary for the file selection process, so it must be outside of eficonfig_select_file_handler(). This commit also renames the following functions to avoid confusion. eficonfig_select_file_handler() -> eficonfig_process_select_file() eficonfig_select_file() -> eficonfig_show_file_selection() eficonfig_display_select_file_option() -> eficonfig_process_show_file_option() Finally, test_eficonfig.py need to be updated to get aligned with the above modification. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
1167e88a |
|
14-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix missing variable initialization The 'ret' variable must be initialized before use in eficonfig_delete_invalid_boot_option(). Fixes: c416f1c0bc ("bootmenu: add removable media entries") Addresses-Coverity: 376207 ("Uninitialized variables") Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
3d595ac5 |
|
09-Nov-2022 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: remove superfluous if in eficonfig_edit_boot_option Goto for an immediately succeeding label is superfluous. Fixes: 87d791423ac6 ("eficonfig: menu-driven addition of UEFI boot option") Addresses-Coverity: 376202 ("Identical code for different branches") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
32bab0ea |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Make use of CLI character processing Avoid duplicating some of the escape-sequence processing here and use the CLI function instead. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
d0ca98db |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Update bootmenu_loop() to return the code Use the return value to save having to pass around a pointer. This also resolves any ambiguity about what *key contains when the function is called. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
2da4a15e |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Rename KEY_... to BKEY_... This enum values conflict with linux/input.h so rename them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
64550274 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: avoid SetVariable between GetNextVariableName calls The current code calls efi_set_variable_int() to delete the invalid boot option between calls to efi_get_next_variable_name_int(), it may produce unpredictable results. This commit moves removal of the invalid boot option outside of the efi_get_next_variable_name_int() calls. EFI_NOT_FOUND returned from efi_get_next_variable_name_int() indicates we retrieved all EFI variables, it should be treated as EFI_SUCEESS. To address the checkpatch warning of too many leading tabs, combine two if statement into one. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
ce327084 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: carve out efi_get_next_variable_name_int calls To retrieve the EFI variable name by efi_get_next_variable_name_int(), the sequence of alloc -> efi_get_next_variable_name_int -> realloc -> efi_get_next_variable_name_int is required. In current code, this sequence repeatedly appears in the several functions. It should be curved out a common function. This commit also fixes the missing free() of var_name16 in eficonfig_delete_invalid_boot_option(). Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
140a8959 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use efi_get_next_variable_name_int() eficonfig command reads all possible UEFI load options from 0x0000 to 0xFFFF to construct the menu. This takes too much time in some environment. This commit uses efi_get_next_variable_name_int() to read all existing UEFI load options to significantlly reduce the count of efi_get_var() call. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
78b1ccc4 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use u16_strsize() to get u16 string buffer size Use u16_strsize() to simplify the u16 string buffer size calculation. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c67d3c9e |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix going one directory up issue The directory name in eficonfig menu entry contains the '\' separator. strcmp() argument ".." is wrong and one directory up handling does not work correctly. strcmp() argument must include '\' separator. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c3b5af63 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add UEFI Secure Boot Key enrollment interface This commit adds the menu-driven UEFI Secure Boot Key enrollment interface. User can enroll PK, KEK, db and dbx by selecting file. Only the signed EFI Signature List(s) with an authenticated header, typically '.auth' file, is accepted. To clear the PK, KEK, db and dbx, user needs to enroll the null key signed by PK or KEK. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
21faf4ef |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use protocol interface for file selection EFI_SIMPLE_FILE_SYSTEM_PROTOCOL is not always provided by U-Boot. Use protocol interface functions instead of U-Boot internal functions. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d6566113 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose eficonfig_create_device_path() Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use eficonfig_create_device_path() to construct the full device path from device path of the volume and file path, so move it out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d571f9b2 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation All the eficonfig menus other than "Change Boot Order" use 'eficonfig_entry' structure for each menu entry. This commit refactors change boot order implementation to use 'eficonfig_entry' structure same as other menus to have consistent menu handling. This commit also simplifies the data->active handling when KEY_SPACE is pressed, and sizeof() parameter. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
8961e93e |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose append entry function Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use append_entry() and append_quit_entry() to construct the menu, so move them out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
a84040ab |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor file selection handling eficonfig_select_file_handler() is commonly used to select the file. eficonfig_display_select_file_option() adds an additional menu to clear the selected file. eficonfig_display_select_file_option() is not always necessary for the file selection process, so it must be outside of eficonfig_select_file_handler(). This commit also renames the following functions to avoid confusion. eficonfig_select_file_handler() -> eficonfig_process_select_file() eficonfig_select_file() -> eficonfig_show_file_selection() eficonfig_display_select_file_option() -> eficonfig_process_show_file_option() Finally, test_eficonfig.py need to be updated to get aligned with the above modification. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
1167e88a |
|
14-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix missing variable initialization The 'ret' variable must be initialized before use in eficonfig_delete_invalid_boot_option(). Fixes: c416f1c0bc ("bootmenu: add removable media entries") Addresses-Coverity: 376207 ("Uninitialized variables") Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
3d595ac5 |
|
09-Nov-2022 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: remove superfluous if in eficonfig_edit_boot_option Goto for an immediately succeeding label is superfluous. Fixes: 87d791423ac6 ("eficonfig: menu-driven addition of UEFI boot option") Addresses-Coverity: 376202 ("Identical code for different branches") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
32bab0ea |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Make use of CLI character processing Avoid duplicating some of the escape-sequence processing here and use the CLI function instead. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
d0ca98db |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Update bootmenu_loop() to return the code Use the return value to save having to pass around a pointer. This also resolves any ambiguity about what *key contains when the function is called. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
2da4a15e |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Rename KEY_... to BKEY_... This enum values conflict with linux/input.h so rename them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
64550274 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: avoid SetVariable between GetNextVariableName calls The current code calls efi_set_variable_int() to delete the invalid boot option between calls to efi_get_next_variable_name_int(), it may produce unpredictable results. This commit moves removal of the invalid boot option outside of the efi_get_next_variable_name_int() calls. EFI_NOT_FOUND returned from efi_get_next_variable_name_int() indicates we retrieved all EFI variables, it should be treated as EFI_SUCEESS. To address the checkpatch warning of too many leading tabs, combine two if statement into one. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
ce327084 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: carve out efi_get_next_variable_name_int calls To retrieve the EFI variable name by efi_get_next_variable_name_int(), the sequence of alloc -> efi_get_next_variable_name_int -> realloc -> efi_get_next_variable_name_int is required. In current code, this sequence repeatedly appears in the several functions. It should be curved out a common function. This commit also fixes the missing free() of var_name16 in eficonfig_delete_invalid_boot_option(). Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
140a8959 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use efi_get_next_variable_name_int() eficonfig command reads all possible UEFI load options from 0x0000 to 0xFFFF to construct the menu. This takes too much time in some environment. This commit uses efi_get_next_variable_name_int() to read all existing UEFI load options to significantlly reduce the count of efi_get_var() call. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
78b1ccc4 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use u16_strsize() to get u16 string buffer size Use u16_strsize() to simplify the u16 string buffer size calculation. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c67d3c9e |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix going one directory up issue The directory name in eficonfig menu entry contains the '\' separator. strcmp() argument ".." is wrong and one directory up handling does not work correctly. strcmp() argument must include '\' separator. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c3b5af63 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add UEFI Secure Boot Key enrollment interface This commit adds the menu-driven UEFI Secure Boot Key enrollment interface. User can enroll PK, KEK, db and dbx by selecting file. Only the signed EFI Signature List(s) with an authenticated header, typically '.auth' file, is accepted. To clear the PK, KEK, db and dbx, user needs to enroll the null key signed by PK or KEK. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
21faf4ef |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use protocol interface for file selection EFI_SIMPLE_FILE_SYSTEM_PROTOCOL is not always provided by U-Boot. Use protocol interface functions instead of U-Boot internal functions. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d6566113 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose eficonfig_create_device_path() Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use eficonfig_create_device_path() to construct the full device path from device path of the volume and file path, so move it out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d571f9b2 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation All the eficonfig menus other than "Change Boot Order" use 'eficonfig_entry' structure for each menu entry. This commit refactors change boot order implementation to use 'eficonfig_entry' structure same as other menus to have consistent menu handling. This commit also simplifies the data->active handling when KEY_SPACE is pressed, and sizeof() parameter. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
8961e93e |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose append entry function Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use append_entry() and append_quit_entry() to construct the menu, so move them out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
a84040ab |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor file selection handling eficonfig_select_file_handler() is commonly used to select the file. eficonfig_display_select_file_option() adds an additional menu to clear the selected file. eficonfig_display_select_file_option() is not always necessary for the file selection process, so it must be outside of eficonfig_select_file_handler(). This commit also renames the following functions to avoid confusion. eficonfig_select_file_handler() -> eficonfig_process_select_file() eficonfig_select_file() -> eficonfig_show_file_selection() eficonfig_display_select_file_option() -> eficonfig_process_show_file_option() Finally, test_eficonfig.py need to be updated to get aligned with the above modification. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
1167e88a |
|
14-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix missing variable initialization The 'ret' variable must be initialized before use in eficonfig_delete_invalid_boot_option(). Fixes: c416f1c0bc ("bootmenu: add removable media entries") Addresses-Coverity: 376207 ("Uninitialized variables") Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
3d595ac5 |
|
09-Nov-2022 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: remove superfluous if in eficonfig_edit_boot_option Goto for an immediately succeeding label is superfluous. Fixes: 87d791423ac6 ("eficonfig: menu-driven addition of UEFI boot option") Addresses-Coverity: 376202 ("Identical code for different branches") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
32bab0ea |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Make use of CLI character processing Avoid duplicating some of the escape-sequence processing here and use the CLI function instead. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
d0ca98db |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Update bootmenu_loop() to return the code Use the return value to save having to pass around a pointer. This also resolves any ambiguity about what *key contains when the function is called. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
2da4a15e |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Rename KEY_... to BKEY_... This enum values conflict with linux/input.h so rename them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
64550274 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: avoid SetVariable between GetNextVariableName calls The current code calls efi_set_variable_int() to delete the invalid boot option between calls to efi_get_next_variable_name_int(), it may produce unpredictable results. This commit moves removal of the invalid boot option outside of the efi_get_next_variable_name_int() calls. EFI_NOT_FOUND returned from efi_get_next_variable_name_int() indicates we retrieved all EFI variables, it should be treated as EFI_SUCEESS. To address the checkpatch warning of too many leading tabs, combine two if statement into one. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
ce327084 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: carve out efi_get_next_variable_name_int calls To retrieve the EFI variable name by efi_get_next_variable_name_int(), the sequence of alloc -> efi_get_next_variable_name_int -> realloc -> efi_get_next_variable_name_int is required. In current code, this sequence repeatedly appears in the several functions. It should be curved out a common function. This commit also fixes the missing free() of var_name16 in eficonfig_delete_invalid_boot_option(). Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
140a8959 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use efi_get_next_variable_name_int() eficonfig command reads all possible UEFI load options from 0x0000 to 0xFFFF to construct the menu. This takes too much time in some environment. This commit uses efi_get_next_variable_name_int() to read all existing UEFI load options to significantlly reduce the count of efi_get_var() call. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
78b1ccc4 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use u16_strsize() to get u16 string buffer size Use u16_strsize() to simplify the u16 string buffer size calculation. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c67d3c9e |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix going one directory up issue The directory name in eficonfig menu entry contains the '\' separator. strcmp() argument ".." is wrong and one directory up handling does not work correctly. strcmp() argument must include '\' separator. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c3b5af63 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add UEFI Secure Boot Key enrollment interface This commit adds the menu-driven UEFI Secure Boot Key enrollment interface. User can enroll PK, KEK, db and dbx by selecting file. Only the signed EFI Signature List(s) with an authenticated header, typically '.auth' file, is accepted. To clear the PK, KEK, db and dbx, user needs to enroll the null key signed by PK or KEK. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
21faf4ef |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use protocol interface for file selection EFI_SIMPLE_FILE_SYSTEM_PROTOCOL is not always provided by U-Boot. Use protocol interface functions instead of U-Boot internal functions. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d6566113 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose eficonfig_create_device_path() Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use eficonfig_create_device_path() to construct the full device path from device path of the volume and file path, so move it out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d571f9b2 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation All the eficonfig menus other than "Change Boot Order" use 'eficonfig_entry' structure for each menu entry. This commit refactors change boot order implementation to use 'eficonfig_entry' structure same as other menus to have consistent menu handling. This commit also simplifies the data->active handling when KEY_SPACE is pressed, and sizeof() parameter. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
8961e93e |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose append entry function Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use append_entry() and append_quit_entry() to construct the menu, so move them out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
a84040ab |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor file selection handling eficonfig_select_file_handler() is commonly used to select the file. eficonfig_display_select_file_option() adds an additional menu to clear the selected file. eficonfig_display_select_file_option() is not always necessary for the file selection process, so it must be outside of eficonfig_select_file_handler(). This commit also renames the following functions to avoid confusion. eficonfig_select_file_handler() -> eficonfig_process_select_file() eficonfig_select_file() -> eficonfig_show_file_selection() eficonfig_display_select_file_option() -> eficonfig_process_show_file_option() Finally, test_eficonfig.py need to be updated to get aligned with the above modification. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
1167e88a |
|
14-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix missing variable initialization The 'ret' variable must be initialized before use in eficonfig_delete_invalid_boot_option(). Fixes: c416f1c0bc ("bootmenu: add removable media entries") Addresses-Coverity: 376207 ("Uninitialized variables") Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
3d595ac5 |
|
09-Nov-2022 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: remove superfluous if in eficonfig_edit_boot_option Goto for an immediately succeeding label is superfluous. Fixes: 87d791423ac6 ("eficonfig: menu-driven addition of UEFI boot option") Addresses-Coverity: 376202 ("Identical code for different branches") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
32bab0ea |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Make use of CLI character processing Avoid duplicating some of the escape-sequence processing here and use the CLI function instead. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
d0ca98db |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Update bootmenu_loop() to return the code Use the return value to save having to pass around a pointer. This also resolves any ambiguity about what *key contains when the function is called. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
2da4a15e |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Rename KEY_... to BKEY_... This enum values conflict with linux/input.h so rename them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
64550274 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: avoid SetVariable between GetNextVariableName calls The current code calls efi_set_variable_int() to delete the invalid boot option between calls to efi_get_next_variable_name_int(), it may produce unpredictable results. This commit moves removal of the invalid boot option outside of the efi_get_next_variable_name_int() calls. EFI_NOT_FOUND returned from efi_get_next_variable_name_int() indicates we retrieved all EFI variables, it should be treated as EFI_SUCEESS. To address the checkpatch warning of too many leading tabs, combine two if statement into one. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
ce327084 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: carve out efi_get_next_variable_name_int calls To retrieve the EFI variable name by efi_get_next_variable_name_int(), the sequence of alloc -> efi_get_next_variable_name_int -> realloc -> efi_get_next_variable_name_int is required. In current code, this sequence repeatedly appears in the several functions. It should be curved out a common function. This commit also fixes the missing free() of var_name16 in eficonfig_delete_invalid_boot_option(). Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
140a8959 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use efi_get_next_variable_name_int() eficonfig command reads all possible UEFI load options from 0x0000 to 0xFFFF to construct the menu. This takes too much time in some environment. This commit uses efi_get_next_variable_name_int() to read all existing UEFI load options to significantlly reduce the count of efi_get_var() call. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
78b1ccc4 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use u16_strsize() to get u16 string buffer size Use u16_strsize() to simplify the u16 string buffer size calculation. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c67d3c9e |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix going one directory up issue The directory name in eficonfig menu entry contains the '\' separator. strcmp() argument ".." is wrong and one directory up handling does not work correctly. strcmp() argument must include '\' separator. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c3b5af63 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add UEFI Secure Boot Key enrollment interface This commit adds the menu-driven UEFI Secure Boot Key enrollment interface. User can enroll PK, KEK, db and dbx by selecting file. Only the signed EFI Signature List(s) with an authenticated header, typically '.auth' file, is accepted. To clear the PK, KEK, db and dbx, user needs to enroll the null key signed by PK or KEK. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
21faf4ef |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use protocol interface for file selection EFI_SIMPLE_FILE_SYSTEM_PROTOCOL is not always provided by U-Boot. Use protocol interface functions instead of U-Boot internal functions. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d6566113 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose eficonfig_create_device_path() Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use eficonfig_create_device_path() to construct the full device path from device path of the volume and file path, so move it out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d571f9b2 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation All the eficonfig menus other than "Change Boot Order" use 'eficonfig_entry' structure for each menu entry. This commit refactors change boot order implementation to use 'eficonfig_entry' structure same as other menus to have consistent menu handling. This commit also simplifies the data->active handling when KEY_SPACE is pressed, and sizeof() parameter. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
8961e93e |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose append entry function Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use append_entry() and append_quit_entry() to construct the menu, so move them out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
a84040ab |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor file selection handling eficonfig_select_file_handler() is commonly used to select the file. eficonfig_display_select_file_option() adds an additional menu to clear the selected file. eficonfig_display_select_file_option() is not always necessary for the file selection process, so it must be outside of eficonfig_select_file_handler(). This commit also renames the following functions to avoid confusion. eficonfig_select_file_handler() -> eficonfig_process_select_file() eficonfig_select_file() -> eficonfig_show_file_selection() eficonfig_display_select_file_option() -> eficonfig_process_show_file_option() Finally, test_eficonfig.py need to be updated to get aligned with the above modification. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
1167e88a |
|
14-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix missing variable initialization The 'ret' variable must be initialized before use in eficonfig_delete_invalid_boot_option(). Fixes: c416f1c0bc ("bootmenu: add removable media entries") Addresses-Coverity: 376207 ("Uninitialized variables") Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
3d595ac5 |
|
09-Nov-2022 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: remove superfluous if in eficonfig_edit_boot_option Goto for an immediately succeeding label is superfluous. Fixes: 87d791423ac6 ("eficonfig: menu-driven addition of UEFI boot option") Addresses-Coverity: 376202 ("Identical code for different branches") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
32bab0ea |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Make use of CLI character processing Avoid duplicating some of the escape-sequence processing here and use the CLI function instead. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
d0ca98db |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Update bootmenu_loop() to return the code Use the return value to save having to pass around a pointer. This also resolves any ambiguity about what *key contains when the function is called. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
2da4a15e |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Rename KEY_... to BKEY_... This enum values conflict with linux/input.h so rename them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
64550274 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: avoid SetVariable between GetNextVariableName calls The current code calls efi_set_variable_int() to delete the invalid boot option between calls to efi_get_next_variable_name_int(), it may produce unpredictable results. This commit moves removal of the invalid boot option outside of the efi_get_next_variable_name_int() calls. EFI_NOT_FOUND returned from efi_get_next_variable_name_int() indicates we retrieved all EFI variables, it should be treated as EFI_SUCEESS. To address the checkpatch warning of too many leading tabs, combine two if statement into one. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
ce327084 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: carve out efi_get_next_variable_name_int calls To retrieve the EFI variable name by efi_get_next_variable_name_int(), the sequence of alloc -> efi_get_next_variable_name_int -> realloc -> efi_get_next_variable_name_int is required. In current code, this sequence repeatedly appears in the several functions. It should be curved out a common function. This commit also fixes the missing free() of var_name16 in eficonfig_delete_invalid_boot_option(). Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
140a8959 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use efi_get_next_variable_name_int() eficonfig command reads all possible UEFI load options from 0x0000 to 0xFFFF to construct the menu. This takes too much time in some environment. This commit uses efi_get_next_variable_name_int() to read all existing UEFI load options to significantlly reduce the count of efi_get_var() call. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
78b1ccc4 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use u16_strsize() to get u16 string buffer size Use u16_strsize() to simplify the u16 string buffer size calculation. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c67d3c9e |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix going one directory up issue The directory name in eficonfig menu entry contains the '\' separator. strcmp() argument ".." is wrong and one directory up handling does not work correctly. strcmp() argument must include '\' separator. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c3b5af63 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add UEFI Secure Boot Key enrollment interface This commit adds the menu-driven UEFI Secure Boot Key enrollment interface. User can enroll PK, KEK, db and dbx by selecting file. Only the signed EFI Signature List(s) with an authenticated header, typically '.auth' file, is accepted. To clear the PK, KEK, db and dbx, user needs to enroll the null key signed by PK or KEK. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
21faf4ef |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use protocol interface for file selection EFI_SIMPLE_FILE_SYSTEM_PROTOCOL is not always provided by U-Boot. Use protocol interface functions instead of U-Boot internal functions. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d6566113 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose eficonfig_create_device_path() Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use eficonfig_create_device_path() to construct the full device path from device path of the volume and file path, so move it out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d571f9b2 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation All the eficonfig menus other than "Change Boot Order" use 'eficonfig_entry' structure for each menu entry. This commit refactors change boot order implementation to use 'eficonfig_entry' structure same as other menus to have consistent menu handling. This commit also simplifies the data->active handling when KEY_SPACE is pressed, and sizeof() parameter. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
8961e93e |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose append entry function Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use append_entry() and append_quit_entry() to construct the menu, so move them out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
a84040ab |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor file selection handling eficonfig_select_file_handler() is commonly used to select the file. eficonfig_display_select_file_option() adds an additional menu to clear the selected file. eficonfig_display_select_file_option() is not always necessary for the file selection process, so it must be outside of eficonfig_select_file_handler(). This commit also renames the following functions to avoid confusion. eficonfig_select_file_handler() -> eficonfig_process_select_file() eficonfig_select_file() -> eficonfig_show_file_selection() eficonfig_display_select_file_option() -> eficonfig_process_show_file_option() Finally, test_eficonfig.py need to be updated to get aligned with the above modification. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
1167e88a |
|
14-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix missing variable initialization The 'ret' variable must be initialized before use in eficonfig_delete_invalid_boot_option(). Fixes: c416f1c0bc ("bootmenu: add removable media entries") Addresses-Coverity: 376207 ("Uninitialized variables") Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
3d595ac5 |
|
09-Nov-2022 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: remove superfluous if in eficonfig_edit_boot_option Goto for an immediately succeeding label is superfluous. Fixes: 87d791423ac6 ("eficonfig: menu-driven addition of UEFI boot option") Addresses-Coverity: 376202 ("Identical code for different branches") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
32bab0ea |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Make use of CLI character processing Avoid duplicating some of the escape-sequence processing here and use the CLI function instead. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
d0ca98db |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Update bootmenu_loop() to return the code Use the return value to save having to pass around a pointer. This also resolves any ambiguity about what *key contains when the function is called. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
2da4a15e |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Rename KEY_... to BKEY_... This enum values conflict with linux/input.h so rename them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
64550274 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: avoid SetVariable between GetNextVariableName calls The current code calls efi_set_variable_int() to delete the invalid boot option between calls to efi_get_next_variable_name_int(), it may produce unpredictable results. This commit moves removal of the invalid boot option outside of the efi_get_next_variable_name_int() calls. EFI_NOT_FOUND returned from efi_get_next_variable_name_int() indicates we retrieved all EFI variables, it should be treated as EFI_SUCEESS. To address the checkpatch warning of too many leading tabs, combine two if statement into one. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
ce327084 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: carve out efi_get_next_variable_name_int calls To retrieve the EFI variable name by efi_get_next_variable_name_int(), the sequence of alloc -> efi_get_next_variable_name_int -> realloc -> efi_get_next_variable_name_int is required. In current code, this sequence repeatedly appears in the several functions. It should be curved out a common function. This commit also fixes the missing free() of var_name16 in eficonfig_delete_invalid_boot_option(). Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
140a8959 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use efi_get_next_variable_name_int() eficonfig command reads all possible UEFI load options from 0x0000 to 0xFFFF to construct the menu. This takes too much time in some environment. This commit uses efi_get_next_variable_name_int() to read all existing UEFI load options to significantlly reduce the count of efi_get_var() call. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
78b1ccc4 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use u16_strsize() to get u16 string buffer size Use u16_strsize() to simplify the u16 string buffer size calculation. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c67d3c9e |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix going one directory up issue The directory name in eficonfig menu entry contains the '\' separator. strcmp() argument ".." is wrong and one directory up handling does not work correctly. strcmp() argument must include '\' separator. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c3b5af63 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add UEFI Secure Boot Key enrollment interface This commit adds the menu-driven UEFI Secure Boot Key enrollment interface. User can enroll PK, KEK, db and dbx by selecting file. Only the signed EFI Signature List(s) with an authenticated header, typically '.auth' file, is accepted. To clear the PK, KEK, db and dbx, user needs to enroll the null key signed by PK or KEK. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
21faf4ef |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use protocol interface for file selection EFI_SIMPLE_FILE_SYSTEM_PROTOCOL is not always provided by U-Boot. Use protocol interface functions instead of U-Boot internal functions. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d6566113 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose eficonfig_create_device_path() Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use eficonfig_create_device_path() to construct the full device path from device path of the volume and file path, so move it out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d571f9b2 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation All the eficonfig menus other than "Change Boot Order" use 'eficonfig_entry' structure for each menu entry. This commit refactors change boot order implementation to use 'eficonfig_entry' structure same as other menus to have consistent menu handling. This commit also simplifies the data->active handling when KEY_SPACE is pressed, and sizeof() parameter. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
8961e93e |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose append entry function Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use append_entry() and append_quit_entry() to construct the menu, so move them out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
a84040ab |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor file selection handling eficonfig_select_file_handler() is commonly used to select the file. eficonfig_display_select_file_option() adds an additional menu to clear the selected file. eficonfig_display_select_file_option() is not always necessary for the file selection process, so it must be outside of eficonfig_select_file_handler(). This commit also renames the following functions to avoid confusion. eficonfig_select_file_handler() -> eficonfig_process_select_file() eficonfig_select_file() -> eficonfig_show_file_selection() eficonfig_display_select_file_option() -> eficonfig_process_show_file_option() Finally, test_eficonfig.py need to be updated to get aligned with the above modification. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
1167e88a |
|
14-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix missing variable initialization The 'ret' variable must be initialized before use in eficonfig_delete_invalid_boot_option(). Fixes: c416f1c0bc ("bootmenu: add removable media entries") Addresses-Coverity: 376207 ("Uninitialized variables") Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
3d595ac5 |
|
09-Nov-2022 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: remove superfluous if in eficonfig_edit_boot_option Goto for an immediately succeeding label is superfluous. Fixes: 87d791423ac6 ("eficonfig: menu-driven addition of UEFI boot option") Addresses-Coverity: 376202 ("Identical code for different branches") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
32bab0ea |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Make use of CLI character processing Avoid duplicating some of the escape-sequence processing here and use the CLI function instead. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
d0ca98db |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Update bootmenu_loop() to return the code Use the return value to save having to pass around a pointer. This also resolves any ambiguity about what *key contains when the function is called. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
2da4a15e |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Rename KEY_... to BKEY_... This enum values conflict with linux/input.h so rename them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
64550274 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: avoid SetVariable between GetNextVariableName calls The current code calls efi_set_variable_int() to delete the invalid boot option between calls to efi_get_next_variable_name_int(), it may produce unpredictable results. This commit moves removal of the invalid boot option outside of the efi_get_next_variable_name_int() calls. EFI_NOT_FOUND returned from efi_get_next_variable_name_int() indicates we retrieved all EFI variables, it should be treated as EFI_SUCEESS. To address the checkpatch warning of too many leading tabs, combine two if statement into one. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
ce327084 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: carve out efi_get_next_variable_name_int calls To retrieve the EFI variable name by efi_get_next_variable_name_int(), the sequence of alloc -> efi_get_next_variable_name_int -> realloc -> efi_get_next_variable_name_int is required. In current code, this sequence repeatedly appears in the several functions. It should be curved out a common function. This commit also fixes the missing free() of var_name16 in eficonfig_delete_invalid_boot_option(). Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
140a8959 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use efi_get_next_variable_name_int() eficonfig command reads all possible UEFI load options from 0x0000 to 0xFFFF to construct the menu. This takes too much time in some environment. This commit uses efi_get_next_variable_name_int() to read all existing UEFI load options to significantlly reduce the count of efi_get_var() call. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
78b1ccc4 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use u16_strsize() to get u16 string buffer size Use u16_strsize() to simplify the u16 string buffer size calculation. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c67d3c9e |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix going one directory up issue The directory name in eficonfig menu entry contains the '\' separator. strcmp() argument ".." is wrong and one directory up handling does not work correctly. strcmp() argument must include '\' separator. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c3b5af63 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add UEFI Secure Boot Key enrollment interface This commit adds the menu-driven UEFI Secure Boot Key enrollment interface. User can enroll PK, KEK, db and dbx by selecting file. Only the signed EFI Signature List(s) with an authenticated header, typically '.auth' file, is accepted. To clear the PK, KEK, db and dbx, user needs to enroll the null key signed by PK or KEK. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
21faf4ef |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use protocol interface for file selection EFI_SIMPLE_FILE_SYSTEM_PROTOCOL is not always provided by U-Boot. Use protocol interface functions instead of U-Boot internal functions. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d6566113 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose eficonfig_create_device_path() Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use eficonfig_create_device_path() to construct the full device path from device path of the volume and file path, so move it out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d571f9b2 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation All the eficonfig menus other than "Change Boot Order" use 'eficonfig_entry' structure for each menu entry. This commit refactors change boot order implementation to use 'eficonfig_entry' structure same as other menus to have consistent menu handling. This commit also simplifies the data->active handling when KEY_SPACE is pressed, and sizeof() parameter. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
8961e93e |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose append entry function Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use append_entry() and append_quit_entry() to construct the menu, so move them out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
a84040ab |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor file selection handling eficonfig_select_file_handler() is commonly used to select the file. eficonfig_display_select_file_option() adds an additional menu to clear the selected file. eficonfig_display_select_file_option() is not always necessary for the file selection process, so it must be outside of eficonfig_select_file_handler(). This commit also renames the following functions to avoid confusion. eficonfig_select_file_handler() -> eficonfig_process_select_file() eficonfig_select_file() -> eficonfig_show_file_selection() eficonfig_display_select_file_option() -> eficonfig_process_show_file_option() Finally, test_eficonfig.py need to be updated to get aligned with the above modification. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
1167e88a |
|
14-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix missing variable initialization The 'ret' variable must be initialized before use in eficonfig_delete_invalid_boot_option(). Fixes: c416f1c0bc ("bootmenu: add removable media entries") Addresses-Coverity: 376207 ("Uninitialized variables") Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
3d595ac5 |
|
09-Nov-2022 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: remove superfluous if in eficonfig_edit_boot_option Goto for an immediately succeeding label is superfluous. Fixes: 87d791423ac6 ("eficonfig: menu-driven addition of UEFI boot option") Addresses-Coverity: 376202 ("Identical code for different branches") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
32bab0ea |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Make use of CLI character processing Avoid duplicating some of the escape-sequence processing here and use the CLI function instead. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
d0ca98db |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Update bootmenu_loop() to return the code Use the return value to save having to pass around a pointer. This also resolves any ambiguity about what *key contains when the function is called. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
2da4a15e |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Rename KEY_... to BKEY_... This enum values conflict with linux/input.h so rename them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
64550274 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: avoid SetVariable between GetNextVariableName calls The current code calls efi_set_variable_int() to delete the invalid boot option between calls to efi_get_next_variable_name_int(), it may produce unpredictable results. This commit moves removal of the invalid boot option outside of the efi_get_next_variable_name_int() calls. EFI_NOT_FOUND returned from efi_get_next_variable_name_int() indicates we retrieved all EFI variables, it should be treated as EFI_SUCEESS. To address the checkpatch warning of too many leading tabs, combine two if statement into one. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
ce327084 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: carve out efi_get_next_variable_name_int calls To retrieve the EFI variable name by efi_get_next_variable_name_int(), the sequence of alloc -> efi_get_next_variable_name_int -> realloc -> efi_get_next_variable_name_int is required. In current code, this sequence repeatedly appears in the several functions. It should be curved out a common function. This commit also fixes the missing free() of var_name16 in eficonfig_delete_invalid_boot_option(). Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
140a8959 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use efi_get_next_variable_name_int() eficonfig command reads all possible UEFI load options from 0x0000 to 0xFFFF to construct the menu. This takes too much time in some environment. This commit uses efi_get_next_variable_name_int() to read all existing UEFI load options to significantlly reduce the count of efi_get_var() call. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
78b1ccc4 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use u16_strsize() to get u16 string buffer size Use u16_strsize() to simplify the u16 string buffer size calculation. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c67d3c9e |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix going one directory up issue The directory name in eficonfig menu entry contains the '\' separator. strcmp() argument ".." is wrong and one directory up handling does not work correctly. strcmp() argument must include '\' separator. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c3b5af63 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add UEFI Secure Boot Key enrollment interface This commit adds the menu-driven UEFI Secure Boot Key enrollment interface. User can enroll PK, KEK, db and dbx by selecting file. Only the signed EFI Signature List(s) with an authenticated header, typically '.auth' file, is accepted. To clear the PK, KEK, db and dbx, user needs to enroll the null key signed by PK or KEK. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
21faf4ef |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use protocol interface for file selection EFI_SIMPLE_FILE_SYSTEM_PROTOCOL is not always provided by U-Boot. Use protocol interface functions instead of U-Boot internal functions. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d6566113 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose eficonfig_create_device_path() Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use eficonfig_create_device_path() to construct the full device path from device path of the volume and file path, so move it out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d571f9b2 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation All the eficonfig menus other than "Change Boot Order" use 'eficonfig_entry' structure for each menu entry. This commit refactors change boot order implementation to use 'eficonfig_entry' structure same as other menus to have consistent menu handling. This commit also simplifies the data->active handling when KEY_SPACE is pressed, and sizeof() parameter. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
8961e93e |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose append entry function Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use append_entry() and append_quit_entry() to construct the menu, so move them out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
a84040ab |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor file selection handling eficonfig_select_file_handler() is commonly used to select the file. eficonfig_display_select_file_option() adds an additional menu to clear the selected file. eficonfig_display_select_file_option() is not always necessary for the file selection process, so it must be outside of eficonfig_select_file_handler(). This commit also renames the following functions to avoid confusion. eficonfig_select_file_handler() -> eficonfig_process_select_file() eficonfig_select_file() -> eficonfig_show_file_selection() eficonfig_display_select_file_option() -> eficonfig_process_show_file_option() Finally, test_eficonfig.py need to be updated to get aligned with the above modification. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
1167e88a |
|
14-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix missing variable initialization The 'ret' variable must be initialized before use in eficonfig_delete_invalid_boot_option(). Fixes: c416f1c0bc ("bootmenu: add removable media entries") Addresses-Coverity: 376207 ("Uninitialized variables") Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
3d595ac5 |
|
09-Nov-2022 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: remove superfluous if in eficonfig_edit_boot_option Goto for an immediately succeeding label is superfluous. Fixes: 87d791423ac6 ("eficonfig: menu-driven addition of UEFI boot option") Addresses-Coverity: 376202 ("Identical code for different branches") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
32bab0ea |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Make use of CLI character processing Avoid duplicating some of the escape-sequence processing here and use the CLI function instead. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
d0ca98db |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Update bootmenu_loop() to return the code Use the return value to save having to pass around a pointer. This also resolves any ambiguity about what *key contains when the function is called. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
2da4a15e |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Rename KEY_... to BKEY_... This enum values conflict with linux/input.h so rename them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
64550274 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: avoid SetVariable between GetNextVariableName calls The current code calls efi_set_variable_int() to delete the invalid boot option between calls to efi_get_next_variable_name_int(), it may produce unpredictable results. This commit moves removal of the invalid boot option outside of the efi_get_next_variable_name_int() calls. EFI_NOT_FOUND returned from efi_get_next_variable_name_int() indicates we retrieved all EFI variables, it should be treated as EFI_SUCEESS. To address the checkpatch warning of too many leading tabs, combine two if statement into one. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
ce327084 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: carve out efi_get_next_variable_name_int calls To retrieve the EFI variable name by efi_get_next_variable_name_int(), the sequence of alloc -> efi_get_next_variable_name_int -> realloc -> efi_get_next_variable_name_int is required. In current code, this sequence repeatedly appears in the several functions. It should be curved out a common function. This commit also fixes the missing free() of var_name16 in eficonfig_delete_invalid_boot_option(). Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
140a8959 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use efi_get_next_variable_name_int() eficonfig command reads all possible UEFI load options from 0x0000 to 0xFFFF to construct the menu. This takes too much time in some environment. This commit uses efi_get_next_variable_name_int() to read all existing UEFI load options to significantlly reduce the count of efi_get_var() call. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
78b1ccc4 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use u16_strsize() to get u16 string buffer size Use u16_strsize() to simplify the u16 string buffer size calculation. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c67d3c9e |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix going one directory up issue The directory name in eficonfig menu entry contains the '\' separator. strcmp() argument ".." is wrong and one directory up handling does not work correctly. strcmp() argument must include '\' separator. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c3b5af63 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add UEFI Secure Boot Key enrollment interface This commit adds the menu-driven UEFI Secure Boot Key enrollment interface. User can enroll PK, KEK, db and dbx by selecting file. Only the signed EFI Signature List(s) with an authenticated header, typically '.auth' file, is accepted. To clear the PK, KEK, db and dbx, user needs to enroll the null key signed by PK or KEK. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
21faf4ef |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use protocol interface for file selection EFI_SIMPLE_FILE_SYSTEM_PROTOCOL is not always provided by U-Boot. Use protocol interface functions instead of U-Boot internal functions. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d6566113 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose eficonfig_create_device_path() Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use eficonfig_create_device_path() to construct the full device path from device path of the volume and file path, so move it out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d571f9b2 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation All the eficonfig menus other than "Change Boot Order" use 'eficonfig_entry' structure for each menu entry. This commit refactors change boot order implementation to use 'eficonfig_entry' structure same as other menus to have consistent menu handling. This commit also simplifies the data->active handling when KEY_SPACE is pressed, and sizeof() parameter. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
8961e93e |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose append entry function Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use append_entry() and append_quit_entry() to construct the menu, so move them out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
a84040ab |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor file selection handling eficonfig_select_file_handler() is commonly used to select the file. eficonfig_display_select_file_option() adds an additional menu to clear the selected file. eficonfig_display_select_file_option() is not always necessary for the file selection process, so it must be outside of eficonfig_select_file_handler(). This commit also renames the following functions to avoid confusion. eficonfig_select_file_handler() -> eficonfig_process_select_file() eficonfig_select_file() -> eficonfig_show_file_selection() eficonfig_display_select_file_option() -> eficonfig_process_show_file_option() Finally, test_eficonfig.py need to be updated to get aligned with the above modification. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
1167e88a |
|
14-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix missing variable initialization The 'ret' variable must be initialized before use in eficonfig_delete_invalid_boot_option(). Fixes: c416f1c0bc ("bootmenu: add removable media entries") Addresses-Coverity: 376207 ("Uninitialized variables") Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
3d595ac5 |
|
09-Nov-2022 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: remove superfluous if in eficonfig_edit_boot_option Goto for an immediately succeeding label is superfluous. Fixes: 87d791423ac6 ("eficonfig: menu-driven addition of UEFI boot option") Addresses-Coverity: 376202 ("Identical code for different branches") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
32bab0ea |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Make use of CLI character processing Avoid duplicating some of the escape-sequence processing here and use the CLI function instead. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
d0ca98db |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Update bootmenu_loop() to return the code Use the return value to save having to pass around a pointer. This also resolves any ambiguity about what *key contains when the function is called. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
2da4a15e |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Rename KEY_... to BKEY_... This enum values conflict with linux/input.h so rename them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
64550274 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: avoid SetVariable between GetNextVariableName calls The current code calls efi_set_variable_int() to delete the invalid boot option between calls to efi_get_next_variable_name_int(), it may produce unpredictable results. This commit moves removal of the invalid boot option outside of the efi_get_next_variable_name_int() calls. EFI_NOT_FOUND returned from efi_get_next_variable_name_int() indicates we retrieved all EFI variables, it should be treated as EFI_SUCEESS. To address the checkpatch warning of too many leading tabs, combine two if statement into one. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
ce327084 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: carve out efi_get_next_variable_name_int calls To retrieve the EFI variable name by efi_get_next_variable_name_int(), the sequence of alloc -> efi_get_next_variable_name_int -> realloc -> efi_get_next_variable_name_int is required. In current code, this sequence repeatedly appears in the several functions. It should be curved out a common function. This commit also fixes the missing free() of var_name16 in eficonfig_delete_invalid_boot_option(). Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
140a8959 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use efi_get_next_variable_name_int() eficonfig command reads all possible UEFI load options from 0x0000 to 0xFFFF to construct the menu. This takes too much time in some environment. This commit uses efi_get_next_variable_name_int() to read all existing UEFI load options to significantlly reduce the count of efi_get_var() call. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
78b1ccc4 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use u16_strsize() to get u16 string buffer size Use u16_strsize() to simplify the u16 string buffer size calculation. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c67d3c9e |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix going one directory up issue The directory name in eficonfig menu entry contains the '\' separator. strcmp() argument ".." is wrong and one directory up handling does not work correctly. strcmp() argument must include '\' separator. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c3b5af63 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add UEFI Secure Boot Key enrollment interface This commit adds the menu-driven UEFI Secure Boot Key enrollment interface. User can enroll PK, KEK, db and dbx by selecting file. Only the signed EFI Signature List(s) with an authenticated header, typically '.auth' file, is accepted. To clear the PK, KEK, db and dbx, user needs to enroll the null key signed by PK or KEK. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
21faf4ef |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use protocol interface for file selection EFI_SIMPLE_FILE_SYSTEM_PROTOCOL is not always provided by U-Boot. Use protocol interface functions instead of U-Boot internal functions. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d6566113 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose eficonfig_create_device_path() Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use eficonfig_create_device_path() to construct the full device path from device path of the volume and file path, so move it out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d571f9b2 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation All the eficonfig menus other than "Change Boot Order" use 'eficonfig_entry' structure for each menu entry. This commit refactors change boot order implementation to use 'eficonfig_entry' structure same as other menus to have consistent menu handling. This commit also simplifies the data->active handling when KEY_SPACE is pressed, and sizeof() parameter. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
8961e93e |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose append entry function Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use append_entry() and append_quit_entry() to construct the menu, so move them out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
a84040ab |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor file selection handling eficonfig_select_file_handler() is commonly used to select the file. eficonfig_display_select_file_option() adds an additional menu to clear the selected file. eficonfig_display_select_file_option() is not always necessary for the file selection process, so it must be outside of eficonfig_select_file_handler(). This commit also renames the following functions to avoid confusion. eficonfig_select_file_handler() -> eficonfig_process_select_file() eficonfig_select_file() -> eficonfig_show_file_selection() eficonfig_display_select_file_option() -> eficonfig_process_show_file_option() Finally, test_eficonfig.py need to be updated to get aligned with the above modification. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
1167e88a |
|
14-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix missing variable initialization The 'ret' variable must be initialized before use in eficonfig_delete_invalid_boot_option(). Fixes: c416f1c0bc ("bootmenu: add removable media entries") Addresses-Coverity: 376207 ("Uninitialized variables") Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
3d595ac5 |
|
09-Nov-2022 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: remove superfluous if in eficonfig_edit_boot_option Goto for an immediately succeeding label is superfluous. Fixes: 87d791423ac6 ("eficonfig: menu-driven addition of UEFI boot option") Addresses-Coverity: 376202 ("Identical code for different branches") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
32bab0ea |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Make use of CLI character processing Avoid duplicating some of the escape-sequence processing here and use the CLI function instead. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
d0ca98db |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Update bootmenu_loop() to return the code Use the return value to save having to pass around a pointer. This also resolves any ambiguity about what *key contains when the function is called. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
2da4a15e |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Rename KEY_... to BKEY_... This enum values conflict with linux/input.h so rename them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
64550274 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: avoid SetVariable between GetNextVariableName calls The current code calls efi_set_variable_int() to delete the invalid boot option between calls to efi_get_next_variable_name_int(), it may produce unpredictable results. This commit moves removal of the invalid boot option outside of the efi_get_next_variable_name_int() calls. EFI_NOT_FOUND returned from efi_get_next_variable_name_int() indicates we retrieved all EFI variables, it should be treated as EFI_SUCEESS. To address the checkpatch warning of too many leading tabs, combine two if statement into one. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
ce327084 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: carve out efi_get_next_variable_name_int calls To retrieve the EFI variable name by efi_get_next_variable_name_int(), the sequence of alloc -> efi_get_next_variable_name_int -> realloc -> efi_get_next_variable_name_int is required. In current code, this sequence repeatedly appears in the several functions. It should be curved out a common function. This commit also fixes the missing free() of var_name16 in eficonfig_delete_invalid_boot_option(). Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
140a8959 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use efi_get_next_variable_name_int() eficonfig command reads all possible UEFI load options from 0x0000 to 0xFFFF to construct the menu. This takes too much time in some environment. This commit uses efi_get_next_variable_name_int() to read all existing UEFI load options to significantlly reduce the count of efi_get_var() call. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
78b1ccc4 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use u16_strsize() to get u16 string buffer size Use u16_strsize() to simplify the u16 string buffer size calculation. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c67d3c9e |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix going one directory up issue The directory name in eficonfig menu entry contains the '\' separator. strcmp() argument ".." is wrong and one directory up handling does not work correctly. strcmp() argument must include '\' separator. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c3b5af63 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add UEFI Secure Boot Key enrollment interface This commit adds the menu-driven UEFI Secure Boot Key enrollment interface. User can enroll PK, KEK, db and dbx by selecting file. Only the signed EFI Signature List(s) with an authenticated header, typically '.auth' file, is accepted. To clear the PK, KEK, db and dbx, user needs to enroll the null key signed by PK or KEK. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
21faf4ef |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use protocol interface for file selection EFI_SIMPLE_FILE_SYSTEM_PROTOCOL is not always provided by U-Boot. Use protocol interface functions instead of U-Boot internal functions. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d6566113 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose eficonfig_create_device_path() Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use eficonfig_create_device_path() to construct the full device path from device path of the volume and file path, so move it out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d571f9b2 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation All the eficonfig menus other than "Change Boot Order" use 'eficonfig_entry' structure for each menu entry. This commit refactors change boot order implementation to use 'eficonfig_entry' structure same as other menus to have consistent menu handling. This commit also simplifies the data->active handling when KEY_SPACE is pressed, and sizeof() parameter. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
8961e93e |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose append entry function Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use append_entry() and append_quit_entry() to construct the menu, so move them out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
a84040ab |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor file selection handling eficonfig_select_file_handler() is commonly used to select the file. eficonfig_display_select_file_option() adds an additional menu to clear the selected file. eficonfig_display_select_file_option() is not always necessary for the file selection process, so it must be outside of eficonfig_select_file_handler(). This commit also renames the following functions to avoid confusion. eficonfig_select_file_handler() -> eficonfig_process_select_file() eficonfig_select_file() -> eficonfig_show_file_selection() eficonfig_display_select_file_option() -> eficonfig_process_show_file_option() Finally, test_eficonfig.py need to be updated to get aligned with the above modification. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
1167e88a |
|
14-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix missing variable initialization The 'ret' variable must be initialized before use in eficonfig_delete_invalid_boot_option(). Fixes: c416f1c0bc ("bootmenu: add removable media entries") Addresses-Coverity: 376207 ("Uninitialized variables") Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
3d595ac5 |
|
09-Nov-2022 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: remove superfluous if in eficonfig_edit_boot_option Goto for an immediately succeeding label is superfluous. Fixes: 87d791423ac6 ("eficonfig: menu-driven addition of UEFI boot option") Addresses-Coverity: 376202 ("Identical code for different branches") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
32bab0ea |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Make use of CLI character processing Avoid duplicating some of the escape-sequence processing here and use the CLI function instead. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
d0ca98db |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Update bootmenu_loop() to return the code Use the return value to save having to pass around a pointer. This also resolves any ambiguity about what *key contains when the function is called. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
2da4a15e |
|
06-Jan-2023 |
Simon Glass <sjg@chromium.org> |
menu: Rename KEY_... to BKEY_... This enum values conflict with linux/input.h so rename them. Signed-off-by: Simon Glass <sjg@chromium.org>
|
#
64550274 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: avoid SetVariable between GetNextVariableName calls The current code calls efi_set_variable_int() to delete the invalid boot option between calls to efi_get_next_variable_name_int(), it may produce unpredictable results. This commit moves removal of the invalid boot option outside of the efi_get_next_variable_name_int() calls. EFI_NOT_FOUND returned from efi_get_next_variable_name_int() indicates we retrieved all EFI variables, it should be treated as EFI_SUCEESS. To address the checkpatch warning of too many leading tabs, combine two if statement into one. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
ce327084 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: carve out efi_get_next_variable_name_int calls To retrieve the EFI variable name by efi_get_next_variable_name_int(), the sequence of alloc -> efi_get_next_variable_name_int -> realloc -> efi_get_next_variable_name_int is required. In current code, this sequence repeatedly appears in the several functions. It should be curved out a common function. This commit also fixes the missing free() of var_name16 in eficonfig_delete_invalid_boot_option(). Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
140a8959 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use efi_get_next_variable_name_int() eficonfig command reads all possible UEFI load options from 0x0000 to 0xFFFF to construct the menu. This takes too much time in some environment. This commit uses efi_get_next_variable_name_int() to read all existing UEFI load options to significantlly reduce the count of efi_get_var() call. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
78b1ccc4 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use u16_strsize() to get u16 string buffer size Use u16_strsize() to simplify the u16 string buffer size calculation. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c67d3c9e |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix going one directory up issue The directory name in eficonfig menu entry contains the '\' separator. strcmp() argument ".." is wrong and one directory up handling does not work correctly. strcmp() argument must include '\' separator. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c3b5af63 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add UEFI Secure Boot Key enrollment interface This commit adds the menu-driven UEFI Secure Boot Key enrollment interface. User can enroll PK, KEK, db and dbx by selecting file. Only the signed EFI Signature List(s) with an authenticated header, typically '.auth' file, is accepted. To clear the PK, KEK, db and dbx, user needs to enroll the null key signed by PK or KEK. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
21faf4ef |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use protocol interface for file selection EFI_SIMPLE_FILE_SYSTEM_PROTOCOL is not always provided by U-Boot. Use protocol interface functions instead of U-Boot internal functions. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d6566113 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose eficonfig_create_device_path() Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use eficonfig_create_device_path() to construct the full device path from device path of the volume and file path, so move it out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d571f9b2 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation All the eficonfig menus other than "Change Boot Order" use 'eficonfig_entry' structure for each menu entry. This commit refactors change boot order implementation to use 'eficonfig_entry' structure same as other menus to have consistent menu handling. This commit also simplifies the data->active handling when KEY_SPACE is pressed, and sizeof() parameter. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
8961e93e |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose append entry function Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use append_entry() and append_quit_entry() to construct the menu, so move them out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
a84040ab |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor file selection handling eficonfig_select_file_handler() is commonly used to select the file. eficonfig_display_select_file_option() adds an additional menu to clear the selected file. eficonfig_display_select_file_option() is not always necessary for the file selection process, so it must be outside of eficonfig_select_file_handler(). This commit also renames the following functions to avoid confusion. eficonfig_select_file_handler() -> eficonfig_process_select_file() eficonfig_select_file() -> eficonfig_show_file_selection() eficonfig_display_select_file_option() -> eficonfig_process_show_file_option() Finally, test_eficonfig.py need to be updated to get aligned with the above modification. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
1167e88a |
|
14-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix missing variable initialization The 'ret' variable must be initialized before use in eficonfig_delete_invalid_boot_option(). Fixes: c416f1c0bc ("bootmenu: add removable media entries") Addresses-Coverity: 376207 ("Uninitialized variables") Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
3d595ac5 |
|
09-Nov-2022 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: remove superfluous if in eficonfig_edit_boot_option Goto for an immediately succeeding label is superfluous. Fixes: 87d791423ac6 ("eficonfig: menu-driven addition of UEFI boot option") Addresses-Coverity: 376202 ("Identical code for different branches") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
64550274 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: avoid SetVariable between GetNextVariableName calls The current code calls efi_set_variable_int() to delete the invalid boot option between calls to efi_get_next_variable_name_int(), it may produce unpredictable results. This commit moves removal of the invalid boot option outside of the efi_get_next_variable_name_int() calls. EFI_NOT_FOUND returned from efi_get_next_variable_name_int() indicates we retrieved all EFI variables, it should be treated as EFI_SUCEESS. To address the checkpatch warning of too many leading tabs, combine two if statement into one. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
ce327084 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: carve out efi_get_next_variable_name_int calls To retrieve the EFI variable name by efi_get_next_variable_name_int(), the sequence of alloc -> efi_get_next_variable_name_int -> realloc -> efi_get_next_variable_name_int is required. In current code, this sequence repeatedly appears in the several functions. It should be curved out a common function. This commit also fixes the missing free() of var_name16 in eficonfig_delete_invalid_boot_option(). Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
140a8959 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use efi_get_next_variable_name_int() eficonfig command reads all possible UEFI load options from 0x0000 to 0xFFFF to construct the menu. This takes too much time in some environment. This commit uses efi_get_next_variable_name_int() to read all existing UEFI load options to significantlly reduce the count of efi_get_var() call. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
78b1ccc4 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use u16_strsize() to get u16 string buffer size Use u16_strsize() to simplify the u16 string buffer size calculation. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c67d3c9e |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix going one directory up issue The directory name in eficonfig menu entry contains the '\' separator. strcmp() argument ".." is wrong and one directory up handling does not work correctly. strcmp() argument must include '\' separator. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c3b5af63 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add UEFI Secure Boot Key enrollment interface This commit adds the menu-driven UEFI Secure Boot Key enrollment interface. User can enroll PK, KEK, db and dbx by selecting file. Only the signed EFI Signature List(s) with an authenticated header, typically '.auth' file, is accepted. To clear the PK, KEK, db and dbx, user needs to enroll the null key signed by PK or KEK. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
21faf4ef |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use protocol interface for file selection EFI_SIMPLE_FILE_SYSTEM_PROTOCOL is not always provided by U-Boot. Use protocol interface functions instead of U-Boot internal functions. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d6566113 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose eficonfig_create_device_path() Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use eficonfig_create_device_path() to construct the full device path from device path of the volume and file path, so move it out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d571f9b2 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation All the eficonfig menus other than "Change Boot Order" use 'eficonfig_entry' structure for each menu entry. This commit refactors change boot order implementation to use 'eficonfig_entry' structure same as other menus to have consistent menu handling. This commit also simplifies the data->active handling when KEY_SPACE is pressed, and sizeof() parameter. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
8961e93e |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose append entry function Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use append_entry() and append_quit_entry() to construct the menu, so move them out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
a84040ab |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor file selection handling eficonfig_select_file_handler() is commonly used to select the file. eficonfig_display_select_file_option() adds an additional menu to clear the selected file. eficonfig_display_select_file_option() is not always necessary for the file selection process, so it must be outside of eficonfig_select_file_handler(). This commit also renames the following functions to avoid confusion. eficonfig_select_file_handler() -> eficonfig_process_select_file() eficonfig_select_file() -> eficonfig_show_file_selection() eficonfig_display_select_file_option() -> eficonfig_process_show_file_option() Finally, test_eficonfig.py need to be updated to get aligned with the above modification. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
1167e88a |
|
14-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix missing variable initialization The 'ret' variable must be initialized before use in eficonfig_delete_invalid_boot_option(). Fixes: c416f1c0bc ("bootmenu: add removable media entries") Addresses-Coverity: 376207 ("Uninitialized variables") Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
3d595ac5 |
|
09-Nov-2022 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: remove superfluous if in eficonfig_edit_boot_option Goto for an immediately succeeding label is superfluous. Fixes: 87d791423ac6 ("eficonfig: menu-driven addition of UEFI boot option") Addresses-Coverity: 376202 ("Identical code for different branches") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
64550274 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: avoid SetVariable between GetNextVariableName calls The current code calls efi_set_variable_int() to delete the invalid boot option between calls to efi_get_next_variable_name_int(), it may produce unpredictable results. This commit moves removal of the invalid boot option outside of the efi_get_next_variable_name_int() calls. EFI_NOT_FOUND returned from efi_get_next_variable_name_int() indicates we retrieved all EFI variables, it should be treated as EFI_SUCEESS. To address the checkpatch warning of too many leading tabs, combine two if statement into one. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
ce327084 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: carve out efi_get_next_variable_name_int calls To retrieve the EFI variable name by efi_get_next_variable_name_int(), the sequence of alloc -> efi_get_next_variable_name_int -> realloc -> efi_get_next_variable_name_int is required. In current code, this sequence repeatedly appears in the several functions. It should be curved out a common function. This commit also fixes the missing free() of var_name16 in eficonfig_delete_invalid_boot_option(). Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
140a8959 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use efi_get_next_variable_name_int() eficonfig command reads all possible UEFI load options from 0x0000 to 0xFFFF to construct the menu. This takes too much time in some environment. This commit uses efi_get_next_variable_name_int() to read all existing UEFI load options to significantlly reduce the count of efi_get_var() call. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
78b1ccc4 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use u16_strsize() to get u16 string buffer size Use u16_strsize() to simplify the u16 string buffer size calculation. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c67d3c9e |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix going one directory up issue The directory name in eficonfig menu entry contains the '\' separator. strcmp() argument ".." is wrong and one directory up handling does not work correctly. strcmp() argument must include '\' separator. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c3b5af63 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add UEFI Secure Boot Key enrollment interface This commit adds the menu-driven UEFI Secure Boot Key enrollment interface. User can enroll PK, KEK, db and dbx by selecting file. Only the signed EFI Signature List(s) with an authenticated header, typically '.auth' file, is accepted. To clear the PK, KEK, db and dbx, user needs to enroll the null key signed by PK or KEK. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
21faf4ef |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use protocol interface for file selection EFI_SIMPLE_FILE_SYSTEM_PROTOCOL is not always provided by U-Boot. Use protocol interface functions instead of U-Boot internal functions. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d6566113 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose eficonfig_create_device_path() Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use eficonfig_create_device_path() to construct the full device path from device path of the volume and file path, so move it out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d571f9b2 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation All the eficonfig menus other than "Change Boot Order" use 'eficonfig_entry' structure for each menu entry. This commit refactors change boot order implementation to use 'eficonfig_entry' structure same as other menus to have consistent menu handling. This commit also simplifies the data->active handling when KEY_SPACE is pressed, and sizeof() parameter. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
8961e93e |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose append entry function Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use append_entry() and append_quit_entry() to construct the menu, so move them out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
a84040ab |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor file selection handling eficonfig_select_file_handler() is commonly used to select the file. eficonfig_display_select_file_option() adds an additional menu to clear the selected file. eficonfig_display_select_file_option() is not always necessary for the file selection process, so it must be outside of eficonfig_select_file_handler(). This commit also renames the following functions to avoid confusion. eficonfig_select_file_handler() -> eficonfig_process_select_file() eficonfig_select_file() -> eficonfig_show_file_selection() eficonfig_display_select_file_option() -> eficonfig_process_show_file_option() Finally, test_eficonfig.py need to be updated to get aligned with the above modification. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
1167e88a |
|
14-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix missing variable initialization The 'ret' variable must be initialized before use in eficonfig_delete_invalid_boot_option(). Fixes: c416f1c0bc ("bootmenu: add removable media entries") Addresses-Coverity: 376207 ("Uninitialized variables") Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
3d595ac5 |
|
09-Nov-2022 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: remove superfluous if in eficonfig_edit_boot_option Goto for an immediately succeeding label is superfluous. Fixes: 87d791423ac6 ("eficonfig: menu-driven addition of UEFI boot option") Addresses-Coverity: 376202 ("Identical code for different branches") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
64550274 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: avoid SetVariable between GetNextVariableName calls The current code calls efi_set_variable_int() to delete the invalid boot option between calls to efi_get_next_variable_name_int(), it may produce unpredictable results. This commit moves removal of the invalid boot option outside of the efi_get_next_variable_name_int() calls. EFI_NOT_FOUND returned from efi_get_next_variable_name_int() indicates we retrieved all EFI variables, it should be treated as EFI_SUCEESS. To address the checkpatch warning of too many leading tabs, combine two if statement into one. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
ce327084 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: carve out efi_get_next_variable_name_int calls To retrieve the EFI variable name by efi_get_next_variable_name_int(), the sequence of alloc -> efi_get_next_variable_name_int -> realloc -> efi_get_next_variable_name_int is required. In current code, this sequence repeatedly appears in the several functions. It should be curved out a common function. This commit also fixes the missing free() of var_name16 in eficonfig_delete_invalid_boot_option(). Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
140a8959 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use efi_get_next_variable_name_int() eficonfig command reads all possible UEFI load options from 0x0000 to 0xFFFF to construct the menu. This takes too much time in some environment. This commit uses efi_get_next_variable_name_int() to read all existing UEFI load options to significantlly reduce the count of efi_get_var() call. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
78b1ccc4 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use u16_strsize() to get u16 string buffer size Use u16_strsize() to simplify the u16 string buffer size calculation. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c67d3c9e |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix going one directory up issue The directory name in eficonfig menu entry contains the '\' separator. strcmp() argument ".." is wrong and one directory up handling does not work correctly. strcmp() argument must include '\' separator. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c3b5af63 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add UEFI Secure Boot Key enrollment interface This commit adds the menu-driven UEFI Secure Boot Key enrollment interface. User can enroll PK, KEK, db and dbx by selecting file. Only the signed EFI Signature List(s) with an authenticated header, typically '.auth' file, is accepted. To clear the PK, KEK, db and dbx, user needs to enroll the null key signed by PK or KEK. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
21faf4ef |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use protocol interface for file selection EFI_SIMPLE_FILE_SYSTEM_PROTOCOL is not always provided by U-Boot. Use protocol interface functions instead of U-Boot internal functions. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d6566113 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose eficonfig_create_device_path() Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use eficonfig_create_device_path() to construct the full device path from device path of the volume and file path, so move it out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d571f9b2 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation All the eficonfig menus other than "Change Boot Order" use 'eficonfig_entry' structure for each menu entry. This commit refactors change boot order implementation to use 'eficonfig_entry' structure same as other menus to have consistent menu handling. This commit also simplifies the data->active handling when KEY_SPACE is pressed, and sizeof() parameter. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
8961e93e |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose append entry function Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use append_entry() and append_quit_entry() to construct the menu, so move them out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
a84040ab |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor file selection handling eficonfig_select_file_handler() is commonly used to select the file. eficonfig_display_select_file_option() adds an additional menu to clear the selected file. eficonfig_display_select_file_option() is not always necessary for the file selection process, so it must be outside of eficonfig_select_file_handler(). This commit also renames the following functions to avoid confusion. eficonfig_select_file_handler() -> eficonfig_process_select_file() eficonfig_select_file() -> eficonfig_show_file_selection() eficonfig_display_select_file_option() -> eficonfig_process_show_file_option() Finally, test_eficonfig.py need to be updated to get aligned with the above modification. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
1167e88a |
|
14-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix missing variable initialization The 'ret' variable must be initialized before use in eficonfig_delete_invalid_boot_option(). Fixes: c416f1c0bc ("bootmenu: add removable media entries") Addresses-Coverity: 376207 ("Uninitialized variables") Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
3d595ac5 |
|
09-Nov-2022 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: remove superfluous if in eficonfig_edit_boot_option Goto for an immediately succeeding label is superfluous. Fixes: 87d791423ac6 ("eficonfig: menu-driven addition of UEFI boot option") Addresses-Coverity: 376202 ("Identical code for different branches") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
64550274 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: avoid SetVariable between GetNextVariableName calls The current code calls efi_set_variable_int() to delete the invalid boot option between calls to efi_get_next_variable_name_int(), it may produce unpredictable results. This commit moves removal of the invalid boot option outside of the efi_get_next_variable_name_int() calls. EFI_NOT_FOUND returned from efi_get_next_variable_name_int() indicates we retrieved all EFI variables, it should be treated as EFI_SUCEESS. To address the checkpatch warning of too many leading tabs, combine two if statement into one. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
ce327084 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: carve out efi_get_next_variable_name_int calls To retrieve the EFI variable name by efi_get_next_variable_name_int(), the sequence of alloc -> efi_get_next_variable_name_int -> realloc -> efi_get_next_variable_name_int is required. In current code, this sequence repeatedly appears in the several functions. It should be curved out a common function. This commit also fixes the missing free() of var_name16 in eficonfig_delete_invalid_boot_option(). Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
140a8959 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use efi_get_next_variable_name_int() eficonfig command reads all possible UEFI load options from 0x0000 to 0xFFFF to construct the menu. This takes too much time in some environment. This commit uses efi_get_next_variable_name_int() to read all existing UEFI load options to significantlly reduce the count of efi_get_var() call. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
78b1ccc4 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use u16_strsize() to get u16 string buffer size Use u16_strsize() to simplify the u16 string buffer size calculation. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c67d3c9e |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix going one directory up issue The directory name in eficonfig menu entry contains the '\' separator. strcmp() argument ".." is wrong and one directory up handling does not work correctly. strcmp() argument must include '\' separator. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c3b5af63 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add UEFI Secure Boot Key enrollment interface This commit adds the menu-driven UEFI Secure Boot Key enrollment interface. User can enroll PK, KEK, db and dbx by selecting file. Only the signed EFI Signature List(s) with an authenticated header, typically '.auth' file, is accepted. To clear the PK, KEK, db and dbx, user needs to enroll the null key signed by PK or KEK. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
21faf4ef |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use protocol interface for file selection EFI_SIMPLE_FILE_SYSTEM_PROTOCOL is not always provided by U-Boot. Use protocol interface functions instead of U-Boot internal functions. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d6566113 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose eficonfig_create_device_path() Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use eficonfig_create_device_path() to construct the full device path from device path of the volume and file path, so move it out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d571f9b2 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation All the eficonfig menus other than "Change Boot Order" use 'eficonfig_entry' structure for each menu entry. This commit refactors change boot order implementation to use 'eficonfig_entry' structure same as other menus to have consistent menu handling. This commit also simplifies the data->active handling when KEY_SPACE is pressed, and sizeof() parameter. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
8961e93e |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose append entry function Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use append_entry() and append_quit_entry() to construct the menu, so move them out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
a84040ab |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor file selection handling eficonfig_select_file_handler() is commonly used to select the file. eficonfig_display_select_file_option() adds an additional menu to clear the selected file. eficonfig_display_select_file_option() is not always necessary for the file selection process, so it must be outside of eficonfig_select_file_handler(). This commit also renames the following functions to avoid confusion. eficonfig_select_file_handler() -> eficonfig_process_select_file() eficonfig_select_file() -> eficonfig_show_file_selection() eficonfig_display_select_file_option() -> eficonfig_process_show_file_option() Finally, test_eficonfig.py need to be updated to get aligned with the above modification. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
1167e88a |
|
14-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix missing variable initialization The 'ret' variable must be initialized before use in eficonfig_delete_invalid_boot_option(). Fixes: c416f1c0bc ("bootmenu: add removable media entries") Addresses-Coverity: 376207 ("Uninitialized variables") Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
3d595ac5 |
|
09-Nov-2022 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: remove superfluous if in eficonfig_edit_boot_option Goto for an immediately succeeding label is superfluous. Fixes: 87d791423ac6 ("eficonfig: menu-driven addition of UEFI boot option") Addresses-Coverity: 376202 ("Identical code for different branches") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
64550274 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: avoid SetVariable between GetNextVariableName calls The current code calls efi_set_variable_int() to delete the invalid boot option between calls to efi_get_next_variable_name_int(), it may produce unpredictable results. This commit moves removal of the invalid boot option outside of the efi_get_next_variable_name_int() calls. EFI_NOT_FOUND returned from efi_get_next_variable_name_int() indicates we retrieved all EFI variables, it should be treated as EFI_SUCEESS. To address the checkpatch warning of too many leading tabs, combine two if statement into one. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
ce327084 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: carve out efi_get_next_variable_name_int calls To retrieve the EFI variable name by efi_get_next_variable_name_int(), the sequence of alloc -> efi_get_next_variable_name_int -> realloc -> efi_get_next_variable_name_int is required. In current code, this sequence repeatedly appears in the several functions. It should be curved out a common function. This commit also fixes the missing free() of var_name16 in eficonfig_delete_invalid_boot_option(). Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
140a8959 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use efi_get_next_variable_name_int() eficonfig command reads all possible UEFI load options from 0x0000 to 0xFFFF to construct the menu. This takes too much time in some environment. This commit uses efi_get_next_variable_name_int() to read all existing UEFI load options to significantlly reduce the count of efi_get_var() call. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
78b1ccc4 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use u16_strsize() to get u16 string buffer size Use u16_strsize() to simplify the u16 string buffer size calculation. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c67d3c9e |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix going one directory up issue The directory name in eficonfig menu entry contains the '\' separator. strcmp() argument ".." is wrong and one directory up handling does not work correctly. strcmp() argument must include '\' separator. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c3b5af63 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add UEFI Secure Boot Key enrollment interface This commit adds the menu-driven UEFI Secure Boot Key enrollment interface. User can enroll PK, KEK, db and dbx by selecting file. Only the signed EFI Signature List(s) with an authenticated header, typically '.auth' file, is accepted. To clear the PK, KEK, db and dbx, user needs to enroll the null key signed by PK or KEK. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
21faf4ef |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use protocol interface for file selection EFI_SIMPLE_FILE_SYSTEM_PROTOCOL is not always provided by U-Boot. Use protocol interface functions instead of U-Boot internal functions. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d6566113 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose eficonfig_create_device_path() Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use eficonfig_create_device_path() to construct the full device path from device path of the volume and file path, so move it out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d571f9b2 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation All the eficonfig menus other than "Change Boot Order" use 'eficonfig_entry' structure for each menu entry. This commit refactors change boot order implementation to use 'eficonfig_entry' structure same as other menus to have consistent menu handling. This commit also simplifies the data->active handling when KEY_SPACE is pressed, and sizeof() parameter. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
8961e93e |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose append entry function Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use append_entry() and append_quit_entry() to construct the menu, so move them out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
a84040ab |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor file selection handling eficonfig_select_file_handler() is commonly used to select the file. eficonfig_display_select_file_option() adds an additional menu to clear the selected file. eficonfig_display_select_file_option() is not always necessary for the file selection process, so it must be outside of eficonfig_select_file_handler(). This commit also renames the following functions to avoid confusion. eficonfig_select_file_handler() -> eficonfig_process_select_file() eficonfig_select_file() -> eficonfig_show_file_selection() eficonfig_display_select_file_option() -> eficonfig_process_show_file_option() Finally, test_eficonfig.py need to be updated to get aligned with the above modification. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
1167e88a |
|
14-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix missing variable initialization The 'ret' variable must be initialized before use in eficonfig_delete_invalid_boot_option(). Fixes: c416f1c0bc ("bootmenu: add removable media entries") Addresses-Coverity: 376207 ("Uninitialized variables") Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
3d595ac5 |
|
09-Nov-2022 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: remove superfluous if in eficonfig_edit_boot_option Goto for an immediately succeeding label is superfluous. Fixes: 87d791423ac6 ("eficonfig: menu-driven addition of UEFI boot option") Addresses-Coverity: 376202 ("Identical code for different branches") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
64550274 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: avoid SetVariable between GetNextVariableName calls The current code calls efi_set_variable_int() to delete the invalid boot option between calls to efi_get_next_variable_name_int(), it may produce unpredictable results. This commit moves removal of the invalid boot option outside of the efi_get_next_variable_name_int() calls. EFI_NOT_FOUND returned from efi_get_next_variable_name_int() indicates we retrieved all EFI variables, it should be treated as EFI_SUCEESS. To address the checkpatch warning of too many leading tabs, combine two if statement into one. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
ce327084 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: carve out efi_get_next_variable_name_int calls To retrieve the EFI variable name by efi_get_next_variable_name_int(), the sequence of alloc -> efi_get_next_variable_name_int -> realloc -> efi_get_next_variable_name_int is required. In current code, this sequence repeatedly appears in the several functions. It should be curved out a common function. This commit also fixes the missing free() of var_name16 in eficonfig_delete_invalid_boot_option(). Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
140a8959 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use efi_get_next_variable_name_int() eficonfig command reads all possible UEFI load options from 0x0000 to 0xFFFF to construct the menu. This takes too much time in some environment. This commit uses efi_get_next_variable_name_int() to read all existing UEFI load options to significantlly reduce the count of efi_get_var() call. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
78b1ccc4 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use u16_strsize() to get u16 string buffer size Use u16_strsize() to simplify the u16 string buffer size calculation. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c67d3c9e |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix going one directory up issue The directory name in eficonfig menu entry contains the '\' separator. strcmp() argument ".." is wrong and one directory up handling does not work correctly. strcmp() argument must include '\' separator. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c3b5af63 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add UEFI Secure Boot Key enrollment interface This commit adds the menu-driven UEFI Secure Boot Key enrollment interface. User can enroll PK, KEK, db and dbx by selecting file. Only the signed EFI Signature List(s) with an authenticated header, typically '.auth' file, is accepted. To clear the PK, KEK, db and dbx, user needs to enroll the null key signed by PK or KEK. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
21faf4ef |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use protocol interface for file selection EFI_SIMPLE_FILE_SYSTEM_PROTOCOL is not always provided by U-Boot. Use protocol interface functions instead of U-Boot internal functions. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d6566113 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose eficonfig_create_device_path() Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use eficonfig_create_device_path() to construct the full device path from device path of the volume and file path, so move it out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d571f9b2 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation All the eficonfig menus other than "Change Boot Order" use 'eficonfig_entry' structure for each menu entry. This commit refactors change boot order implementation to use 'eficonfig_entry' structure same as other menus to have consistent menu handling. This commit also simplifies the data->active handling when KEY_SPACE is pressed, and sizeof() parameter. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
8961e93e |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose append entry function Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use append_entry() and append_quit_entry() to construct the menu, so move them out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
a84040ab |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor file selection handling eficonfig_select_file_handler() is commonly used to select the file. eficonfig_display_select_file_option() adds an additional menu to clear the selected file. eficonfig_display_select_file_option() is not always necessary for the file selection process, so it must be outside of eficonfig_select_file_handler(). This commit also renames the following functions to avoid confusion. eficonfig_select_file_handler() -> eficonfig_process_select_file() eficonfig_select_file() -> eficonfig_show_file_selection() eficonfig_display_select_file_option() -> eficonfig_process_show_file_option() Finally, test_eficonfig.py need to be updated to get aligned with the above modification. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
1167e88a |
|
14-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix missing variable initialization The 'ret' variable must be initialized before use in eficonfig_delete_invalid_boot_option(). Fixes: c416f1c0bc ("bootmenu: add removable media entries") Addresses-Coverity: 376207 ("Uninitialized variables") Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
3d595ac5 |
|
09-Nov-2022 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: remove superfluous if in eficonfig_edit_boot_option Goto for an immediately succeeding label is superfluous. Fixes: 87d791423ac6 ("eficonfig: menu-driven addition of UEFI boot option") Addresses-Coverity: 376202 ("Identical code for different branches") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
64550274 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: avoid SetVariable between GetNextVariableName calls The current code calls efi_set_variable_int() to delete the invalid boot option between calls to efi_get_next_variable_name_int(), it may produce unpredictable results. This commit moves removal of the invalid boot option outside of the efi_get_next_variable_name_int() calls. EFI_NOT_FOUND returned from efi_get_next_variable_name_int() indicates we retrieved all EFI variables, it should be treated as EFI_SUCEESS. To address the checkpatch warning of too many leading tabs, combine two if statement into one. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
ce327084 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: carve out efi_get_next_variable_name_int calls To retrieve the EFI variable name by efi_get_next_variable_name_int(), the sequence of alloc -> efi_get_next_variable_name_int -> realloc -> efi_get_next_variable_name_int is required. In current code, this sequence repeatedly appears in the several functions. It should be curved out a common function. This commit also fixes the missing free() of var_name16 in eficonfig_delete_invalid_boot_option(). Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
140a8959 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use efi_get_next_variable_name_int() eficonfig command reads all possible UEFI load options from 0x0000 to 0xFFFF to construct the menu. This takes too much time in some environment. This commit uses efi_get_next_variable_name_int() to read all existing UEFI load options to significantlly reduce the count of efi_get_var() call. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
78b1ccc4 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use u16_strsize() to get u16 string buffer size Use u16_strsize() to simplify the u16 string buffer size calculation. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c67d3c9e |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix going one directory up issue The directory name in eficonfig menu entry contains the '\' separator. strcmp() argument ".." is wrong and one directory up handling does not work correctly. strcmp() argument must include '\' separator. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c3b5af63 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add UEFI Secure Boot Key enrollment interface This commit adds the menu-driven UEFI Secure Boot Key enrollment interface. User can enroll PK, KEK, db and dbx by selecting file. Only the signed EFI Signature List(s) with an authenticated header, typically '.auth' file, is accepted. To clear the PK, KEK, db and dbx, user needs to enroll the null key signed by PK or KEK. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
21faf4ef |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use protocol interface for file selection EFI_SIMPLE_FILE_SYSTEM_PROTOCOL is not always provided by U-Boot. Use protocol interface functions instead of U-Boot internal functions. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d6566113 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose eficonfig_create_device_path() Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use eficonfig_create_device_path() to construct the full device path from device path of the volume and file path, so move it out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d571f9b2 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation All the eficonfig menus other than "Change Boot Order" use 'eficonfig_entry' structure for each menu entry. This commit refactors change boot order implementation to use 'eficonfig_entry' structure same as other menus to have consistent menu handling. This commit also simplifies the data->active handling when KEY_SPACE is pressed, and sizeof() parameter. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
8961e93e |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose append entry function Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use append_entry() and append_quit_entry() to construct the menu, so move them out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
a84040ab |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor file selection handling eficonfig_select_file_handler() is commonly used to select the file. eficonfig_display_select_file_option() adds an additional menu to clear the selected file. eficonfig_display_select_file_option() is not always necessary for the file selection process, so it must be outside of eficonfig_select_file_handler(). This commit also renames the following functions to avoid confusion. eficonfig_select_file_handler() -> eficonfig_process_select_file() eficonfig_select_file() -> eficonfig_show_file_selection() eficonfig_display_select_file_option() -> eficonfig_process_show_file_option() Finally, test_eficonfig.py need to be updated to get aligned with the above modification. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
1167e88a |
|
14-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix missing variable initialization The 'ret' variable must be initialized before use in eficonfig_delete_invalid_boot_option(). Fixes: c416f1c0bc ("bootmenu: add removable media entries") Addresses-Coverity: 376207 ("Uninitialized variables") Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
3d595ac5 |
|
09-Nov-2022 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: remove superfluous if in eficonfig_edit_boot_option Goto for an immediately succeeding label is superfluous. Fixes: 87d791423ac6 ("eficonfig: menu-driven addition of UEFI boot option") Addresses-Coverity: 376202 ("Identical code for different branches") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
64550274 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: avoid SetVariable between GetNextVariableName calls The current code calls efi_set_variable_int() to delete the invalid boot option between calls to efi_get_next_variable_name_int(), it may produce unpredictable results. This commit moves removal of the invalid boot option outside of the efi_get_next_variable_name_int() calls. EFI_NOT_FOUND returned from efi_get_next_variable_name_int() indicates we retrieved all EFI variables, it should be treated as EFI_SUCEESS. To address the checkpatch warning of too many leading tabs, combine two if statement into one. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
ce327084 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: carve out efi_get_next_variable_name_int calls To retrieve the EFI variable name by efi_get_next_variable_name_int(), the sequence of alloc -> efi_get_next_variable_name_int -> realloc -> efi_get_next_variable_name_int is required. In current code, this sequence repeatedly appears in the several functions. It should be curved out a common function. This commit also fixes the missing free() of var_name16 in eficonfig_delete_invalid_boot_option(). Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
140a8959 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use efi_get_next_variable_name_int() eficonfig command reads all possible UEFI load options from 0x0000 to 0xFFFF to construct the menu. This takes too much time in some environment. This commit uses efi_get_next_variable_name_int() to read all existing UEFI load options to significantlly reduce the count of efi_get_var() call. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
78b1ccc4 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use u16_strsize() to get u16 string buffer size Use u16_strsize() to simplify the u16 string buffer size calculation. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c67d3c9e |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix going one directory up issue The directory name in eficonfig menu entry contains the '\' separator. strcmp() argument ".." is wrong and one directory up handling does not work correctly. strcmp() argument must include '\' separator. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c3b5af63 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add UEFI Secure Boot Key enrollment interface This commit adds the menu-driven UEFI Secure Boot Key enrollment interface. User can enroll PK, KEK, db and dbx by selecting file. Only the signed EFI Signature List(s) with an authenticated header, typically '.auth' file, is accepted. To clear the PK, KEK, db and dbx, user needs to enroll the null key signed by PK or KEK. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
21faf4ef |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use protocol interface for file selection EFI_SIMPLE_FILE_SYSTEM_PROTOCOL is not always provided by U-Boot. Use protocol interface functions instead of U-Boot internal functions. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d6566113 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose eficonfig_create_device_path() Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use eficonfig_create_device_path() to construct the full device path from device path of the volume and file path, so move it out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d571f9b2 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation All the eficonfig menus other than "Change Boot Order" use 'eficonfig_entry' structure for each menu entry. This commit refactors change boot order implementation to use 'eficonfig_entry' structure same as other menus to have consistent menu handling. This commit also simplifies the data->active handling when KEY_SPACE is pressed, and sizeof() parameter. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
8961e93e |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose append entry function Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use append_entry() and append_quit_entry() to construct the menu, so move them out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
a84040ab |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor file selection handling eficonfig_select_file_handler() is commonly used to select the file. eficonfig_display_select_file_option() adds an additional menu to clear the selected file. eficonfig_display_select_file_option() is not always necessary for the file selection process, so it must be outside of eficonfig_select_file_handler(). This commit also renames the following functions to avoid confusion. eficonfig_select_file_handler() -> eficonfig_process_select_file() eficonfig_select_file() -> eficonfig_show_file_selection() eficonfig_display_select_file_option() -> eficonfig_process_show_file_option() Finally, test_eficonfig.py need to be updated to get aligned with the above modification. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
1167e88a |
|
14-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix missing variable initialization The 'ret' variable must be initialized before use in eficonfig_delete_invalid_boot_option(). Fixes: c416f1c0bc ("bootmenu: add removable media entries") Addresses-Coverity: 376207 ("Uninitialized variables") Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
3d595ac5 |
|
09-Nov-2022 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: remove superfluous if in eficonfig_edit_boot_option Goto for an immediately succeeding label is superfluous. Fixes: 87d791423ac6 ("eficonfig: menu-driven addition of UEFI boot option") Addresses-Coverity: 376202 ("Identical code for different branches") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
64550274 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: avoid SetVariable between GetNextVariableName calls The current code calls efi_set_variable_int() to delete the invalid boot option between calls to efi_get_next_variable_name_int(), it may produce unpredictable results. This commit moves removal of the invalid boot option outside of the efi_get_next_variable_name_int() calls. EFI_NOT_FOUND returned from efi_get_next_variable_name_int() indicates we retrieved all EFI variables, it should be treated as EFI_SUCEESS. To address the checkpatch warning of too many leading tabs, combine two if statement into one. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
ce327084 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: carve out efi_get_next_variable_name_int calls To retrieve the EFI variable name by efi_get_next_variable_name_int(), the sequence of alloc -> efi_get_next_variable_name_int -> realloc -> efi_get_next_variable_name_int is required. In current code, this sequence repeatedly appears in the several functions. It should be curved out a common function. This commit also fixes the missing free() of var_name16 in eficonfig_delete_invalid_boot_option(). Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
140a8959 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use efi_get_next_variable_name_int() eficonfig command reads all possible UEFI load options from 0x0000 to 0xFFFF to construct the menu. This takes too much time in some environment. This commit uses efi_get_next_variable_name_int() to read all existing UEFI load options to significantlly reduce the count of efi_get_var() call. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
78b1ccc4 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use u16_strsize() to get u16 string buffer size Use u16_strsize() to simplify the u16 string buffer size calculation. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c67d3c9e |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix going one directory up issue The directory name in eficonfig menu entry contains the '\' separator. strcmp() argument ".." is wrong and one directory up handling does not work correctly. strcmp() argument must include '\' separator. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c3b5af63 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add UEFI Secure Boot Key enrollment interface This commit adds the menu-driven UEFI Secure Boot Key enrollment interface. User can enroll PK, KEK, db and dbx by selecting file. Only the signed EFI Signature List(s) with an authenticated header, typically '.auth' file, is accepted. To clear the PK, KEK, db and dbx, user needs to enroll the null key signed by PK or KEK. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
21faf4ef |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use protocol interface for file selection EFI_SIMPLE_FILE_SYSTEM_PROTOCOL is not always provided by U-Boot. Use protocol interface functions instead of U-Boot internal functions. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d6566113 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose eficonfig_create_device_path() Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use eficonfig_create_device_path() to construct the full device path from device path of the volume and file path, so move it out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d571f9b2 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation All the eficonfig menus other than "Change Boot Order" use 'eficonfig_entry' structure for each menu entry. This commit refactors change boot order implementation to use 'eficonfig_entry' structure same as other menus to have consistent menu handling. This commit also simplifies the data->active handling when KEY_SPACE is pressed, and sizeof() parameter. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
8961e93e |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose append entry function Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use append_entry() and append_quit_entry() to construct the menu, so move them out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
a84040ab |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor file selection handling eficonfig_select_file_handler() is commonly used to select the file. eficonfig_display_select_file_option() adds an additional menu to clear the selected file. eficonfig_display_select_file_option() is not always necessary for the file selection process, so it must be outside of eficonfig_select_file_handler(). This commit also renames the following functions to avoid confusion. eficonfig_select_file_handler() -> eficonfig_process_select_file() eficonfig_select_file() -> eficonfig_show_file_selection() eficonfig_display_select_file_option() -> eficonfig_process_show_file_option() Finally, test_eficonfig.py need to be updated to get aligned with the above modification. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
1167e88a |
|
14-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix missing variable initialization The 'ret' variable must be initialized before use in eficonfig_delete_invalid_boot_option(). Fixes: c416f1c0bc ("bootmenu: add removable media entries") Addresses-Coverity: 376207 ("Uninitialized variables") Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
3d595ac5 |
|
09-Nov-2022 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: remove superfluous if in eficonfig_edit_boot_option Goto for an immediately succeeding label is superfluous. Fixes: 87d791423ac6 ("eficonfig: menu-driven addition of UEFI boot option") Addresses-Coverity: 376202 ("Identical code for different branches") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
64550274 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: avoid SetVariable between GetNextVariableName calls The current code calls efi_set_variable_int() to delete the invalid boot option between calls to efi_get_next_variable_name_int(), it may produce unpredictable results. This commit moves removal of the invalid boot option outside of the efi_get_next_variable_name_int() calls. EFI_NOT_FOUND returned from efi_get_next_variable_name_int() indicates we retrieved all EFI variables, it should be treated as EFI_SUCEESS. To address the checkpatch warning of too many leading tabs, combine two if statement into one. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
ce327084 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: carve out efi_get_next_variable_name_int calls To retrieve the EFI variable name by efi_get_next_variable_name_int(), the sequence of alloc -> efi_get_next_variable_name_int -> realloc -> efi_get_next_variable_name_int is required. In current code, this sequence repeatedly appears in the several functions. It should be curved out a common function. This commit also fixes the missing free() of var_name16 in eficonfig_delete_invalid_boot_option(). Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
140a8959 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use efi_get_next_variable_name_int() eficonfig command reads all possible UEFI load options from 0x0000 to 0xFFFF to construct the menu. This takes too much time in some environment. This commit uses efi_get_next_variable_name_int() to read all existing UEFI load options to significantlly reduce the count of efi_get_var() call. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
78b1ccc4 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use u16_strsize() to get u16 string buffer size Use u16_strsize() to simplify the u16 string buffer size calculation. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c67d3c9e |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix going one directory up issue The directory name in eficonfig menu entry contains the '\' separator. strcmp() argument ".." is wrong and one directory up handling does not work correctly. strcmp() argument must include '\' separator. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c3b5af63 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add UEFI Secure Boot Key enrollment interface This commit adds the menu-driven UEFI Secure Boot Key enrollment interface. User can enroll PK, KEK, db and dbx by selecting file. Only the signed EFI Signature List(s) with an authenticated header, typically '.auth' file, is accepted. To clear the PK, KEK, db and dbx, user needs to enroll the null key signed by PK or KEK. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
21faf4ef |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use protocol interface for file selection EFI_SIMPLE_FILE_SYSTEM_PROTOCOL is not always provided by U-Boot. Use protocol interface functions instead of U-Boot internal functions. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d6566113 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose eficonfig_create_device_path() Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use eficonfig_create_device_path() to construct the full device path from device path of the volume and file path, so move it out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d571f9b2 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation All the eficonfig menus other than "Change Boot Order" use 'eficonfig_entry' structure for each menu entry. This commit refactors change boot order implementation to use 'eficonfig_entry' structure same as other menus to have consistent menu handling. This commit also simplifies the data->active handling when KEY_SPACE is pressed, and sizeof() parameter. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
8961e93e |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose append entry function Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use append_entry() and append_quit_entry() to construct the menu, so move them out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
a84040ab |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor file selection handling eficonfig_select_file_handler() is commonly used to select the file. eficonfig_display_select_file_option() adds an additional menu to clear the selected file. eficonfig_display_select_file_option() is not always necessary for the file selection process, so it must be outside of eficonfig_select_file_handler(). This commit also renames the following functions to avoid confusion. eficonfig_select_file_handler() -> eficonfig_process_select_file() eficonfig_select_file() -> eficonfig_show_file_selection() eficonfig_display_select_file_option() -> eficonfig_process_show_file_option() Finally, test_eficonfig.py need to be updated to get aligned with the above modification. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
1167e88a |
|
14-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix missing variable initialization The 'ret' variable must be initialized before use in eficonfig_delete_invalid_boot_option(). Fixes: c416f1c0bc ("bootmenu: add removable media entries") Addresses-Coverity: 376207 ("Uninitialized variables") Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
3d595ac5 |
|
09-Nov-2022 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: remove superfluous if in eficonfig_edit_boot_option Goto for an immediately succeeding label is superfluous. Fixes: 87d791423ac6 ("eficonfig: menu-driven addition of UEFI boot option") Addresses-Coverity: 376202 ("Identical code for different branches") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
64550274 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: avoid SetVariable between GetNextVariableName calls The current code calls efi_set_variable_int() to delete the invalid boot option between calls to efi_get_next_variable_name_int(), it may produce unpredictable results. This commit moves removal of the invalid boot option outside of the efi_get_next_variable_name_int() calls. EFI_NOT_FOUND returned from efi_get_next_variable_name_int() indicates we retrieved all EFI variables, it should be treated as EFI_SUCEESS. To address the checkpatch warning of too many leading tabs, combine two if statement into one. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
ce327084 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: carve out efi_get_next_variable_name_int calls To retrieve the EFI variable name by efi_get_next_variable_name_int(), the sequence of alloc -> efi_get_next_variable_name_int -> realloc -> efi_get_next_variable_name_int is required. In current code, this sequence repeatedly appears in the several functions. It should be curved out a common function. This commit also fixes the missing free() of var_name16 in eficonfig_delete_invalid_boot_option(). Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
140a8959 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use efi_get_next_variable_name_int() eficonfig command reads all possible UEFI load options from 0x0000 to 0xFFFF to construct the menu. This takes too much time in some environment. This commit uses efi_get_next_variable_name_int() to read all existing UEFI load options to significantlly reduce the count of efi_get_var() call. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
78b1ccc4 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use u16_strsize() to get u16 string buffer size Use u16_strsize() to simplify the u16 string buffer size calculation. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c67d3c9e |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix going one directory up issue The directory name in eficonfig menu entry contains the '\' separator. strcmp() argument ".." is wrong and one directory up handling does not work correctly. strcmp() argument must include '\' separator. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c3b5af63 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add UEFI Secure Boot Key enrollment interface This commit adds the menu-driven UEFI Secure Boot Key enrollment interface. User can enroll PK, KEK, db and dbx by selecting file. Only the signed EFI Signature List(s) with an authenticated header, typically '.auth' file, is accepted. To clear the PK, KEK, db and dbx, user needs to enroll the null key signed by PK or KEK. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
21faf4ef |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use protocol interface for file selection EFI_SIMPLE_FILE_SYSTEM_PROTOCOL is not always provided by U-Boot. Use protocol interface functions instead of U-Boot internal functions. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d6566113 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose eficonfig_create_device_path() Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use eficonfig_create_device_path() to construct the full device path from device path of the volume and file path, so move it out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d571f9b2 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation All the eficonfig menus other than "Change Boot Order" use 'eficonfig_entry' structure for each menu entry. This commit refactors change boot order implementation to use 'eficonfig_entry' structure same as other menus to have consistent menu handling. This commit also simplifies the data->active handling when KEY_SPACE is pressed, and sizeof() parameter. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
8961e93e |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose append entry function Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use append_entry() and append_quit_entry() to construct the menu, so move them out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
a84040ab |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor file selection handling eficonfig_select_file_handler() is commonly used to select the file. eficonfig_display_select_file_option() adds an additional menu to clear the selected file. eficonfig_display_select_file_option() is not always necessary for the file selection process, so it must be outside of eficonfig_select_file_handler(). This commit also renames the following functions to avoid confusion. eficonfig_select_file_handler() -> eficonfig_process_select_file() eficonfig_select_file() -> eficonfig_show_file_selection() eficonfig_display_select_file_option() -> eficonfig_process_show_file_option() Finally, test_eficonfig.py need to be updated to get aligned with the above modification. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
1167e88a |
|
14-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix missing variable initialization The 'ret' variable must be initialized before use in eficonfig_delete_invalid_boot_option(). Fixes: c416f1c0bc ("bootmenu: add removable media entries") Addresses-Coverity: 376207 ("Uninitialized variables") Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
3d595ac5 |
|
09-Nov-2022 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: remove superfluous if in eficonfig_edit_boot_option Goto for an immediately succeeding label is superfluous. Fixes: 87d791423ac6 ("eficonfig: menu-driven addition of UEFI boot option") Addresses-Coverity: 376202 ("Identical code for different branches") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
64550274 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: avoid SetVariable between GetNextVariableName calls The current code calls efi_set_variable_int() to delete the invalid boot option between calls to efi_get_next_variable_name_int(), it may produce unpredictable results. This commit moves removal of the invalid boot option outside of the efi_get_next_variable_name_int() calls. EFI_NOT_FOUND returned from efi_get_next_variable_name_int() indicates we retrieved all EFI variables, it should be treated as EFI_SUCEESS. To address the checkpatch warning of too many leading tabs, combine two if statement into one. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
ce327084 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: carve out efi_get_next_variable_name_int calls To retrieve the EFI variable name by efi_get_next_variable_name_int(), the sequence of alloc -> efi_get_next_variable_name_int -> realloc -> efi_get_next_variable_name_int is required. In current code, this sequence repeatedly appears in the several functions. It should be curved out a common function. This commit also fixes the missing free() of var_name16 in eficonfig_delete_invalid_boot_option(). Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
140a8959 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use efi_get_next_variable_name_int() eficonfig command reads all possible UEFI load options from 0x0000 to 0xFFFF to construct the menu. This takes too much time in some environment. This commit uses efi_get_next_variable_name_int() to read all existing UEFI load options to significantlly reduce the count of efi_get_var() call. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
78b1ccc4 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use u16_strsize() to get u16 string buffer size Use u16_strsize() to simplify the u16 string buffer size calculation. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c67d3c9e |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix going one directory up issue The directory name in eficonfig menu entry contains the '\' separator. strcmp() argument ".." is wrong and one directory up handling does not work correctly. strcmp() argument must include '\' separator. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c3b5af63 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add UEFI Secure Boot Key enrollment interface This commit adds the menu-driven UEFI Secure Boot Key enrollment interface. User can enroll PK, KEK, db and dbx by selecting file. Only the signed EFI Signature List(s) with an authenticated header, typically '.auth' file, is accepted. To clear the PK, KEK, db and dbx, user needs to enroll the null key signed by PK or KEK. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
21faf4ef |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use protocol interface for file selection EFI_SIMPLE_FILE_SYSTEM_PROTOCOL is not always provided by U-Boot. Use protocol interface functions instead of U-Boot internal functions. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d6566113 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose eficonfig_create_device_path() Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use eficonfig_create_device_path() to construct the full device path from device path of the volume and file path, so move it out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d571f9b2 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation All the eficonfig menus other than "Change Boot Order" use 'eficonfig_entry' structure for each menu entry. This commit refactors change boot order implementation to use 'eficonfig_entry' structure same as other menus to have consistent menu handling. This commit also simplifies the data->active handling when KEY_SPACE is pressed, and sizeof() parameter. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
8961e93e |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose append entry function Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use append_entry() and append_quit_entry() to construct the menu, so move them out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
a84040ab |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor file selection handling eficonfig_select_file_handler() is commonly used to select the file. eficonfig_display_select_file_option() adds an additional menu to clear the selected file. eficonfig_display_select_file_option() is not always necessary for the file selection process, so it must be outside of eficonfig_select_file_handler(). This commit also renames the following functions to avoid confusion. eficonfig_select_file_handler() -> eficonfig_process_select_file() eficonfig_select_file() -> eficonfig_show_file_selection() eficonfig_display_select_file_option() -> eficonfig_process_show_file_option() Finally, test_eficonfig.py need to be updated to get aligned with the above modification. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
1167e88a |
|
14-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix missing variable initialization The 'ret' variable must be initialized before use in eficonfig_delete_invalid_boot_option(). Fixes: c416f1c0bc ("bootmenu: add removable media entries") Addresses-Coverity: 376207 ("Uninitialized variables") Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
3d595ac5 |
|
09-Nov-2022 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: remove superfluous if in eficonfig_edit_boot_option Goto for an immediately succeeding label is superfluous. Fixes: 87d791423ac6 ("eficonfig: menu-driven addition of UEFI boot option") Addresses-Coverity: 376202 ("Identical code for different branches") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
64550274 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: avoid SetVariable between GetNextVariableName calls The current code calls efi_set_variable_int() to delete the invalid boot option between calls to efi_get_next_variable_name_int(), it may produce unpredictable results. This commit moves removal of the invalid boot option outside of the efi_get_next_variable_name_int() calls. EFI_NOT_FOUND returned from efi_get_next_variable_name_int() indicates we retrieved all EFI variables, it should be treated as EFI_SUCEESS. To address the checkpatch warning of too many leading tabs, combine two if statement into one. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
ce327084 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: carve out efi_get_next_variable_name_int calls To retrieve the EFI variable name by efi_get_next_variable_name_int(), the sequence of alloc -> efi_get_next_variable_name_int -> realloc -> efi_get_next_variable_name_int is required. In current code, this sequence repeatedly appears in the several functions. It should be curved out a common function. This commit also fixes the missing free() of var_name16 in eficonfig_delete_invalid_boot_option(). Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
140a8959 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use efi_get_next_variable_name_int() eficonfig command reads all possible UEFI load options from 0x0000 to 0xFFFF to construct the menu. This takes too much time in some environment. This commit uses efi_get_next_variable_name_int() to read all existing UEFI load options to significantlly reduce the count of efi_get_var() call. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
78b1ccc4 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use u16_strsize() to get u16 string buffer size Use u16_strsize() to simplify the u16 string buffer size calculation. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c67d3c9e |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix going one directory up issue The directory name in eficonfig menu entry contains the '\' separator. strcmp() argument ".." is wrong and one directory up handling does not work correctly. strcmp() argument must include '\' separator. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c3b5af63 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add UEFI Secure Boot Key enrollment interface This commit adds the menu-driven UEFI Secure Boot Key enrollment interface. User can enroll PK, KEK, db and dbx by selecting file. Only the signed EFI Signature List(s) with an authenticated header, typically '.auth' file, is accepted. To clear the PK, KEK, db and dbx, user needs to enroll the null key signed by PK or KEK. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
21faf4ef |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use protocol interface for file selection EFI_SIMPLE_FILE_SYSTEM_PROTOCOL is not always provided by U-Boot. Use protocol interface functions instead of U-Boot internal functions. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d6566113 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose eficonfig_create_device_path() Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use eficonfig_create_device_path() to construct the full device path from device path of the volume and file path, so move it out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d571f9b2 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation All the eficonfig menus other than "Change Boot Order" use 'eficonfig_entry' structure for each menu entry. This commit refactors change boot order implementation to use 'eficonfig_entry' structure same as other menus to have consistent menu handling. This commit also simplifies the data->active handling when KEY_SPACE is pressed, and sizeof() parameter. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
8961e93e |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose append entry function Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use append_entry() and append_quit_entry() to construct the menu, so move them out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
a84040ab |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor file selection handling eficonfig_select_file_handler() is commonly used to select the file. eficonfig_display_select_file_option() adds an additional menu to clear the selected file. eficonfig_display_select_file_option() is not always necessary for the file selection process, so it must be outside of eficonfig_select_file_handler(). This commit also renames the following functions to avoid confusion. eficonfig_select_file_handler() -> eficonfig_process_select_file() eficonfig_select_file() -> eficonfig_show_file_selection() eficonfig_display_select_file_option() -> eficonfig_process_show_file_option() Finally, test_eficonfig.py need to be updated to get aligned with the above modification. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
1167e88a |
|
14-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix missing variable initialization The 'ret' variable must be initialized before use in eficonfig_delete_invalid_boot_option(). Fixes: c416f1c0bc ("bootmenu: add removable media entries") Addresses-Coverity: 376207 ("Uninitialized variables") Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
3d595ac5 |
|
09-Nov-2022 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: remove superfluous if in eficonfig_edit_boot_option Goto for an immediately succeeding label is superfluous. Fixes: 87d791423ac6 ("eficonfig: menu-driven addition of UEFI boot option") Addresses-Coverity: 376202 ("Identical code for different branches") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
64550274 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: avoid SetVariable between GetNextVariableName calls The current code calls efi_set_variable_int() to delete the invalid boot option between calls to efi_get_next_variable_name_int(), it may produce unpredictable results. This commit moves removal of the invalid boot option outside of the efi_get_next_variable_name_int() calls. EFI_NOT_FOUND returned from efi_get_next_variable_name_int() indicates we retrieved all EFI variables, it should be treated as EFI_SUCEESS. To address the checkpatch warning of too many leading tabs, combine two if statement into one. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
ce327084 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: carve out efi_get_next_variable_name_int calls To retrieve the EFI variable name by efi_get_next_variable_name_int(), the sequence of alloc -> efi_get_next_variable_name_int -> realloc -> efi_get_next_variable_name_int is required. In current code, this sequence repeatedly appears in the several functions. It should be curved out a common function. This commit also fixes the missing free() of var_name16 in eficonfig_delete_invalid_boot_option(). Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
140a8959 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use efi_get_next_variable_name_int() eficonfig command reads all possible UEFI load options from 0x0000 to 0xFFFF to construct the menu. This takes too much time in some environment. This commit uses efi_get_next_variable_name_int() to read all existing UEFI load options to significantlly reduce the count of efi_get_var() call. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
78b1ccc4 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use u16_strsize() to get u16 string buffer size Use u16_strsize() to simplify the u16 string buffer size calculation. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c67d3c9e |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix going one directory up issue The directory name in eficonfig menu entry contains the '\' separator. strcmp() argument ".." is wrong and one directory up handling does not work correctly. strcmp() argument must include '\' separator. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c3b5af63 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add UEFI Secure Boot Key enrollment interface This commit adds the menu-driven UEFI Secure Boot Key enrollment interface. User can enroll PK, KEK, db and dbx by selecting file. Only the signed EFI Signature List(s) with an authenticated header, typically '.auth' file, is accepted. To clear the PK, KEK, db and dbx, user needs to enroll the null key signed by PK or KEK. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
21faf4ef |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use protocol interface for file selection EFI_SIMPLE_FILE_SYSTEM_PROTOCOL is not always provided by U-Boot. Use protocol interface functions instead of U-Boot internal functions. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d6566113 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose eficonfig_create_device_path() Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use eficonfig_create_device_path() to construct the full device path from device path of the volume and file path, so move it out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d571f9b2 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation All the eficonfig menus other than "Change Boot Order" use 'eficonfig_entry' structure for each menu entry. This commit refactors change boot order implementation to use 'eficonfig_entry' structure same as other menus to have consistent menu handling. This commit also simplifies the data->active handling when KEY_SPACE is pressed, and sizeof() parameter. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
8961e93e |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose append entry function Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use append_entry() and append_quit_entry() to construct the menu, so move them out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
a84040ab |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor file selection handling eficonfig_select_file_handler() is commonly used to select the file. eficonfig_display_select_file_option() adds an additional menu to clear the selected file. eficonfig_display_select_file_option() is not always necessary for the file selection process, so it must be outside of eficonfig_select_file_handler(). This commit also renames the following functions to avoid confusion. eficonfig_select_file_handler() -> eficonfig_process_select_file() eficonfig_select_file() -> eficonfig_show_file_selection() eficonfig_display_select_file_option() -> eficonfig_process_show_file_option() Finally, test_eficonfig.py need to be updated to get aligned with the above modification. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
1167e88a |
|
14-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix missing variable initialization The 'ret' variable must be initialized before use in eficonfig_delete_invalid_boot_option(). Fixes: c416f1c0bc ("bootmenu: add removable media entries") Addresses-Coverity: 376207 ("Uninitialized variables") Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
3d595ac5 |
|
09-Nov-2022 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: remove superfluous if in eficonfig_edit_boot_option Goto for an immediately succeeding label is superfluous. Fixes: 87d791423ac6 ("eficonfig: menu-driven addition of UEFI boot option") Addresses-Coverity: 376202 ("Identical code for different branches") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
64550274 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: avoid SetVariable between GetNextVariableName calls The current code calls efi_set_variable_int() to delete the invalid boot option between calls to efi_get_next_variable_name_int(), it may produce unpredictable results. This commit moves removal of the invalid boot option outside of the efi_get_next_variable_name_int() calls. EFI_NOT_FOUND returned from efi_get_next_variable_name_int() indicates we retrieved all EFI variables, it should be treated as EFI_SUCEESS. To address the checkpatch warning of too many leading tabs, combine two if statement into one. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
ce327084 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: carve out efi_get_next_variable_name_int calls To retrieve the EFI variable name by efi_get_next_variable_name_int(), the sequence of alloc -> efi_get_next_variable_name_int -> realloc -> efi_get_next_variable_name_int is required. In current code, this sequence repeatedly appears in the several functions. It should be curved out a common function. This commit also fixes the missing free() of var_name16 in eficonfig_delete_invalid_boot_option(). Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
140a8959 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use efi_get_next_variable_name_int() eficonfig command reads all possible UEFI load options from 0x0000 to 0xFFFF to construct the menu. This takes too much time in some environment. This commit uses efi_get_next_variable_name_int() to read all existing UEFI load options to significantlly reduce the count of efi_get_var() call. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
78b1ccc4 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use u16_strsize() to get u16 string buffer size Use u16_strsize() to simplify the u16 string buffer size calculation. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c67d3c9e |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix going one directory up issue The directory name in eficonfig menu entry contains the '\' separator. strcmp() argument ".." is wrong and one directory up handling does not work correctly. strcmp() argument must include '\' separator. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c3b5af63 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add UEFI Secure Boot Key enrollment interface This commit adds the menu-driven UEFI Secure Boot Key enrollment interface. User can enroll PK, KEK, db and dbx by selecting file. Only the signed EFI Signature List(s) with an authenticated header, typically '.auth' file, is accepted. To clear the PK, KEK, db and dbx, user needs to enroll the null key signed by PK or KEK. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
21faf4ef |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use protocol interface for file selection EFI_SIMPLE_FILE_SYSTEM_PROTOCOL is not always provided by U-Boot. Use protocol interface functions instead of U-Boot internal functions. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d6566113 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose eficonfig_create_device_path() Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use eficonfig_create_device_path() to construct the full device path from device path of the volume and file path, so move it out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d571f9b2 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation All the eficonfig menus other than "Change Boot Order" use 'eficonfig_entry' structure for each menu entry. This commit refactors change boot order implementation to use 'eficonfig_entry' structure same as other menus to have consistent menu handling. This commit also simplifies the data->active handling when KEY_SPACE is pressed, and sizeof() parameter. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
8961e93e |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose append entry function Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use append_entry() and append_quit_entry() to construct the menu, so move them out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
a84040ab |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor file selection handling eficonfig_select_file_handler() is commonly used to select the file. eficonfig_display_select_file_option() adds an additional menu to clear the selected file. eficonfig_display_select_file_option() is not always necessary for the file selection process, so it must be outside of eficonfig_select_file_handler(). This commit also renames the following functions to avoid confusion. eficonfig_select_file_handler() -> eficonfig_process_select_file() eficonfig_select_file() -> eficonfig_show_file_selection() eficonfig_display_select_file_option() -> eficonfig_process_show_file_option() Finally, test_eficonfig.py need to be updated to get aligned with the above modification. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
1167e88a |
|
14-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix missing variable initialization The 'ret' variable must be initialized before use in eficonfig_delete_invalid_boot_option(). Fixes: c416f1c0bc ("bootmenu: add removable media entries") Addresses-Coverity: 376207 ("Uninitialized variables") Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
3d595ac5 |
|
09-Nov-2022 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: remove superfluous if in eficonfig_edit_boot_option Goto for an immediately succeeding label is superfluous. Fixes: 87d791423ac6 ("eficonfig: menu-driven addition of UEFI boot option") Addresses-Coverity: 376202 ("Identical code for different branches") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
64550274 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: avoid SetVariable between GetNextVariableName calls The current code calls efi_set_variable_int() to delete the invalid boot option between calls to efi_get_next_variable_name_int(), it may produce unpredictable results. This commit moves removal of the invalid boot option outside of the efi_get_next_variable_name_int() calls. EFI_NOT_FOUND returned from efi_get_next_variable_name_int() indicates we retrieved all EFI variables, it should be treated as EFI_SUCEESS. To address the checkpatch warning of too many leading tabs, combine two if statement into one. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
ce327084 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: carve out efi_get_next_variable_name_int calls To retrieve the EFI variable name by efi_get_next_variable_name_int(), the sequence of alloc -> efi_get_next_variable_name_int -> realloc -> efi_get_next_variable_name_int is required. In current code, this sequence repeatedly appears in the several functions. It should be curved out a common function. This commit also fixes the missing free() of var_name16 in eficonfig_delete_invalid_boot_option(). Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
140a8959 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use efi_get_next_variable_name_int() eficonfig command reads all possible UEFI load options from 0x0000 to 0xFFFF to construct the menu. This takes too much time in some environment. This commit uses efi_get_next_variable_name_int() to read all existing UEFI load options to significantlly reduce the count of efi_get_var() call. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
78b1ccc4 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use u16_strsize() to get u16 string buffer size Use u16_strsize() to simplify the u16 string buffer size calculation. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c67d3c9e |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix going one directory up issue The directory name in eficonfig menu entry contains the '\' separator. strcmp() argument ".." is wrong and one directory up handling does not work correctly. strcmp() argument must include '\' separator. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c3b5af63 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add UEFI Secure Boot Key enrollment interface This commit adds the menu-driven UEFI Secure Boot Key enrollment interface. User can enroll PK, KEK, db and dbx by selecting file. Only the signed EFI Signature List(s) with an authenticated header, typically '.auth' file, is accepted. To clear the PK, KEK, db and dbx, user needs to enroll the null key signed by PK or KEK. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
21faf4ef |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use protocol interface for file selection EFI_SIMPLE_FILE_SYSTEM_PROTOCOL is not always provided by U-Boot. Use protocol interface functions instead of U-Boot internal functions. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d6566113 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose eficonfig_create_device_path() Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use eficonfig_create_device_path() to construct the full device path from device path of the volume and file path, so move it out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d571f9b2 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation All the eficonfig menus other than "Change Boot Order" use 'eficonfig_entry' structure for each menu entry. This commit refactors change boot order implementation to use 'eficonfig_entry' structure same as other menus to have consistent menu handling. This commit also simplifies the data->active handling when KEY_SPACE is pressed, and sizeof() parameter. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
8961e93e |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose append entry function Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use append_entry() and append_quit_entry() to construct the menu, so move them out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
a84040ab |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor file selection handling eficonfig_select_file_handler() is commonly used to select the file. eficonfig_display_select_file_option() adds an additional menu to clear the selected file. eficonfig_display_select_file_option() is not always necessary for the file selection process, so it must be outside of eficonfig_select_file_handler(). This commit also renames the following functions to avoid confusion. eficonfig_select_file_handler() -> eficonfig_process_select_file() eficonfig_select_file() -> eficonfig_show_file_selection() eficonfig_display_select_file_option() -> eficonfig_process_show_file_option() Finally, test_eficonfig.py need to be updated to get aligned with the above modification. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
1167e88a |
|
14-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix missing variable initialization The 'ret' variable must be initialized before use in eficonfig_delete_invalid_boot_option(). Fixes: c416f1c0bc ("bootmenu: add removable media entries") Addresses-Coverity: 376207 ("Uninitialized variables") Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
3d595ac5 |
|
09-Nov-2022 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: remove superfluous if in eficonfig_edit_boot_option Goto for an immediately succeeding label is superfluous. Fixes: 87d791423ac6 ("eficonfig: menu-driven addition of UEFI boot option") Addresses-Coverity: 376202 ("Identical code for different branches") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
64550274 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: avoid SetVariable between GetNextVariableName calls The current code calls efi_set_variable_int() to delete the invalid boot option between calls to efi_get_next_variable_name_int(), it may produce unpredictable results. This commit moves removal of the invalid boot option outside of the efi_get_next_variable_name_int() calls. EFI_NOT_FOUND returned from efi_get_next_variable_name_int() indicates we retrieved all EFI variables, it should be treated as EFI_SUCEESS. To address the checkpatch warning of too many leading tabs, combine two if statement into one. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
ce327084 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: carve out efi_get_next_variable_name_int calls To retrieve the EFI variable name by efi_get_next_variable_name_int(), the sequence of alloc -> efi_get_next_variable_name_int -> realloc -> efi_get_next_variable_name_int is required. In current code, this sequence repeatedly appears in the several functions. It should be curved out a common function. This commit also fixes the missing free() of var_name16 in eficonfig_delete_invalid_boot_option(). Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
140a8959 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use efi_get_next_variable_name_int() eficonfig command reads all possible UEFI load options from 0x0000 to 0xFFFF to construct the menu. This takes too much time in some environment. This commit uses efi_get_next_variable_name_int() to read all existing UEFI load options to significantlly reduce the count of efi_get_var() call. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
78b1ccc4 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use u16_strsize() to get u16 string buffer size Use u16_strsize() to simplify the u16 string buffer size calculation. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c67d3c9e |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix going one directory up issue The directory name in eficonfig menu entry contains the '\' separator. strcmp() argument ".." is wrong and one directory up handling does not work correctly. strcmp() argument must include '\' separator. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c3b5af63 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add UEFI Secure Boot Key enrollment interface This commit adds the menu-driven UEFI Secure Boot Key enrollment interface. User can enroll PK, KEK, db and dbx by selecting file. Only the signed EFI Signature List(s) with an authenticated header, typically '.auth' file, is accepted. To clear the PK, KEK, db and dbx, user needs to enroll the null key signed by PK or KEK. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
21faf4ef |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use protocol interface for file selection EFI_SIMPLE_FILE_SYSTEM_PROTOCOL is not always provided by U-Boot. Use protocol interface functions instead of U-Boot internal functions. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d6566113 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose eficonfig_create_device_path() Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use eficonfig_create_device_path() to construct the full device path from device path of the volume and file path, so move it out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d571f9b2 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation All the eficonfig menus other than "Change Boot Order" use 'eficonfig_entry' structure for each menu entry. This commit refactors change boot order implementation to use 'eficonfig_entry' structure same as other menus to have consistent menu handling. This commit also simplifies the data->active handling when KEY_SPACE is pressed, and sizeof() parameter. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
8961e93e |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose append entry function Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use append_entry() and append_quit_entry() to construct the menu, so move them out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
a84040ab |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor file selection handling eficonfig_select_file_handler() is commonly used to select the file. eficonfig_display_select_file_option() adds an additional menu to clear the selected file. eficonfig_display_select_file_option() is not always necessary for the file selection process, so it must be outside of eficonfig_select_file_handler(). This commit also renames the following functions to avoid confusion. eficonfig_select_file_handler() -> eficonfig_process_select_file() eficonfig_select_file() -> eficonfig_show_file_selection() eficonfig_display_select_file_option() -> eficonfig_process_show_file_option() Finally, test_eficonfig.py need to be updated to get aligned with the above modification. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
1167e88a |
|
14-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix missing variable initialization The 'ret' variable must be initialized before use in eficonfig_delete_invalid_boot_option(). Fixes: c416f1c0bc ("bootmenu: add removable media entries") Addresses-Coverity: 376207 ("Uninitialized variables") Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
3d595ac5 |
|
09-Nov-2022 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: remove superfluous if in eficonfig_edit_boot_option Goto for an immediately succeeding label is superfluous. Fixes: 87d791423ac6 ("eficonfig: menu-driven addition of UEFI boot option") Addresses-Coverity: 376202 ("Identical code for different branches") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
64550274 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: avoid SetVariable between GetNextVariableName calls The current code calls efi_set_variable_int() to delete the invalid boot option between calls to efi_get_next_variable_name_int(), it may produce unpredictable results. This commit moves removal of the invalid boot option outside of the efi_get_next_variable_name_int() calls. EFI_NOT_FOUND returned from efi_get_next_variable_name_int() indicates we retrieved all EFI variables, it should be treated as EFI_SUCEESS. To address the checkpatch warning of too many leading tabs, combine two if statement into one. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
ce327084 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: carve out efi_get_next_variable_name_int calls To retrieve the EFI variable name by efi_get_next_variable_name_int(), the sequence of alloc -> efi_get_next_variable_name_int -> realloc -> efi_get_next_variable_name_int is required. In current code, this sequence repeatedly appears in the several functions. It should be curved out a common function. This commit also fixes the missing free() of var_name16 in eficonfig_delete_invalid_boot_option(). Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
140a8959 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use efi_get_next_variable_name_int() eficonfig command reads all possible UEFI load options from 0x0000 to 0xFFFF to construct the menu. This takes too much time in some environment. This commit uses efi_get_next_variable_name_int() to read all existing UEFI load options to significantlly reduce the count of efi_get_var() call. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
78b1ccc4 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use u16_strsize() to get u16 string buffer size Use u16_strsize() to simplify the u16 string buffer size calculation. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c67d3c9e |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix going one directory up issue The directory name in eficonfig menu entry contains the '\' separator. strcmp() argument ".." is wrong and one directory up handling does not work correctly. strcmp() argument must include '\' separator. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c3b5af63 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add UEFI Secure Boot Key enrollment interface This commit adds the menu-driven UEFI Secure Boot Key enrollment interface. User can enroll PK, KEK, db and dbx by selecting file. Only the signed EFI Signature List(s) with an authenticated header, typically '.auth' file, is accepted. To clear the PK, KEK, db and dbx, user needs to enroll the null key signed by PK or KEK. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
21faf4ef |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use protocol interface for file selection EFI_SIMPLE_FILE_SYSTEM_PROTOCOL is not always provided by U-Boot. Use protocol interface functions instead of U-Boot internal functions. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d6566113 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose eficonfig_create_device_path() Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use eficonfig_create_device_path() to construct the full device path from device path of the volume and file path, so move it out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d571f9b2 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation All the eficonfig menus other than "Change Boot Order" use 'eficonfig_entry' structure for each menu entry. This commit refactors change boot order implementation to use 'eficonfig_entry' structure same as other menus to have consistent menu handling. This commit also simplifies the data->active handling when KEY_SPACE is pressed, and sizeof() parameter. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
8961e93e |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose append entry function Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use append_entry() and append_quit_entry() to construct the menu, so move them out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
a84040ab |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor file selection handling eficonfig_select_file_handler() is commonly used to select the file. eficonfig_display_select_file_option() adds an additional menu to clear the selected file. eficonfig_display_select_file_option() is not always necessary for the file selection process, so it must be outside of eficonfig_select_file_handler(). This commit also renames the following functions to avoid confusion. eficonfig_select_file_handler() -> eficonfig_process_select_file() eficonfig_select_file() -> eficonfig_show_file_selection() eficonfig_display_select_file_option() -> eficonfig_process_show_file_option() Finally, test_eficonfig.py need to be updated to get aligned with the above modification. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
1167e88a |
|
14-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix missing variable initialization The 'ret' variable must be initialized before use in eficonfig_delete_invalid_boot_option(). Fixes: c416f1c0bc ("bootmenu: add removable media entries") Addresses-Coverity: 376207 ("Uninitialized variables") Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
3d595ac5 |
|
09-Nov-2022 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: remove superfluous if in eficonfig_edit_boot_option Goto for an immediately succeeding label is superfluous. Fixes: 87d791423ac6 ("eficonfig: menu-driven addition of UEFI boot option") Addresses-Coverity: 376202 ("Identical code for different branches") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
64550274 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: avoid SetVariable between GetNextVariableName calls The current code calls efi_set_variable_int() to delete the invalid boot option between calls to efi_get_next_variable_name_int(), it may produce unpredictable results. This commit moves removal of the invalid boot option outside of the efi_get_next_variable_name_int() calls. EFI_NOT_FOUND returned from efi_get_next_variable_name_int() indicates we retrieved all EFI variables, it should be treated as EFI_SUCEESS. To address the checkpatch warning of too many leading tabs, combine two if statement into one. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
ce327084 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: carve out efi_get_next_variable_name_int calls To retrieve the EFI variable name by efi_get_next_variable_name_int(), the sequence of alloc -> efi_get_next_variable_name_int -> realloc -> efi_get_next_variable_name_int is required. In current code, this sequence repeatedly appears in the several functions. It should be curved out a common function. This commit also fixes the missing free() of var_name16 in eficonfig_delete_invalid_boot_option(). Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
140a8959 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use efi_get_next_variable_name_int() eficonfig command reads all possible UEFI load options from 0x0000 to 0xFFFF to construct the menu. This takes too much time in some environment. This commit uses efi_get_next_variable_name_int() to read all existing UEFI load options to significantlly reduce the count of efi_get_var() call. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
78b1ccc4 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use u16_strsize() to get u16 string buffer size Use u16_strsize() to simplify the u16 string buffer size calculation. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c67d3c9e |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix going one directory up issue The directory name in eficonfig menu entry contains the '\' separator. strcmp() argument ".." is wrong and one directory up handling does not work correctly. strcmp() argument must include '\' separator. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c3b5af63 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add UEFI Secure Boot Key enrollment interface This commit adds the menu-driven UEFI Secure Boot Key enrollment interface. User can enroll PK, KEK, db and dbx by selecting file. Only the signed EFI Signature List(s) with an authenticated header, typically '.auth' file, is accepted. To clear the PK, KEK, db and dbx, user needs to enroll the null key signed by PK or KEK. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
21faf4ef |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use protocol interface for file selection EFI_SIMPLE_FILE_SYSTEM_PROTOCOL is not always provided by U-Boot. Use protocol interface functions instead of U-Boot internal functions. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d6566113 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose eficonfig_create_device_path() Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use eficonfig_create_device_path() to construct the full device path from device path of the volume and file path, so move it out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d571f9b2 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation All the eficonfig menus other than "Change Boot Order" use 'eficonfig_entry' structure for each menu entry. This commit refactors change boot order implementation to use 'eficonfig_entry' structure same as other menus to have consistent menu handling. This commit also simplifies the data->active handling when KEY_SPACE is pressed, and sizeof() parameter. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
8961e93e |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose append entry function Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use append_entry() and append_quit_entry() to construct the menu, so move them out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
a84040ab |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor file selection handling eficonfig_select_file_handler() is commonly used to select the file. eficonfig_display_select_file_option() adds an additional menu to clear the selected file. eficonfig_display_select_file_option() is not always necessary for the file selection process, so it must be outside of eficonfig_select_file_handler(). This commit also renames the following functions to avoid confusion. eficonfig_select_file_handler() -> eficonfig_process_select_file() eficonfig_select_file() -> eficonfig_show_file_selection() eficonfig_display_select_file_option() -> eficonfig_process_show_file_option() Finally, test_eficonfig.py need to be updated to get aligned with the above modification. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
1167e88a |
|
14-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix missing variable initialization The 'ret' variable must be initialized before use in eficonfig_delete_invalid_boot_option(). Fixes: c416f1c0bc ("bootmenu: add removable media entries") Addresses-Coverity: 376207 ("Uninitialized variables") Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
3d595ac5 |
|
09-Nov-2022 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: remove superfluous if in eficonfig_edit_boot_option Goto for an immediately succeeding label is superfluous. Fixes: 87d791423ac6 ("eficonfig: menu-driven addition of UEFI boot option") Addresses-Coverity: 376202 ("Identical code for different branches") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
64550274 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: avoid SetVariable between GetNextVariableName calls The current code calls efi_set_variable_int() to delete the invalid boot option between calls to efi_get_next_variable_name_int(), it may produce unpredictable results. This commit moves removal of the invalid boot option outside of the efi_get_next_variable_name_int() calls. EFI_NOT_FOUND returned from efi_get_next_variable_name_int() indicates we retrieved all EFI variables, it should be treated as EFI_SUCEESS. To address the checkpatch warning of too many leading tabs, combine two if statement into one. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
ce327084 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: carve out efi_get_next_variable_name_int calls To retrieve the EFI variable name by efi_get_next_variable_name_int(), the sequence of alloc -> efi_get_next_variable_name_int -> realloc -> efi_get_next_variable_name_int is required. In current code, this sequence repeatedly appears in the several functions. It should be curved out a common function. This commit also fixes the missing free() of var_name16 in eficonfig_delete_invalid_boot_option(). Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
140a8959 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use efi_get_next_variable_name_int() eficonfig command reads all possible UEFI load options from 0x0000 to 0xFFFF to construct the menu. This takes too much time in some environment. This commit uses efi_get_next_variable_name_int() to read all existing UEFI load options to significantlly reduce the count of efi_get_var() call. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
78b1ccc4 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use u16_strsize() to get u16 string buffer size Use u16_strsize() to simplify the u16 string buffer size calculation. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c67d3c9e |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix going one directory up issue The directory name in eficonfig menu entry contains the '\' separator. strcmp() argument ".." is wrong and one directory up handling does not work correctly. strcmp() argument must include '\' separator. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c3b5af63 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add UEFI Secure Boot Key enrollment interface This commit adds the menu-driven UEFI Secure Boot Key enrollment interface. User can enroll PK, KEK, db and dbx by selecting file. Only the signed EFI Signature List(s) with an authenticated header, typically '.auth' file, is accepted. To clear the PK, KEK, db and dbx, user needs to enroll the null key signed by PK or KEK. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
21faf4ef |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use protocol interface for file selection EFI_SIMPLE_FILE_SYSTEM_PROTOCOL is not always provided by U-Boot. Use protocol interface functions instead of U-Boot internal functions. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d6566113 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose eficonfig_create_device_path() Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use eficonfig_create_device_path() to construct the full device path from device path of the volume and file path, so move it out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d571f9b2 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation All the eficonfig menus other than "Change Boot Order" use 'eficonfig_entry' structure for each menu entry. This commit refactors change boot order implementation to use 'eficonfig_entry' structure same as other menus to have consistent menu handling. This commit also simplifies the data->active handling when KEY_SPACE is pressed, and sizeof() parameter. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
8961e93e |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose append entry function Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use append_entry() and append_quit_entry() to construct the menu, so move them out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
a84040ab |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor file selection handling eficonfig_select_file_handler() is commonly used to select the file. eficonfig_display_select_file_option() adds an additional menu to clear the selected file. eficonfig_display_select_file_option() is not always necessary for the file selection process, so it must be outside of eficonfig_select_file_handler(). This commit also renames the following functions to avoid confusion. eficonfig_select_file_handler() -> eficonfig_process_select_file() eficonfig_select_file() -> eficonfig_show_file_selection() eficonfig_display_select_file_option() -> eficonfig_process_show_file_option() Finally, test_eficonfig.py need to be updated to get aligned with the above modification. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
1167e88a |
|
14-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix missing variable initialization The 'ret' variable must be initialized before use in eficonfig_delete_invalid_boot_option(). Fixes: c416f1c0bc ("bootmenu: add removable media entries") Addresses-Coverity: 376207 ("Uninitialized variables") Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
3d595ac5 |
|
09-Nov-2022 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: remove superfluous if in eficonfig_edit_boot_option Goto for an immediately succeeding label is superfluous. Fixes: 87d791423ac6 ("eficonfig: menu-driven addition of UEFI boot option") Addresses-Coverity: 376202 ("Identical code for different branches") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
64550274 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: avoid SetVariable between GetNextVariableName calls The current code calls efi_set_variable_int() to delete the invalid boot option between calls to efi_get_next_variable_name_int(), it may produce unpredictable results. This commit moves removal of the invalid boot option outside of the efi_get_next_variable_name_int() calls. EFI_NOT_FOUND returned from efi_get_next_variable_name_int() indicates we retrieved all EFI variables, it should be treated as EFI_SUCEESS. To address the checkpatch warning of too many leading tabs, combine two if statement into one. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
ce327084 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: carve out efi_get_next_variable_name_int calls To retrieve the EFI variable name by efi_get_next_variable_name_int(), the sequence of alloc -> efi_get_next_variable_name_int -> realloc -> efi_get_next_variable_name_int is required. In current code, this sequence repeatedly appears in the several functions. It should be curved out a common function. This commit also fixes the missing free() of var_name16 in eficonfig_delete_invalid_boot_option(). Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
140a8959 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use efi_get_next_variable_name_int() eficonfig command reads all possible UEFI load options from 0x0000 to 0xFFFF to construct the menu. This takes too much time in some environment. This commit uses efi_get_next_variable_name_int() to read all existing UEFI load options to significantlly reduce the count of efi_get_var() call. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
78b1ccc4 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use u16_strsize() to get u16 string buffer size Use u16_strsize() to simplify the u16 string buffer size calculation. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c67d3c9e |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix going one directory up issue The directory name in eficonfig menu entry contains the '\' separator. strcmp() argument ".." is wrong and one directory up handling does not work correctly. strcmp() argument must include '\' separator. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c3b5af63 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add UEFI Secure Boot Key enrollment interface This commit adds the menu-driven UEFI Secure Boot Key enrollment interface. User can enroll PK, KEK, db and dbx by selecting file. Only the signed EFI Signature List(s) with an authenticated header, typically '.auth' file, is accepted. To clear the PK, KEK, db and dbx, user needs to enroll the null key signed by PK or KEK. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
21faf4ef |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use protocol interface for file selection EFI_SIMPLE_FILE_SYSTEM_PROTOCOL is not always provided by U-Boot. Use protocol interface functions instead of U-Boot internal functions. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d6566113 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose eficonfig_create_device_path() Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use eficonfig_create_device_path() to construct the full device path from device path of the volume and file path, so move it out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d571f9b2 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation All the eficonfig menus other than "Change Boot Order" use 'eficonfig_entry' structure for each menu entry. This commit refactors change boot order implementation to use 'eficonfig_entry' structure same as other menus to have consistent menu handling. This commit also simplifies the data->active handling when KEY_SPACE is pressed, and sizeof() parameter. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
8961e93e |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose append entry function Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use append_entry() and append_quit_entry() to construct the menu, so move them out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
a84040ab |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor file selection handling eficonfig_select_file_handler() is commonly used to select the file. eficonfig_display_select_file_option() adds an additional menu to clear the selected file. eficonfig_display_select_file_option() is not always necessary for the file selection process, so it must be outside of eficonfig_select_file_handler(). This commit also renames the following functions to avoid confusion. eficonfig_select_file_handler() -> eficonfig_process_select_file() eficonfig_select_file() -> eficonfig_show_file_selection() eficonfig_display_select_file_option() -> eficonfig_process_show_file_option() Finally, test_eficonfig.py need to be updated to get aligned with the above modification. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
1167e88a |
|
14-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix missing variable initialization The 'ret' variable must be initialized before use in eficonfig_delete_invalid_boot_option(). Fixes: c416f1c0bc ("bootmenu: add removable media entries") Addresses-Coverity: 376207 ("Uninitialized variables") Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
3d595ac5 |
|
09-Nov-2022 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: remove superfluous if in eficonfig_edit_boot_option Goto for an immediately succeeding label is superfluous. Fixes: 87d791423ac6 ("eficonfig: menu-driven addition of UEFI boot option") Addresses-Coverity: 376202 ("Identical code for different branches") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
64550274 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: avoid SetVariable between GetNextVariableName calls The current code calls efi_set_variable_int() to delete the invalid boot option between calls to efi_get_next_variable_name_int(), it may produce unpredictable results. This commit moves removal of the invalid boot option outside of the efi_get_next_variable_name_int() calls. EFI_NOT_FOUND returned from efi_get_next_variable_name_int() indicates we retrieved all EFI variables, it should be treated as EFI_SUCEESS. To address the checkpatch warning of too many leading tabs, combine two if statement into one. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
ce327084 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: carve out efi_get_next_variable_name_int calls To retrieve the EFI variable name by efi_get_next_variable_name_int(), the sequence of alloc -> efi_get_next_variable_name_int -> realloc -> efi_get_next_variable_name_int is required. In current code, this sequence repeatedly appears in the several functions. It should be curved out a common function. This commit also fixes the missing free() of var_name16 in eficonfig_delete_invalid_boot_option(). Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
140a8959 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use efi_get_next_variable_name_int() eficonfig command reads all possible UEFI load options from 0x0000 to 0xFFFF to construct the menu. This takes too much time in some environment. This commit uses efi_get_next_variable_name_int() to read all existing UEFI load options to significantlly reduce the count of efi_get_var() call. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
78b1ccc4 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use u16_strsize() to get u16 string buffer size Use u16_strsize() to simplify the u16 string buffer size calculation. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c67d3c9e |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix going one directory up issue The directory name in eficonfig menu entry contains the '\' separator. strcmp() argument ".." is wrong and one directory up handling does not work correctly. strcmp() argument must include '\' separator. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c3b5af63 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add UEFI Secure Boot Key enrollment interface This commit adds the menu-driven UEFI Secure Boot Key enrollment interface. User can enroll PK, KEK, db and dbx by selecting file. Only the signed EFI Signature List(s) with an authenticated header, typically '.auth' file, is accepted. To clear the PK, KEK, db and dbx, user needs to enroll the null key signed by PK or KEK. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
21faf4ef |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use protocol interface for file selection EFI_SIMPLE_FILE_SYSTEM_PROTOCOL is not always provided by U-Boot. Use protocol interface functions instead of U-Boot internal functions. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d6566113 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose eficonfig_create_device_path() Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use eficonfig_create_device_path() to construct the full device path from device path of the volume and file path, so move it out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d571f9b2 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation All the eficonfig menus other than "Change Boot Order" use 'eficonfig_entry' structure for each menu entry. This commit refactors change boot order implementation to use 'eficonfig_entry' structure same as other menus to have consistent menu handling. This commit also simplifies the data->active handling when KEY_SPACE is pressed, and sizeof() parameter. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
8961e93e |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose append entry function Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use append_entry() and append_quit_entry() to construct the menu, so move them out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
a84040ab |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor file selection handling eficonfig_select_file_handler() is commonly used to select the file. eficonfig_display_select_file_option() adds an additional menu to clear the selected file. eficonfig_display_select_file_option() is not always necessary for the file selection process, so it must be outside of eficonfig_select_file_handler(). This commit also renames the following functions to avoid confusion. eficonfig_select_file_handler() -> eficonfig_process_select_file() eficonfig_select_file() -> eficonfig_show_file_selection() eficonfig_display_select_file_option() -> eficonfig_process_show_file_option() Finally, test_eficonfig.py need to be updated to get aligned with the above modification. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
1167e88a |
|
14-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix missing variable initialization The 'ret' variable must be initialized before use in eficonfig_delete_invalid_boot_option(). Fixes: c416f1c0bc ("bootmenu: add removable media entries") Addresses-Coverity: 376207 ("Uninitialized variables") Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
3d595ac5 |
|
09-Nov-2022 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: remove superfluous if in eficonfig_edit_boot_option Goto for an immediately succeeding label is superfluous. Fixes: 87d791423ac6 ("eficonfig: menu-driven addition of UEFI boot option") Addresses-Coverity: 376202 ("Identical code for different branches") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
64550274 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: avoid SetVariable between GetNextVariableName calls The current code calls efi_set_variable_int() to delete the invalid boot option between calls to efi_get_next_variable_name_int(), it may produce unpredictable results. This commit moves removal of the invalid boot option outside of the efi_get_next_variable_name_int() calls. EFI_NOT_FOUND returned from efi_get_next_variable_name_int() indicates we retrieved all EFI variables, it should be treated as EFI_SUCEESS. To address the checkpatch warning of too many leading tabs, combine two if statement into one. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
ce327084 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: carve out efi_get_next_variable_name_int calls To retrieve the EFI variable name by efi_get_next_variable_name_int(), the sequence of alloc -> efi_get_next_variable_name_int -> realloc -> efi_get_next_variable_name_int is required. In current code, this sequence repeatedly appears in the several functions. It should be curved out a common function. This commit also fixes the missing free() of var_name16 in eficonfig_delete_invalid_boot_option(). Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
140a8959 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use efi_get_next_variable_name_int() eficonfig command reads all possible UEFI load options from 0x0000 to 0xFFFF to construct the menu. This takes too much time in some environment. This commit uses efi_get_next_variable_name_int() to read all existing UEFI load options to significantlly reduce the count of efi_get_var() call. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
78b1ccc4 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use u16_strsize() to get u16 string buffer size Use u16_strsize() to simplify the u16 string buffer size calculation. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c67d3c9e |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix going one directory up issue The directory name in eficonfig menu entry contains the '\' separator. strcmp() argument ".." is wrong and one directory up handling does not work correctly. strcmp() argument must include '\' separator. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c3b5af63 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add UEFI Secure Boot Key enrollment interface This commit adds the menu-driven UEFI Secure Boot Key enrollment interface. User can enroll PK, KEK, db and dbx by selecting file. Only the signed EFI Signature List(s) with an authenticated header, typically '.auth' file, is accepted. To clear the PK, KEK, db and dbx, user needs to enroll the null key signed by PK or KEK. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
21faf4ef |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use protocol interface for file selection EFI_SIMPLE_FILE_SYSTEM_PROTOCOL is not always provided by U-Boot. Use protocol interface functions instead of U-Boot internal functions. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d6566113 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose eficonfig_create_device_path() Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use eficonfig_create_device_path() to construct the full device path from device path of the volume and file path, so move it out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d571f9b2 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation All the eficonfig menus other than "Change Boot Order" use 'eficonfig_entry' structure for each menu entry. This commit refactors change boot order implementation to use 'eficonfig_entry' structure same as other menus to have consistent menu handling. This commit also simplifies the data->active handling when KEY_SPACE is pressed, and sizeof() parameter. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
8961e93e |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose append entry function Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use append_entry() and append_quit_entry() to construct the menu, so move them out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
a84040ab |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor file selection handling eficonfig_select_file_handler() is commonly used to select the file. eficonfig_display_select_file_option() adds an additional menu to clear the selected file. eficonfig_display_select_file_option() is not always necessary for the file selection process, so it must be outside of eficonfig_select_file_handler(). This commit also renames the following functions to avoid confusion. eficonfig_select_file_handler() -> eficonfig_process_select_file() eficonfig_select_file() -> eficonfig_show_file_selection() eficonfig_display_select_file_option() -> eficonfig_process_show_file_option() Finally, test_eficonfig.py need to be updated to get aligned with the above modification. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
1167e88a |
|
14-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix missing variable initialization The 'ret' variable must be initialized before use in eficonfig_delete_invalid_boot_option(). Fixes: c416f1c0bc ("bootmenu: add removable media entries") Addresses-Coverity: 376207 ("Uninitialized variables") Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
3d595ac5 |
|
09-Nov-2022 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: remove superfluous if in eficonfig_edit_boot_option Goto for an immediately succeeding label is superfluous. Fixes: 87d791423ac6 ("eficonfig: menu-driven addition of UEFI boot option") Addresses-Coverity: 376202 ("Identical code for different branches") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
64550274 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: avoid SetVariable between GetNextVariableName calls The current code calls efi_set_variable_int() to delete the invalid boot option between calls to efi_get_next_variable_name_int(), it may produce unpredictable results. This commit moves removal of the invalid boot option outside of the efi_get_next_variable_name_int() calls. EFI_NOT_FOUND returned from efi_get_next_variable_name_int() indicates we retrieved all EFI variables, it should be treated as EFI_SUCEESS. To address the checkpatch warning of too many leading tabs, combine two if statement into one. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
ce327084 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: carve out efi_get_next_variable_name_int calls To retrieve the EFI variable name by efi_get_next_variable_name_int(), the sequence of alloc -> efi_get_next_variable_name_int -> realloc -> efi_get_next_variable_name_int is required. In current code, this sequence repeatedly appears in the several functions. It should be curved out a common function. This commit also fixes the missing free() of var_name16 in eficonfig_delete_invalid_boot_option(). Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
140a8959 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use efi_get_next_variable_name_int() eficonfig command reads all possible UEFI load options from 0x0000 to 0xFFFF to construct the menu. This takes too much time in some environment. This commit uses efi_get_next_variable_name_int() to read all existing UEFI load options to significantlly reduce the count of efi_get_var() call. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
78b1ccc4 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use u16_strsize() to get u16 string buffer size Use u16_strsize() to simplify the u16 string buffer size calculation. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c67d3c9e |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix going one directory up issue The directory name in eficonfig menu entry contains the '\' separator. strcmp() argument ".." is wrong and one directory up handling does not work correctly. strcmp() argument must include '\' separator. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c3b5af63 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add UEFI Secure Boot Key enrollment interface This commit adds the menu-driven UEFI Secure Boot Key enrollment interface. User can enroll PK, KEK, db and dbx by selecting file. Only the signed EFI Signature List(s) with an authenticated header, typically '.auth' file, is accepted. To clear the PK, KEK, db and dbx, user needs to enroll the null key signed by PK or KEK. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
21faf4ef |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use protocol interface for file selection EFI_SIMPLE_FILE_SYSTEM_PROTOCOL is not always provided by U-Boot. Use protocol interface functions instead of U-Boot internal functions. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d6566113 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose eficonfig_create_device_path() Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use eficonfig_create_device_path() to construct the full device path from device path of the volume and file path, so move it out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d571f9b2 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation All the eficonfig menus other than "Change Boot Order" use 'eficonfig_entry' structure for each menu entry. This commit refactors change boot order implementation to use 'eficonfig_entry' structure same as other menus to have consistent menu handling. This commit also simplifies the data->active handling when KEY_SPACE is pressed, and sizeof() parameter. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
8961e93e |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose append entry function Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use append_entry() and append_quit_entry() to construct the menu, so move them out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
a84040ab |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor file selection handling eficonfig_select_file_handler() is commonly used to select the file. eficonfig_display_select_file_option() adds an additional menu to clear the selected file. eficonfig_display_select_file_option() is not always necessary for the file selection process, so it must be outside of eficonfig_select_file_handler(). This commit also renames the following functions to avoid confusion. eficonfig_select_file_handler() -> eficonfig_process_select_file() eficonfig_select_file() -> eficonfig_show_file_selection() eficonfig_display_select_file_option() -> eficonfig_process_show_file_option() Finally, test_eficonfig.py need to be updated to get aligned with the above modification. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
1167e88a |
|
14-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix missing variable initialization The 'ret' variable must be initialized before use in eficonfig_delete_invalid_boot_option(). Fixes: c416f1c0bc ("bootmenu: add removable media entries") Addresses-Coverity: 376207 ("Uninitialized variables") Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
3d595ac5 |
|
09-Nov-2022 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: remove superfluous if in eficonfig_edit_boot_option Goto for an immediately succeeding label is superfluous. Fixes: 87d791423ac6 ("eficonfig: menu-driven addition of UEFI boot option") Addresses-Coverity: 376202 ("Identical code for different branches") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
64550274 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: avoid SetVariable between GetNextVariableName calls The current code calls efi_set_variable_int() to delete the invalid boot option between calls to efi_get_next_variable_name_int(), it may produce unpredictable results. This commit moves removal of the invalid boot option outside of the efi_get_next_variable_name_int() calls. EFI_NOT_FOUND returned from efi_get_next_variable_name_int() indicates we retrieved all EFI variables, it should be treated as EFI_SUCEESS. To address the checkpatch warning of too many leading tabs, combine two if statement into one. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
ce327084 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: carve out efi_get_next_variable_name_int calls To retrieve the EFI variable name by efi_get_next_variable_name_int(), the sequence of alloc -> efi_get_next_variable_name_int -> realloc -> efi_get_next_variable_name_int is required. In current code, this sequence repeatedly appears in the several functions. It should be curved out a common function. This commit also fixes the missing free() of var_name16 in eficonfig_delete_invalid_boot_option(). Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
140a8959 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use efi_get_next_variable_name_int() eficonfig command reads all possible UEFI load options from 0x0000 to 0xFFFF to construct the menu. This takes too much time in some environment. This commit uses efi_get_next_variable_name_int() to read all existing UEFI load options to significantlly reduce the count of efi_get_var() call. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
78b1ccc4 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use u16_strsize() to get u16 string buffer size Use u16_strsize() to simplify the u16 string buffer size calculation. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c67d3c9e |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix going one directory up issue The directory name in eficonfig menu entry contains the '\' separator. strcmp() argument ".." is wrong and one directory up handling does not work correctly. strcmp() argument must include '\' separator. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c3b5af63 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add UEFI Secure Boot Key enrollment interface This commit adds the menu-driven UEFI Secure Boot Key enrollment interface. User can enroll PK, KEK, db and dbx by selecting file. Only the signed EFI Signature List(s) with an authenticated header, typically '.auth' file, is accepted. To clear the PK, KEK, db and dbx, user needs to enroll the null key signed by PK or KEK. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
21faf4ef |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use protocol interface for file selection EFI_SIMPLE_FILE_SYSTEM_PROTOCOL is not always provided by U-Boot. Use protocol interface functions instead of U-Boot internal functions. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d6566113 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose eficonfig_create_device_path() Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use eficonfig_create_device_path() to construct the full device path from device path of the volume and file path, so move it out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d571f9b2 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation All the eficonfig menus other than "Change Boot Order" use 'eficonfig_entry' structure for each menu entry. This commit refactors change boot order implementation to use 'eficonfig_entry' structure same as other menus to have consistent menu handling. This commit also simplifies the data->active handling when KEY_SPACE is pressed, and sizeof() parameter. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
8961e93e |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose append entry function Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use append_entry() and append_quit_entry() to construct the menu, so move them out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
a84040ab |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor file selection handling eficonfig_select_file_handler() is commonly used to select the file. eficonfig_display_select_file_option() adds an additional menu to clear the selected file. eficonfig_display_select_file_option() is not always necessary for the file selection process, so it must be outside of eficonfig_select_file_handler(). This commit also renames the following functions to avoid confusion. eficonfig_select_file_handler() -> eficonfig_process_select_file() eficonfig_select_file() -> eficonfig_show_file_selection() eficonfig_display_select_file_option() -> eficonfig_process_show_file_option() Finally, test_eficonfig.py need to be updated to get aligned with the above modification. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
1167e88a |
|
14-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix missing variable initialization The 'ret' variable must be initialized before use in eficonfig_delete_invalid_boot_option(). Fixes: c416f1c0bc ("bootmenu: add removable media entries") Addresses-Coverity: 376207 ("Uninitialized variables") Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
3d595ac5 |
|
09-Nov-2022 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: remove superfluous if in eficonfig_edit_boot_option Goto for an immediately succeeding label is superfluous. Fixes: 87d791423ac6 ("eficonfig: menu-driven addition of UEFI boot option") Addresses-Coverity: 376202 ("Identical code for different branches") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
64550274 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: avoid SetVariable between GetNextVariableName calls The current code calls efi_set_variable_int() to delete the invalid boot option between calls to efi_get_next_variable_name_int(), it may produce unpredictable results. This commit moves removal of the invalid boot option outside of the efi_get_next_variable_name_int() calls. EFI_NOT_FOUND returned from efi_get_next_variable_name_int() indicates we retrieved all EFI variables, it should be treated as EFI_SUCEESS. To address the checkpatch warning of too many leading tabs, combine two if statement into one. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
ce327084 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: carve out efi_get_next_variable_name_int calls To retrieve the EFI variable name by efi_get_next_variable_name_int(), the sequence of alloc -> efi_get_next_variable_name_int -> realloc -> efi_get_next_variable_name_int is required. In current code, this sequence repeatedly appears in the several functions. It should be curved out a common function. This commit also fixes the missing free() of var_name16 in eficonfig_delete_invalid_boot_option(). Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
140a8959 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use efi_get_next_variable_name_int() eficonfig command reads all possible UEFI load options from 0x0000 to 0xFFFF to construct the menu. This takes too much time in some environment. This commit uses efi_get_next_variable_name_int() to read all existing UEFI load options to significantlly reduce the count of efi_get_var() call. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
78b1ccc4 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use u16_strsize() to get u16 string buffer size Use u16_strsize() to simplify the u16 string buffer size calculation. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c67d3c9e |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix going one directory up issue The directory name in eficonfig menu entry contains the '\' separator. strcmp() argument ".." is wrong and one directory up handling does not work correctly. strcmp() argument must include '\' separator. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c3b5af63 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add UEFI Secure Boot Key enrollment interface This commit adds the menu-driven UEFI Secure Boot Key enrollment interface. User can enroll PK, KEK, db and dbx by selecting file. Only the signed EFI Signature List(s) with an authenticated header, typically '.auth' file, is accepted. To clear the PK, KEK, db and dbx, user needs to enroll the null key signed by PK or KEK. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
21faf4ef |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use protocol interface for file selection EFI_SIMPLE_FILE_SYSTEM_PROTOCOL is not always provided by U-Boot. Use protocol interface functions instead of U-Boot internal functions. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d6566113 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose eficonfig_create_device_path() Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use eficonfig_create_device_path() to construct the full device path from device path of the volume and file path, so move it out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d571f9b2 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation All the eficonfig menus other than "Change Boot Order" use 'eficonfig_entry' structure for each menu entry. This commit refactors change boot order implementation to use 'eficonfig_entry' structure same as other menus to have consistent menu handling. This commit also simplifies the data->active handling when KEY_SPACE is pressed, and sizeof() parameter. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
8961e93e |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose append entry function Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use append_entry() and append_quit_entry() to construct the menu, so move them out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
a84040ab |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor file selection handling eficonfig_select_file_handler() is commonly used to select the file. eficonfig_display_select_file_option() adds an additional menu to clear the selected file. eficonfig_display_select_file_option() is not always necessary for the file selection process, so it must be outside of eficonfig_select_file_handler(). This commit also renames the following functions to avoid confusion. eficonfig_select_file_handler() -> eficonfig_process_select_file() eficonfig_select_file() -> eficonfig_show_file_selection() eficonfig_display_select_file_option() -> eficonfig_process_show_file_option() Finally, test_eficonfig.py need to be updated to get aligned with the above modification. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
1167e88a |
|
14-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix missing variable initialization The 'ret' variable must be initialized before use in eficonfig_delete_invalid_boot_option(). Fixes: c416f1c0bc ("bootmenu: add removable media entries") Addresses-Coverity: 376207 ("Uninitialized variables") Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
3d595ac5 |
|
09-Nov-2022 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: remove superfluous if in eficonfig_edit_boot_option Goto for an immediately succeeding label is superfluous. Fixes: 87d791423ac6 ("eficonfig: menu-driven addition of UEFI boot option") Addresses-Coverity: 376202 ("Identical code for different branches") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
64550274 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: avoid SetVariable between GetNextVariableName calls The current code calls efi_set_variable_int() to delete the invalid boot option between calls to efi_get_next_variable_name_int(), it may produce unpredictable results. This commit moves removal of the invalid boot option outside of the efi_get_next_variable_name_int() calls. EFI_NOT_FOUND returned from efi_get_next_variable_name_int() indicates we retrieved all EFI variables, it should be treated as EFI_SUCEESS. To address the checkpatch warning of too many leading tabs, combine two if statement into one. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
ce327084 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: carve out efi_get_next_variable_name_int calls To retrieve the EFI variable name by efi_get_next_variable_name_int(), the sequence of alloc -> efi_get_next_variable_name_int -> realloc -> efi_get_next_variable_name_int is required. In current code, this sequence repeatedly appears in the several functions. It should be curved out a common function. This commit also fixes the missing free() of var_name16 in eficonfig_delete_invalid_boot_option(). Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
140a8959 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use efi_get_next_variable_name_int() eficonfig command reads all possible UEFI load options from 0x0000 to 0xFFFF to construct the menu. This takes too much time in some environment. This commit uses efi_get_next_variable_name_int() to read all existing UEFI load options to significantlly reduce the count of efi_get_var() call. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
78b1ccc4 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use u16_strsize() to get u16 string buffer size Use u16_strsize() to simplify the u16 string buffer size calculation. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c67d3c9e |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix going one directory up issue The directory name in eficonfig menu entry contains the '\' separator. strcmp() argument ".." is wrong and one directory up handling does not work correctly. strcmp() argument must include '\' separator. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c3b5af63 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add UEFI Secure Boot Key enrollment interface This commit adds the menu-driven UEFI Secure Boot Key enrollment interface. User can enroll PK, KEK, db and dbx by selecting file. Only the signed EFI Signature List(s) with an authenticated header, typically '.auth' file, is accepted. To clear the PK, KEK, db and dbx, user needs to enroll the null key signed by PK or KEK. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
21faf4ef |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use protocol interface for file selection EFI_SIMPLE_FILE_SYSTEM_PROTOCOL is not always provided by U-Boot. Use protocol interface functions instead of U-Boot internal functions. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d6566113 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose eficonfig_create_device_path() Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use eficonfig_create_device_path() to construct the full device path from device path of the volume and file path, so move it out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d571f9b2 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation All the eficonfig menus other than "Change Boot Order" use 'eficonfig_entry' structure for each menu entry. This commit refactors change boot order implementation to use 'eficonfig_entry' structure same as other menus to have consistent menu handling. This commit also simplifies the data->active handling when KEY_SPACE is pressed, and sizeof() parameter. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
8961e93e |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose append entry function Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use append_entry() and append_quit_entry() to construct the menu, so move them out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
a84040ab |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor file selection handling eficonfig_select_file_handler() is commonly used to select the file. eficonfig_display_select_file_option() adds an additional menu to clear the selected file. eficonfig_display_select_file_option() is not always necessary for the file selection process, so it must be outside of eficonfig_select_file_handler(). This commit also renames the following functions to avoid confusion. eficonfig_select_file_handler() -> eficonfig_process_select_file() eficonfig_select_file() -> eficonfig_show_file_selection() eficonfig_display_select_file_option() -> eficonfig_process_show_file_option() Finally, test_eficonfig.py need to be updated to get aligned with the above modification. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
1167e88a |
|
14-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix missing variable initialization The 'ret' variable must be initialized before use in eficonfig_delete_invalid_boot_option(). Fixes: c416f1c0bc ("bootmenu: add removable media entries") Addresses-Coverity: 376207 ("Uninitialized variables") Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
3d595ac5 |
|
09-Nov-2022 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: remove superfluous if in eficonfig_edit_boot_option Goto for an immediately succeeding label is superfluous. Fixes: 87d791423ac6 ("eficonfig: menu-driven addition of UEFI boot option") Addresses-Coverity: 376202 ("Identical code for different branches") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
64550274 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: avoid SetVariable between GetNextVariableName calls The current code calls efi_set_variable_int() to delete the invalid boot option between calls to efi_get_next_variable_name_int(), it may produce unpredictable results. This commit moves removal of the invalid boot option outside of the efi_get_next_variable_name_int() calls. EFI_NOT_FOUND returned from efi_get_next_variable_name_int() indicates we retrieved all EFI variables, it should be treated as EFI_SUCEESS. To address the checkpatch warning of too many leading tabs, combine two if statement into one. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
ce327084 |
|
18-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: carve out efi_get_next_variable_name_int calls To retrieve the EFI variable name by efi_get_next_variable_name_int(), the sequence of alloc -> efi_get_next_variable_name_int -> realloc -> efi_get_next_variable_name_int is required. In current code, this sequence repeatedly appears in the several functions. It should be curved out a common function. This commit also fixes the missing free() of var_name16 in eficonfig_delete_invalid_boot_option(). Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
140a8959 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use efi_get_next_variable_name_int() eficonfig command reads all possible UEFI load options from 0x0000 to 0xFFFF to construct the menu. This takes too much time in some environment. This commit uses efi_get_next_variable_name_int() to read all existing UEFI load options to significantlly reduce the count of efi_get_var() call. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
78b1ccc4 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use u16_strsize() to get u16 string buffer size Use u16_strsize() to simplify the u16 string buffer size calculation. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c67d3c9e |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix going one directory up issue The directory name in eficonfig menu entry contains the '\' separator. strcmp() argument ".." is wrong and one directory up handling does not work correctly. strcmp() argument must include '\' separator. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c3b5af63 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add UEFI Secure Boot Key enrollment interface This commit adds the menu-driven UEFI Secure Boot Key enrollment interface. User can enroll PK, KEK, db and dbx by selecting file. Only the signed EFI Signature List(s) with an authenticated header, typically '.auth' file, is accepted. To clear the PK, KEK, db and dbx, user needs to enroll the null key signed by PK or KEK. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
21faf4ef |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use protocol interface for file selection EFI_SIMPLE_FILE_SYSTEM_PROTOCOL is not always provided by U-Boot. Use protocol interface functions instead of U-Boot internal functions. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d6566113 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose eficonfig_create_device_path() Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use eficonfig_create_device_path() to construct the full device path from device path of the volume and file path, so move it out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d571f9b2 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation All the eficonfig menus other than "Change Boot Order" use 'eficonfig_entry' structure for each menu entry. This commit refactors change boot order implementation to use 'eficonfig_entry' structure same as other menus to have consistent menu handling. This commit also simplifies the data->active handling when KEY_SPACE is pressed, and sizeof() parameter. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
8961e93e |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose append entry function Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use append_entry() and append_quit_entry() to construct the menu, so move them out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
a84040ab |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor file selection handling eficonfig_select_file_handler() is commonly used to select the file. eficonfig_display_select_file_option() adds an additional menu to clear the selected file. eficonfig_display_select_file_option() is not always necessary for the file selection process, so it must be outside of eficonfig_select_file_handler(). This commit also renames the following functions to avoid confusion. eficonfig_select_file_handler() -> eficonfig_process_select_file() eficonfig_select_file() -> eficonfig_show_file_selection() eficonfig_display_select_file_option() -> eficonfig_process_show_file_option() Finally, test_eficonfig.py need to be updated to get aligned with the above modification. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
1167e88a |
|
14-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix missing variable initialization The 'ret' variable must be initialized before use in eficonfig_delete_invalid_boot_option(). Fixes: c416f1c0bc ("bootmenu: add removable media entries") Addresses-Coverity: 376207 ("Uninitialized variables") Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
3d595ac5 |
|
09-Nov-2022 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: remove superfluous if in eficonfig_edit_boot_option Goto for an immediately succeeding label is superfluous. Fixes: 87d791423ac6 ("eficonfig: menu-driven addition of UEFI boot option") Addresses-Coverity: 376202 ("Identical code for different branches") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
140a8959 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use efi_get_next_variable_name_int() eficonfig command reads all possible UEFI load options from 0x0000 to 0xFFFF to construct the menu. This takes too much time in some environment. This commit uses efi_get_next_variable_name_int() to read all existing UEFI load options to significantlly reduce the count of efi_get_var() call. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
78b1ccc4 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use u16_strsize() to get u16 string buffer size Use u16_strsize() to simplify the u16 string buffer size calculation. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c67d3c9e |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix going one directory up issue The directory name in eficonfig menu entry contains the '\' separator. strcmp() argument ".." is wrong and one directory up handling does not work correctly. strcmp() argument must include '\' separator. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c3b5af63 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add UEFI Secure Boot Key enrollment interface This commit adds the menu-driven UEFI Secure Boot Key enrollment interface. User can enroll PK, KEK, db and dbx by selecting file. Only the signed EFI Signature List(s) with an authenticated header, typically '.auth' file, is accepted. To clear the PK, KEK, db and dbx, user needs to enroll the null key signed by PK or KEK. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
21faf4ef |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use protocol interface for file selection EFI_SIMPLE_FILE_SYSTEM_PROTOCOL is not always provided by U-Boot. Use protocol interface functions instead of U-Boot internal functions. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d6566113 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose eficonfig_create_device_path() Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use eficonfig_create_device_path() to construct the full device path from device path of the volume and file path, so move it out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d571f9b2 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation All the eficonfig menus other than "Change Boot Order" use 'eficonfig_entry' structure for each menu entry. This commit refactors change boot order implementation to use 'eficonfig_entry' structure same as other menus to have consistent menu handling. This commit also simplifies the data->active handling when KEY_SPACE is pressed, and sizeof() parameter. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
8961e93e |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose append entry function Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use append_entry() and append_quit_entry() to construct the menu, so move them out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
a84040ab |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor file selection handling eficonfig_select_file_handler() is commonly used to select the file. eficonfig_display_select_file_option() adds an additional menu to clear the selected file. eficonfig_display_select_file_option() is not always necessary for the file selection process, so it must be outside of eficonfig_select_file_handler(). This commit also renames the following functions to avoid confusion. eficonfig_select_file_handler() -> eficonfig_process_select_file() eficonfig_select_file() -> eficonfig_show_file_selection() eficonfig_display_select_file_option() -> eficonfig_process_show_file_option() Finally, test_eficonfig.py need to be updated to get aligned with the above modification. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
1167e88a |
|
14-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix missing variable initialization The 'ret' variable must be initialized before use in eficonfig_delete_invalid_boot_option(). Fixes: c416f1c0bc ("bootmenu: add removable media entries") Addresses-Coverity: 376207 ("Uninitialized variables") Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
3d595ac5 |
|
09-Nov-2022 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: remove superfluous if in eficonfig_edit_boot_option Goto for an immediately succeeding label is superfluous. Fixes: 87d791423ac6 ("eficonfig: menu-driven addition of UEFI boot option") Addresses-Coverity: 376202 ("Identical code for different branches") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
140a8959 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use efi_get_next_variable_name_int() eficonfig command reads all possible UEFI load options from 0x0000 to 0xFFFF to construct the menu. This takes too much time in some environment. This commit uses efi_get_next_variable_name_int() to read all existing UEFI load options to significantlly reduce the count of efi_get_var() call. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
78b1ccc4 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use u16_strsize() to get u16 string buffer size Use u16_strsize() to simplify the u16 string buffer size calculation. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c67d3c9e |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix going one directory up issue The directory name in eficonfig menu entry contains the '\' separator. strcmp() argument ".." is wrong and one directory up handling does not work correctly. strcmp() argument must include '\' separator. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c3b5af63 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add UEFI Secure Boot Key enrollment interface This commit adds the menu-driven UEFI Secure Boot Key enrollment interface. User can enroll PK, KEK, db and dbx by selecting file. Only the signed EFI Signature List(s) with an authenticated header, typically '.auth' file, is accepted. To clear the PK, KEK, db and dbx, user needs to enroll the null key signed by PK or KEK. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
21faf4ef |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use protocol interface for file selection EFI_SIMPLE_FILE_SYSTEM_PROTOCOL is not always provided by U-Boot. Use protocol interface functions instead of U-Boot internal functions. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d6566113 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose eficonfig_create_device_path() Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use eficonfig_create_device_path() to construct the full device path from device path of the volume and file path, so move it out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d571f9b2 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation All the eficonfig menus other than "Change Boot Order" use 'eficonfig_entry' structure for each menu entry. This commit refactors change boot order implementation to use 'eficonfig_entry' structure same as other menus to have consistent menu handling. This commit also simplifies the data->active handling when KEY_SPACE is pressed, and sizeof() parameter. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
8961e93e |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose append entry function Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use append_entry() and append_quit_entry() to construct the menu, so move them out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
a84040ab |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor file selection handling eficonfig_select_file_handler() is commonly used to select the file. eficonfig_display_select_file_option() adds an additional menu to clear the selected file. eficonfig_display_select_file_option() is not always necessary for the file selection process, so it must be outside of eficonfig_select_file_handler(). This commit also renames the following functions to avoid confusion. eficonfig_select_file_handler() -> eficonfig_process_select_file() eficonfig_select_file() -> eficonfig_show_file_selection() eficonfig_display_select_file_option() -> eficonfig_process_show_file_option() Finally, test_eficonfig.py need to be updated to get aligned with the above modification. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
1167e88a |
|
14-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix missing variable initialization The 'ret' variable must be initialized before use in eficonfig_delete_invalid_boot_option(). Fixes: c416f1c0bc ("bootmenu: add removable media entries") Addresses-Coverity: 376207 ("Uninitialized variables") Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
3d595ac5 |
|
09-Nov-2022 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: remove superfluous if in eficonfig_edit_boot_option Goto for an immediately succeeding label is superfluous. Fixes: 87d791423ac6 ("eficonfig: menu-driven addition of UEFI boot option") Addresses-Coverity: 376202 ("Identical code for different branches") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
140a8959 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use efi_get_next_variable_name_int() eficonfig command reads all possible UEFI load options from 0x0000 to 0xFFFF to construct the menu. This takes too much time in some environment. This commit uses efi_get_next_variable_name_int() to read all existing UEFI load options to significantlly reduce the count of efi_get_var() call. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
78b1ccc4 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use u16_strsize() to get u16 string buffer size Use u16_strsize() to simplify the u16 string buffer size calculation. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c67d3c9e |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix going one directory up issue The directory name in eficonfig menu entry contains the '\' separator. strcmp() argument ".." is wrong and one directory up handling does not work correctly. strcmp() argument must include '\' separator. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c3b5af63 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add UEFI Secure Boot Key enrollment interface This commit adds the menu-driven UEFI Secure Boot Key enrollment interface. User can enroll PK, KEK, db and dbx by selecting file. Only the signed EFI Signature List(s) with an authenticated header, typically '.auth' file, is accepted. To clear the PK, KEK, db and dbx, user needs to enroll the null key signed by PK or KEK. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
21faf4ef |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use protocol interface for file selection EFI_SIMPLE_FILE_SYSTEM_PROTOCOL is not always provided by U-Boot. Use protocol interface functions instead of U-Boot internal functions. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d6566113 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose eficonfig_create_device_path() Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use eficonfig_create_device_path() to construct the full device path from device path of the volume and file path, so move it out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d571f9b2 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation All the eficonfig menus other than "Change Boot Order" use 'eficonfig_entry' structure for each menu entry. This commit refactors change boot order implementation to use 'eficonfig_entry' structure same as other menus to have consistent menu handling. This commit also simplifies the data->active handling when KEY_SPACE is pressed, and sizeof() parameter. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
8961e93e |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose append entry function Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use append_entry() and append_quit_entry() to construct the menu, so move them out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
a84040ab |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor file selection handling eficonfig_select_file_handler() is commonly used to select the file. eficonfig_display_select_file_option() adds an additional menu to clear the selected file. eficonfig_display_select_file_option() is not always necessary for the file selection process, so it must be outside of eficonfig_select_file_handler(). This commit also renames the following functions to avoid confusion. eficonfig_select_file_handler() -> eficonfig_process_select_file() eficonfig_select_file() -> eficonfig_show_file_selection() eficonfig_display_select_file_option() -> eficonfig_process_show_file_option() Finally, test_eficonfig.py need to be updated to get aligned with the above modification. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
1167e88a |
|
14-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix missing variable initialization The 'ret' variable must be initialized before use in eficonfig_delete_invalid_boot_option(). Fixes: c416f1c0bc ("bootmenu: add removable media entries") Addresses-Coverity: 376207 ("Uninitialized variables") Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
3d595ac5 |
|
09-Nov-2022 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: remove superfluous if in eficonfig_edit_boot_option Goto for an immediately succeeding label is superfluous. Fixes: 87d791423ac6 ("eficonfig: menu-driven addition of UEFI boot option") Addresses-Coverity: 376202 ("Identical code for different branches") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
140a8959 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use efi_get_next_variable_name_int() eficonfig command reads all possible UEFI load options from 0x0000 to 0xFFFF to construct the menu. This takes too much time in some environment. This commit uses efi_get_next_variable_name_int() to read all existing UEFI load options to significantlly reduce the count of efi_get_var() call. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
78b1ccc4 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use u16_strsize() to get u16 string buffer size Use u16_strsize() to simplify the u16 string buffer size calculation. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c67d3c9e |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix going one directory up issue The directory name in eficonfig menu entry contains the '\' separator. strcmp() argument ".." is wrong and one directory up handling does not work correctly. strcmp() argument must include '\' separator. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c3b5af63 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add UEFI Secure Boot Key enrollment interface This commit adds the menu-driven UEFI Secure Boot Key enrollment interface. User can enroll PK, KEK, db and dbx by selecting file. Only the signed EFI Signature List(s) with an authenticated header, typically '.auth' file, is accepted. To clear the PK, KEK, db and dbx, user needs to enroll the null key signed by PK or KEK. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
21faf4ef |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use protocol interface for file selection EFI_SIMPLE_FILE_SYSTEM_PROTOCOL is not always provided by U-Boot. Use protocol interface functions instead of U-Boot internal functions. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d6566113 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose eficonfig_create_device_path() Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use eficonfig_create_device_path() to construct the full device path from device path of the volume and file path, so move it out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d571f9b2 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation All the eficonfig menus other than "Change Boot Order" use 'eficonfig_entry' structure for each menu entry. This commit refactors change boot order implementation to use 'eficonfig_entry' structure same as other menus to have consistent menu handling. This commit also simplifies the data->active handling when KEY_SPACE is pressed, and sizeof() parameter. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
8961e93e |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose append entry function Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use append_entry() and append_quit_entry() to construct the menu, so move them out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
a84040ab |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor file selection handling eficonfig_select_file_handler() is commonly used to select the file. eficonfig_display_select_file_option() adds an additional menu to clear the selected file. eficonfig_display_select_file_option() is not always necessary for the file selection process, so it must be outside of eficonfig_select_file_handler(). This commit also renames the following functions to avoid confusion. eficonfig_select_file_handler() -> eficonfig_process_select_file() eficonfig_select_file() -> eficonfig_show_file_selection() eficonfig_display_select_file_option() -> eficonfig_process_show_file_option() Finally, test_eficonfig.py need to be updated to get aligned with the above modification. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
1167e88a |
|
14-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix missing variable initialization The 'ret' variable must be initialized before use in eficonfig_delete_invalid_boot_option(). Fixes: c416f1c0bc ("bootmenu: add removable media entries") Addresses-Coverity: 376207 ("Uninitialized variables") Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
3d595ac5 |
|
09-Nov-2022 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: remove superfluous if in eficonfig_edit_boot_option Goto for an immediately succeeding label is superfluous. Fixes: 87d791423ac6 ("eficonfig: menu-driven addition of UEFI boot option") Addresses-Coverity: 376202 ("Identical code for different branches") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
140a8959 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use efi_get_next_variable_name_int() eficonfig command reads all possible UEFI load options from 0x0000 to 0xFFFF to construct the menu. This takes too much time in some environment. This commit uses efi_get_next_variable_name_int() to read all existing UEFI load options to significantlly reduce the count of efi_get_var() call. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
78b1ccc4 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use u16_strsize() to get u16 string buffer size Use u16_strsize() to simplify the u16 string buffer size calculation. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c67d3c9e |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix going one directory up issue The directory name in eficonfig menu entry contains the '\' separator. strcmp() argument ".." is wrong and one directory up handling does not work correctly. strcmp() argument must include '\' separator. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c3b5af63 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add UEFI Secure Boot Key enrollment interface This commit adds the menu-driven UEFI Secure Boot Key enrollment interface. User can enroll PK, KEK, db and dbx by selecting file. Only the signed EFI Signature List(s) with an authenticated header, typically '.auth' file, is accepted. To clear the PK, KEK, db and dbx, user needs to enroll the null key signed by PK or KEK. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
21faf4ef |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use protocol interface for file selection EFI_SIMPLE_FILE_SYSTEM_PROTOCOL is not always provided by U-Boot. Use protocol interface functions instead of U-Boot internal functions. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d6566113 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose eficonfig_create_device_path() Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use eficonfig_create_device_path() to construct the full device path from device path of the volume and file path, so move it out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d571f9b2 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation All the eficonfig menus other than "Change Boot Order" use 'eficonfig_entry' structure for each menu entry. This commit refactors change boot order implementation to use 'eficonfig_entry' structure same as other menus to have consistent menu handling. This commit also simplifies the data->active handling when KEY_SPACE is pressed, and sizeof() parameter. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
8961e93e |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose append entry function Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use append_entry() and append_quit_entry() to construct the menu, so move them out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
a84040ab |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor file selection handling eficonfig_select_file_handler() is commonly used to select the file. eficonfig_display_select_file_option() adds an additional menu to clear the selected file. eficonfig_display_select_file_option() is not always necessary for the file selection process, so it must be outside of eficonfig_select_file_handler(). This commit also renames the following functions to avoid confusion. eficonfig_select_file_handler() -> eficonfig_process_select_file() eficonfig_select_file() -> eficonfig_show_file_selection() eficonfig_display_select_file_option() -> eficonfig_process_show_file_option() Finally, test_eficonfig.py need to be updated to get aligned with the above modification. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
1167e88a |
|
14-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix missing variable initialization The 'ret' variable must be initialized before use in eficonfig_delete_invalid_boot_option(). Fixes: c416f1c0bc ("bootmenu: add removable media entries") Addresses-Coverity: 376207 ("Uninitialized variables") Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
3d595ac5 |
|
09-Nov-2022 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: remove superfluous if in eficonfig_edit_boot_option Goto for an immediately succeeding label is superfluous. Fixes: 87d791423ac6 ("eficonfig: menu-driven addition of UEFI boot option") Addresses-Coverity: 376202 ("Identical code for different branches") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
140a8959 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use efi_get_next_variable_name_int() eficonfig command reads all possible UEFI load options from 0x0000 to 0xFFFF to construct the menu. This takes too much time in some environment. This commit uses efi_get_next_variable_name_int() to read all existing UEFI load options to significantlly reduce the count of efi_get_var() call. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
78b1ccc4 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use u16_strsize() to get u16 string buffer size Use u16_strsize() to simplify the u16 string buffer size calculation. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c67d3c9e |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix going one directory up issue The directory name in eficonfig menu entry contains the '\' separator. strcmp() argument ".." is wrong and one directory up handling does not work correctly. strcmp() argument must include '\' separator. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c3b5af63 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add UEFI Secure Boot Key enrollment interface This commit adds the menu-driven UEFI Secure Boot Key enrollment interface. User can enroll PK, KEK, db and dbx by selecting file. Only the signed EFI Signature List(s) with an authenticated header, typically '.auth' file, is accepted. To clear the PK, KEK, db and dbx, user needs to enroll the null key signed by PK or KEK. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
21faf4ef |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use protocol interface for file selection EFI_SIMPLE_FILE_SYSTEM_PROTOCOL is not always provided by U-Boot. Use protocol interface functions instead of U-Boot internal functions. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d6566113 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose eficonfig_create_device_path() Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use eficonfig_create_device_path() to construct the full device path from device path of the volume and file path, so move it out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d571f9b2 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation All the eficonfig menus other than "Change Boot Order" use 'eficonfig_entry' structure for each menu entry. This commit refactors change boot order implementation to use 'eficonfig_entry' structure same as other menus to have consistent menu handling. This commit also simplifies the data->active handling when KEY_SPACE is pressed, and sizeof() parameter. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
8961e93e |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose append entry function Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use append_entry() and append_quit_entry() to construct the menu, so move them out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
a84040ab |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor file selection handling eficonfig_select_file_handler() is commonly used to select the file. eficonfig_display_select_file_option() adds an additional menu to clear the selected file. eficonfig_display_select_file_option() is not always necessary for the file selection process, so it must be outside of eficonfig_select_file_handler(). This commit also renames the following functions to avoid confusion. eficonfig_select_file_handler() -> eficonfig_process_select_file() eficonfig_select_file() -> eficonfig_show_file_selection() eficonfig_display_select_file_option() -> eficonfig_process_show_file_option() Finally, test_eficonfig.py need to be updated to get aligned with the above modification. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
1167e88a |
|
14-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix missing variable initialization The 'ret' variable must be initialized before use in eficonfig_delete_invalid_boot_option(). Fixes: c416f1c0bc ("bootmenu: add removable media entries") Addresses-Coverity: 376207 ("Uninitialized variables") Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
3d595ac5 |
|
09-Nov-2022 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: remove superfluous if in eficonfig_edit_boot_option Goto for an immediately succeeding label is superfluous. Fixes: 87d791423ac6 ("eficonfig: menu-driven addition of UEFI boot option") Addresses-Coverity: 376202 ("Identical code for different branches") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
140a8959 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use efi_get_next_variable_name_int() eficonfig command reads all possible UEFI load options from 0x0000 to 0xFFFF to construct the menu. This takes too much time in some environment. This commit uses efi_get_next_variable_name_int() to read all existing UEFI load options to significantlly reduce the count of efi_get_var() call. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
78b1ccc4 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use u16_strsize() to get u16 string buffer size Use u16_strsize() to simplify the u16 string buffer size calculation. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c67d3c9e |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix going one directory up issue The directory name in eficonfig menu entry contains the '\' separator. strcmp() argument ".." is wrong and one directory up handling does not work correctly. strcmp() argument must include '\' separator. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c3b5af63 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add UEFI Secure Boot Key enrollment interface This commit adds the menu-driven UEFI Secure Boot Key enrollment interface. User can enroll PK, KEK, db and dbx by selecting file. Only the signed EFI Signature List(s) with an authenticated header, typically '.auth' file, is accepted. To clear the PK, KEK, db and dbx, user needs to enroll the null key signed by PK or KEK. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
21faf4ef |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use protocol interface for file selection EFI_SIMPLE_FILE_SYSTEM_PROTOCOL is not always provided by U-Boot. Use protocol interface functions instead of U-Boot internal functions. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d6566113 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose eficonfig_create_device_path() Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use eficonfig_create_device_path() to construct the full device path from device path of the volume and file path, so move it out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d571f9b2 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation All the eficonfig menus other than "Change Boot Order" use 'eficonfig_entry' structure for each menu entry. This commit refactors change boot order implementation to use 'eficonfig_entry' structure same as other menus to have consistent menu handling. This commit also simplifies the data->active handling when KEY_SPACE is pressed, and sizeof() parameter. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
8961e93e |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose append entry function Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use append_entry() and append_quit_entry() to construct the menu, so move them out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
a84040ab |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor file selection handling eficonfig_select_file_handler() is commonly used to select the file. eficonfig_display_select_file_option() adds an additional menu to clear the selected file. eficonfig_display_select_file_option() is not always necessary for the file selection process, so it must be outside of eficonfig_select_file_handler(). This commit also renames the following functions to avoid confusion. eficonfig_select_file_handler() -> eficonfig_process_select_file() eficonfig_select_file() -> eficonfig_show_file_selection() eficonfig_display_select_file_option() -> eficonfig_process_show_file_option() Finally, test_eficonfig.py need to be updated to get aligned with the above modification. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
1167e88a |
|
14-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix missing variable initialization The 'ret' variable must be initialized before use in eficonfig_delete_invalid_boot_option(). Fixes: c416f1c0bc ("bootmenu: add removable media entries") Addresses-Coverity: 376207 ("Uninitialized variables") Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
3d595ac5 |
|
09-Nov-2022 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: remove superfluous if in eficonfig_edit_boot_option Goto for an immediately succeeding label is superfluous. Fixes: 87d791423ac6 ("eficonfig: menu-driven addition of UEFI boot option") Addresses-Coverity: 376202 ("Identical code for different branches") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
140a8959 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use efi_get_next_variable_name_int() eficonfig command reads all possible UEFI load options from 0x0000 to 0xFFFF to construct the menu. This takes too much time in some environment. This commit uses efi_get_next_variable_name_int() to read all existing UEFI load options to significantlly reduce the count of efi_get_var() call. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
78b1ccc4 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use u16_strsize() to get u16 string buffer size Use u16_strsize() to simplify the u16 string buffer size calculation. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c67d3c9e |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix going one directory up issue The directory name in eficonfig menu entry contains the '\' separator. strcmp() argument ".." is wrong and one directory up handling does not work correctly. strcmp() argument must include '\' separator. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c3b5af63 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add UEFI Secure Boot Key enrollment interface This commit adds the menu-driven UEFI Secure Boot Key enrollment interface. User can enroll PK, KEK, db and dbx by selecting file. Only the signed EFI Signature List(s) with an authenticated header, typically '.auth' file, is accepted. To clear the PK, KEK, db and dbx, user needs to enroll the null key signed by PK or KEK. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
21faf4ef |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use protocol interface for file selection EFI_SIMPLE_FILE_SYSTEM_PROTOCOL is not always provided by U-Boot. Use protocol interface functions instead of U-Boot internal functions. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d6566113 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose eficonfig_create_device_path() Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use eficonfig_create_device_path() to construct the full device path from device path of the volume and file path, so move it out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d571f9b2 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation All the eficonfig menus other than "Change Boot Order" use 'eficonfig_entry' structure for each menu entry. This commit refactors change boot order implementation to use 'eficonfig_entry' structure same as other menus to have consistent menu handling. This commit also simplifies the data->active handling when KEY_SPACE is pressed, and sizeof() parameter. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
8961e93e |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose append entry function Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use append_entry() and append_quit_entry() to construct the menu, so move them out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
a84040ab |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor file selection handling eficonfig_select_file_handler() is commonly used to select the file. eficonfig_display_select_file_option() adds an additional menu to clear the selected file. eficonfig_display_select_file_option() is not always necessary for the file selection process, so it must be outside of eficonfig_select_file_handler(). This commit also renames the following functions to avoid confusion. eficonfig_select_file_handler() -> eficonfig_process_select_file() eficonfig_select_file() -> eficonfig_show_file_selection() eficonfig_display_select_file_option() -> eficonfig_process_show_file_option() Finally, test_eficonfig.py need to be updated to get aligned with the above modification. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
1167e88a |
|
14-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix missing variable initialization The 'ret' variable must be initialized before use in eficonfig_delete_invalid_boot_option(). Fixes: c416f1c0bc ("bootmenu: add removable media entries") Addresses-Coverity: 376207 ("Uninitialized variables") Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
3d595ac5 |
|
09-Nov-2022 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: remove superfluous if in eficonfig_edit_boot_option Goto for an immediately succeeding label is superfluous. Fixes: 87d791423ac6 ("eficonfig: menu-driven addition of UEFI boot option") Addresses-Coverity: 376202 ("Identical code for different branches") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
140a8959 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use efi_get_next_variable_name_int() eficonfig command reads all possible UEFI load options from 0x0000 to 0xFFFF to construct the menu. This takes too much time in some environment. This commit uses efi_get_next_variable_name_int() to read all existing UEFI load options to significantlly reduce the count of efi_get_var() call. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
78b1ccc4 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use u16_strsize() to get u16 string buffer size Use u16_strsize() to simplify the u16 string buffer size calculation. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c67d3c9e |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix going one directory up issue The directory name in eficonfig menu entry contains the '\' separator. strcmp() argument ".." is wrong and one directory up handling does not work correctly. strcmp() argument must include '\' separator. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c3b5af63 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add UEFI Secure Boot Key enrollment interface This commit adds the menu-driven UEFI Secure Boot Key enrollment interface. User can enroll PK, KEK, db and dbx by selecting file. Only the signed EFI Signature List(s) with an authenticated header, typically '.auth' file, is accepted. To clear the PK, KEK, db and dbx, user needs to enroll the null key signed by PK or KEK. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
21faf4ef |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use protocol interface for file selection EFI_SIMPLE_FILE_SYSTEM_PROTOCOL is not always provided by U-Boot. Use protocol interface functions instead of U-Boot internal functions. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d6566113 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose eficonfig_create_device_path() Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use eficonfig_create_device_path() to construct the full device path from device path of the volume and file path, so move it out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d571f9b2 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation All the eficonfig menus other than "Change Boot Order" use 'eficonfig_entry' structure for each menu entry. This commit refactors change boot order implementation to use 'eficonfig_entry' structure same as other menus to have consistent menu handling. This commit also simplifies the data->active handling when KEY_SPACE is pressed, and sizeof() parameter. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
8961e93e |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose append entry function Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use append_entry() and append_quit_entry() to construct the menu, so move them out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
a84040ab |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor file selection handling eficonfig_select_file_handler() is commonly used to select the file. eficonfig_display_select_file_option() adds an additional menu to clear the selected file. eficonfig_display_select_file_option() is not always necessary for the file selection process, so it must be outside of eficonfig_select_file_handler(). This commit also renames the following functions to avoid confusion. eficonfig_select_file_handler() -> eficonfig_process_select_file() eficonfig_select_file() -> eficonfig_show_file_selection() eficonfig_display_select_file_option() -> eficonfig_process_show_file_option() Finally, test_eficonfig.py need to be updated to get aligned with the above modification. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
1167e88a |
|
14-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix missing variable initialization The 'ret' variable must be initialized before use in eficonfig_delete_invalid_boot_option(). Fixes: c416f1c0bc ("bootmenu: add removable media entries") Addresses-Coverity: 376207 ("Uninitialized variables") Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
3d595ac5 |
|
09-Nov-2022 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: remove superfluous if in eficonfig_edit_boot_option Goto for an immediately succeeding label is superfluous. Fixes: 87d791423ac6 ("eficonfig: menu-driven addition of UEFI boot option") Addresses-Coverity: 376202 ("Identical code for different branches") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
140a8959 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use efi_get_next_variable_name_int() eficonfig command reads all possible UEFI load options from 0x0000 to 0xFFFF to construct the menu. This takes too much time in some environment. This commit uses efi_get_next_variable_name_int() to read all existing UEFI load options to significantlly reduce the count of efi_get_var() call. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
78b1ccc4 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use u16_strsize() to get u16 string buffer size Use u16_strsize() to simplify the u16 string buffer size calculation. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c67d3c9e |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix going one directory up issue The directory name in eficonfig menu entry contains the '\' separator. strcmp() argument ".." is wrong and one directory up handling does not work correctly. strcmp() argument must include '\' separator. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c3b5af63 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add UEFI Secure Boot Key enrollment interface This commit adds the menu-driven UEFI Secure Boot Key enrollment interface. User can enroll PK, KEK, db and dbx by selecting file. Only the signed EFI Signature List(s) with an authenticated header, typically '.auth' file, is accepted. To clear the PK, KEK, db and dbx, user needs to enroll the null key signed by PK or KEK. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
21faf4ef |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use protocol interface for file selection EFI_SIMPLE_FILE_SYSTEM_PROTOCOL is not always provided by U-Boot. Use protocol interface functions instead of U-Boot internal functions. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d6566113 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose eficonfig_create_device_path() Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use eficonfig_create_device_path() to construct the full device path from device path of the volume and file path, so move it out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d571f9b2 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation All the eficonfig menus other than "Change Boot Order" use 'eficonfig_entry' structure for each menu entry. This commit refactors change boot order implementation to use 'eficonfig_entry' structure same as other menus to have consistent menu handling. This commit also simplifies the data->active handling when KEY_SPACE is pressed, and sizeof() parameter. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
8961e93e |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose append entry function Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use append_entry() and append_quit_entry() to construct the menu, so move them out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
a84040ab |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor file selection handling eficonfig_select_file_handler() is commonly used to select the file. eficonfig_display_select_file_option() adds an additional menu to clear the selected file. eficonfig_display_select_file_option() is not always necessary for the file selection process, so it must be outside of eficonfig_select_file_handler(). This commit also renames the following functions to avoid confusion. eficonfig_select_file_handler() -> eficonfig_process_select_file() eficonfig_select_file() -> eficonfig_show_file_selection() eficonfig_display_select_file_option() -> eficonfig_process_show_file_option() Finally, test_eficonfig.py need to be updated to get aligned with the above modification. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
1167e88a |
|
14-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix missing variable initialization The 'ret' variable must be initialized before use in eficonfig_delete_invalid_boot_option(). Fixes: c416f1c0bc ("bootmenu: add removable media entries") Addresses-Coverity: 376207 ("Uninitialized variables") Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
3d595ac5 |
|
09-Nov-2022 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: remove superfluous if in eficonfig_edit_boot_option Goto for an immediately succeeding label is superfluous. Fixes: 87d791423ac6 ("eficonfig: menu-driven addition of UEFI boot option") Addresses-Coverity: 376202 ("Identical code for different branches") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
140a8959 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use efi_get_next_variable_name_int() eficonfig command reads all possible UEFI load options from 0x0000 to 0xFFFF to construct the menu. This takes too much time in some environment. This commit uses efi_get_next_variable_name_int() to read all existing UEFI load options to significantlly reduce the count of efi_get_var() call. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
78b1ccc4 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use u16_strsize() to get u16 string buffer size Use u16_strsize() to simplify the u16 string buffer size calculation. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c67d3c9e |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix going one directory up issue The directory name in eficonfig menu entry contains the '\' separator. strcmp() argument ".." is wrong and one directory up handling does not work correctly. strcmp() argument must include '\' separator. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c3b5af63 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add UEFI Secure Boot Key enrollment interface This commit adds the menu-driven UEFI Secure Boot Key enrollment interface. User can enroll PK, KEK, db and dbx by selecting file. Only the signed EFI Signature List(s) with an authenticated header, typically '.auth' file, is accepted. To clear the PK, KEK, db and dbx, user needs to enroll the null key signed by PK or KEK. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
21faf4ef |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use protocol interface for file selection EFI_SIMPLE_FILE_SYSTEM_PROTOCOL is not always provided by U-Boot. Use protocol interface functions instead of U-Boot internal functions. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d6566113 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose eficonfig_create_device_path() Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use eficonfig_create_device_path() to construct the full device path from device path of the volume and file path, so move it out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d571f9b2 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation All the eficonfig menus other than "Change Boot Order" use 'eficonfig_entry' structure for each menu entry. This commit refactors change boot order implementation to use 'eficonfig_entry' structure same as other menus to have consistent menu handling. This commit also simplifies the data->active handling when KEY_SPACE is pressed, and sizeof() parameter. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
8961e93e |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose append entry function Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use append_entry() and append_quit_entry() to construct the menu, so move them out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
a84040ab |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor file selection handling eficonfig_select_file_handler() is commonly used to select the file. eficonfig_display_select_file_option() adds an additional menu to clear the selected file. eficonfig_display_select_file_option() is not always necessary for the file selection process, so it must be outside of eficonfig_select_file_handler(). This commit also renames the following functions to avoid confusion. eficonfig_select_file_handler() -> eficonfig_process_select_file() eficonfig_select_file() -> eficonfig_show_file_selection() eficonfig_display_select_file_option() -> eficonfig_process_show_file_option() Finally, test_eficonfig.py need to be updated to get aligned with the above modification. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
1167e88a |
|
14-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix missing variable initialization The 'ret' variable must be initialized before use in eficonfig_delete_invalid_boot_option(). Fixes: c416f1c0bc ("bootmenu: add removable media entries") Addresses-Coverity: 376207 ("Uninitialized variables") Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
3d595ac5 |
|
09-Nov-2022 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: remove superfluous if in eficonfig_edit_boot_option Goto for an immediately succeeding label is superfluous. Fixes: 87d791423ac6 ("eficonfig: menu-driven addition of UEFI boot option") Addresses-Coverity: 376202 ("Identical code for different branches") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
140a8959 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use efi_get_next_variable_name_int() eficonfig command reads all possible UEFI load options from 0x0000 to 0xFFFF to construct the menu. This takes too much time in some environment. This commit uses efi_get_next_variable_name_int() to read all existing UEFI load options to significantlly reduce the count of efi_get_var() call. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
78b1ccc4 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use u16_strsize() to get u16 string buffer size Use u16_strsize() to simplify the u16 string buffer size calculation. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c67d3c9e |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix going one directory up issue The directory name in eficonfig menu entry contains the '\' separator. strcmp() argument ".." is wrong and one directory up handling does not work correctly. strcmp() argument must include '\' separator. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c3b5af63 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add UEFI Secure Boot Key enrollment interface This commit adds the menu-driven UEFI Secure Boot Key enrollment interface. User can enroll PK, KEK, db and dbx by selecting file. Only the signed EFI Signature List(s) with an authenticated header, typically '.auth' file, is accepted. To clear the PK, KEK, db and dbx, user needs to enroll the null key signed by PK or KEK. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
21faf4ef |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use protocol interface for file selection EFI_SIMPLE_FILE_SYSTEM_PROTOCOL is not always provided by U-Boot. Use protocol interface functions instead of U-Boot internal functions. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d6566113 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose eficonfig_create_device_path() Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use eficonfig_create_device_path() to construct the full device path from device path of the volume and file path, so move it out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d571f9b2 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation All the eficonfig menus other than "Change Boot Order" use 'eficonfig_entry' structure for each menu entry. This commit refactors change boot order implementation to use 'eficonfig_entry' structure same as other menus to have consistent menu handling. This commit also simplifies the data->active handling when KEY_SPACE is pressed, and sizeof() parameter. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
8961e93e |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose append entry function Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use append_entry() and append_quit_entry() to construct the menu, so move them out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
a84040ab |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor file selection handling eficonfig_select_file_handler() is commonly used to select the file. eficonfig_display_select_file_option() adds an additional menu to clear the selected file. eficonfig_display_select_file_option() is not always necessary for the file selection process, so it must be outside of eficonfig_select_file_handler(). This commit also renames the following functions to avoid confusion. eficonfig_select_file_handler() -> eficonfig_process_select_file() eficonfig_select_file() -> eficonfig_show_file_selection() eficonfig_display_select_file_option() -> eficonfig_process_show_file_option() Finally, test_eficonfig.py need to be updated to get aligned with the above modification. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
1167e88a |
|
14-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix missing variable initialization The 'ret' variable must be initialized before use in eficonfig_delete_invalid_boot_option(). Fixes: c416f1c0bc ("bootmenu: add removable media entries") Addresses-Coverity: 376207 ("Uninitialized variables") Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
3d595ac5 |
|
09-Nov-2022 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: remove superfluous if in eficonfig_edit_boot_option Goto for an immediately succeeding label is superfluous. Fixes: 87d791423ac6 ("eficonfig: menu-driven addition of UEFI boot option") Addresses-Coverity: 376202 ("Identical code for different branches") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
140a8959 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use efi_get_next_variable_name_int() eficonfig command reads all possible UEFI load options from 0x0000 to 0xFFFF to construct the menu. This takes too much time in some environment. This commit uses efi_get_next_variable_name_int() to read all existing UEFI load options to significantlly reduce the count of efi_get_var() call. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
78b1ccc4 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use u16_strsize() to get u16 string buffer size Use u16_strsize() to simplify the u16 string buffer size calculation. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c67d3c9e |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix going one directory up issue The directory name in eficonfig menu entry contains the '\' separator. strcmp() argument ".." is wrong and one directory up handling does not work correctly. strcmp() argument must include '\' separator. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c3b5af63 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add UEFI Secure Boot Key enrollment interface This commit adds the menu-driven UEFI Secure Boot Key enrollment interface. User can enroll PK, KEK, db and dbx by selecting file. Only the signed EFI Signature List(s) with an authenticated header, typically '.auth' file, is accepted. To clear the PK, KEK, db and dbx, user needs to enroll the null key signed by PK or KEK. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
21faf4ef |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use protocol interface for file selection EFI_SIMPLE_FILE_SYSTEM_PROTOCOL is not always provided by U-Boot. Use protocol interface functions instead of U-Boot internal functions. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d6566113 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose eficonfig_create_device_path() Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use eficonfig_create_device_path() to construct the full device path from device path of the volume and file path, so move it out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d571f9b2 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation All the eficonfig menus other than "Change Boot Order" use 'eficonfig_entry' structure for each menu entry. This commit refactors change boot order implementation to use 'eficonfig_entry' structure same as other menus to have consistent menu handling. This commit also simplifies the data->active handling when KEY_SPACE is pressed, and sizeof() parameter. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
8961e93e |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose append entry function Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use append_entry() and append_quit_entry() to construct the menu, so move them out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
a84040ab |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor file selection handling eficonfig_select_file_handler() is commonly used to select the file. eficonfig_display_select_file_option() adds an additional menu to clear the selected file. eficonfig_display_select_file_option() is not always necessary for the file selection process, so it must be outside of eficonfig_select_file_handler(). This commit also renames the following functions to avoid confusion. eficonfig_select_file_handler() -> eficonfig_process_select_file() eficonfig_select_file() -> eficonfig_show_file_selection() eficonfig_display_select_file_option() -> eficonfig_process_show_file_option() Finally, test_eficonfig.py need to be updated to get aligned with the above modification. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
1167e88a |
|
14-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix missing variable initialization The 'ret' variable must be initialized before use in eficonfig_delete_invalid_boot_option(). Fixes: c416f1c0bc ("bootmenu: add removable media entries") Addresses-Coverity: 376207 ("Uninitialized variables") Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
3d595ac5 |
|
09-Nov-2022 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: remove superfluous if in eficonfig_edit_boot_option Goto for an immediately succeeding label is superfluous. Fixes: 87d791423ac6 ("eficonfig: menu-driven addition of UEFI boot option") Addresses-Coverity: 376202 ("Identical code for different branches") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
140a8959 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use efi_get_next_variable_name_int() eficonfig command reads all possible UEFI load options from 0x0000 to 0xFFFF to construct the menu. This takes too much time in some environment. This commit uses efi_get_next_variable_name_int() to read all existing UEFI load options to significantlly reduce the count of efi_get_var() call. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
78b1ccc4 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use u16_strsize() to get u16 string buffer size Use u16_strsize() to simplify the u16 string buffer size calculation. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c67d3c9e |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix going one directory up issue The directory name in eficonfig menu entry contains the '\' separator. strcmp() argument ".." is wrong and one directory up handling does not work correctly. strcmp() argument must include '\' separator. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c3b5af63 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add UEFI Secure Boot Key enrollment interface This commit adds the menu-driven UEFI Secure Boot Key enrollment interface. User can enroll PK, KEK, db and dbx by selecting file. Only the signed EFI Signature List(s) with an authenticated header, typically '.auth' file, is accepted. To clear the PK, KEK, db and dbx, user needs to enroll the null key signed by PK or KEK. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
21faf4ef |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use protocol interface for file selection EFI_SIMPLE_FILE_SYSTEM_PROTOCOL is not always provided by U-Boot. Use protocol interface functions instead of U-Boot internal functions. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d6566113 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose eficonfig_create_device_path() Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use eficonfig_create_device_path() to construct the full device path from device path of the volume and file path, so move it out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d571f9b2 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation All the eficonfig menus other than "Change Boot Order" use 'eficonfig_entry' structure for each menu entry. This commit refactors change boot order implementation to use 'eficonfig_entry' structure same as other menus to have consistent menu handling. This commit also simplifies the data->active handling when KEY_SPACE is pressed, and sizeof() parameter. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
8961e93e |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose append entry function Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use append_entry() and append_quit_entry() to construct the menu, so move them out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
a84040ab |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor file selection handling eficonfig_select_file_handler() is commonly used to select the file. eficonfig_display_select_file_option() adds an additional menu to clear the selected file. eficonfig_display_select_file_option() is not always necessary for the file selection process, so it must be outside of eficonfig_select_file_handler(). This commit also renames the following functions to avoid confusion. eficonfig_select_file_handler() -> eficonfig_process_select_file() eficonfig_select_file() -> eficonfig_show_file_selection() eficonfig_display_select_file_option() -> eficonfig_process_show_file_option() Finally, test_eficonfig.py need to be updated to get aligned with the above modification. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
1167e88a |
|
14-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix missing variable initialization The 'ret' variable must be initialized before use in eficonfig_delete_invalid_boot_option(). Fixes: c416f1c0bc ("bootmenu: add removable media entries") Addresses-Coverity: 376207 ("Uninitialized variables") Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
3d595ac5 |
|
09-Nov-2022 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: remove superfluous if in eficonfig_edit_boot_option Goto for an immediately succeeding label is superfluous. Fixes: 87d791423ac6 ("eficonfig: menu-driven addition of UEFI boot option") Addresses-Coverity: 376202 ("Identical code for different branches") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
140a8959 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use efi_get_next_variable_name_int() eficonfig command reads all possible UEFI load options from 0x0000 to 0xFFFF to construct the menu. This takes too much time in some environment. This commit uses efi_get_next_variable_name_int() to read all existing UEFI load options to significantlly reduce the count of efi_get_var() call. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
78b1ccc4 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use u16_strsize() to get u16 string buffer size Use u16_strsize() to simplify the u16 string buffer size calculation. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c67d3c9e |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix going one directory up issue The directory name in eficonfig menu entry contains the '\' separator. strcmp() argument ".." is wrong and one directory up handling does not work correctly. strcmp() argument must include '\' separator. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c3b5af63 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add UEFI Secure Boot Key enrollment interface This commit adds the menu-driven UEFI Secure Boot Key enrollment interface. User can enroll PK, KEK, db and dbx by selecting file. Only the signed EFI Signature List(s) with an authenticated header, typically '.auth' file, is accepted. To clear the PK, KEK, db and dbx, user needs to enroll the null key signed by PK or KEK. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
21faf4ef |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use protocol interface for file selection EFI_SIMPLE_FILE_SYSTEM_PROTOCOL is not always provided by U-Boot. Use protocol interface functions instead of U-Boot internal functions. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d6566113 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose eficonfig_create_device_path() Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use eficonfig_create_device_path() to construct the full device path from device path of the volume and file path, so move it out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d571f9b2 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation All the eficonfig menus other than "Change Boot Order" use 'eficonfig_entry' structure for each menu entry. This commit refactors change boot order implementation to use 'eficonfig_entry' structure same as other menus to have consistent menu handling. This commit also simplifies the data->active handling when KEY_SPACE is pressed, and sizeof() parameter. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
8961e93e |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose append entry function Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use append_entry() and append_quit_entry() to construct the menu, so move them out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
a84040ab |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor file selection handling eficonfig_select_file_handler() is commonly used to select the file. eficonfig_display_select_file_option() adds an additional menu to clear the selected file. eficonfig_display_select_file_option() is not always necessary for the file selection process, so it must be outside of eficonfig_select_file_handler(). This commit also renames the following functions to avoid confusion. eficonfig_select_file_handler() -> eficonfig_process_select_file() eficonfig_select_file() -> eficonfig_show_file_selection() eficonfig_display_select_file_option() -> eficonfig_process_show_file_option() Finally, test_eficonfig.py need to be updated to get aligned with the above modification. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
1167e88a |
|
14-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix missing variable initialization The 'ret' variable must be initialized before use in eficonfig_delete_invalid_boot_option(). Fixes: c416f1c0bc ("bootmenu: add removable media entries") Addresses-Coverity: 376207 ("Uninitialized variables") Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
3d595ac5 |
|
09-Nov-2022 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: remove superfluous if in eficonfig_edit_boot_option Goto for an immediately succeeding label is superfluous. Fixes: 87d791423ac6 ("eficonfig: menu-driven addition of UEFI boot option") Addresses-Coverity: 376202 ("Identical code for different branches") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
140a8959 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use efi_get_next_variable_name_int() eficonfig command reads all possible UEFI load options from 0x0000 to 0xFFFF to construct the menu. This takes too much time in some environment. This commit uses efi_get_next_variable_name_int() to read all existing UEFI load options to significantlly reduce the count of efi_get_var() call. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
78b1ccc4 |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use u16_strsize() to get u16 string buffer size Use u16_strsize() to simplify the u16 string buffer size calculation. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c67d3c9e |
|
01-Dec-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix going one directory up issue The directory name in eficonfig menu entry contains the '\' separator. strcmp() argument ".." is wrong and one directory up handling does not work correctly. strcmp() argument must include '\' separator. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
c3b5af63 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add UEFI Secure Boot Key enrollment interface This commit adds the menu-driven UEFI Secure Boot Key enrollment interface. User can enroll PK, KEK, db and dbx by selecting file. Only the signed EFI Signature List(s) with an authenticated header, typically '.auth' file, is accepted. To clear the PK, KEK, db and dbx, user needs to enroll the null key signed by PK or KEK. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
21faf4ef |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use protocol interface for file selection EFI_SIMPLE_FILE_SYSTEM_PROTOCOL is not always provided by U-Boot. Use protocol interface functions instead of U-Boot internal functions. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d6566113 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose eficonfig_create_device_path() Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use eficonfig_create_device_path() to construct the full device path from device path of the volume and file path, so move it out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d571f9b2 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation All the eficonfig menus other than "Change Boot Order" use 'eficonfig_entry' structure for each menu entry. This commit refactors change boot order implementation to use 'eficonfig_entry' structure same as other menus to have consistent menu handling. This commit also simplifies the data->active handling when KEY_SPACE is pressed, and sizeof() parameter. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
8961e93e |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose append entry function Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use append_entry() and append_quit_entry() to construct the menu, so move them out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
a84040ab |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor file selection handling eficonfig_select_file_handler() is commonly used to select the file. eficonfig_display_select_file_option() adds an additional menu to clear the selected file. eficonfig_display_select_file_option() is not always necessary for the file selection process, so it must be outside of eficonfig_select_file_handler(). This commit also renames the following functions to avoid confusion. eficonfig_select_file_handler() -> eficonfig_process_select_file() eficonfig_select_file() -> eficonfig_show_file_selection() eficonfig_display_select_file_option() -> eficonfig_process_show_file_option() Finally, test_eficonfig.py need to be updated to get aligned with the above modification. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
1167e88a |
|
14-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix missing variable initialization The 'ret' variable must be initialized before use in eficonfig_delete_invalid_boot_option(). Fixes: c416f1c0bc ("bootmenu: add removable media entries") Addresses-Coverity: 376207 ("Uninitialized variables") Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
3d595ac5 |
|
09-Nov-2022 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: remove superfluous if in eficonfig_edit_boot_option Goto for an immediately succeeding label is superfluous. Fixes: 87d791423ac6 ("eficonfig: menu-driven addition of UEFI boot option") Addresses-Coverity: 376202 ("Identical code for different branches") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c3b5af63 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add UEFI Secure Boot Key enrollment interface This commit adds the menu-driven UEFI Secure Boot Key enrollment interface. User can enroll PK, KEK, db and dbx by selecting file. Only the signed EFI Signature List(s) with an authenticated header, typically '.auth' file, is accepted. To clear the PK, KEK, db and dbx, user needs to enroll the null key signed by PK or KEK. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
21faf4ef |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use protocol interface for file selection EFI_SIMPLE_FILE_SYSTEM_PROTOCOL is not always provided by U-Boot. Use protocol interface functions instead of U-Boot internal functions. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d6566113 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose eficonfig_create_device_path() Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use eficonfig_create_device_path() to construct the full device path from device path of the volume and file path, so move it out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d571f9b2 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation All the eficonfig menus other than "Change Boot Order" use 'eficonfig_entry' structure for each menu entry. This commit refactors change boot order implementation to use 'eficonfig_entry' structure same as other menus to have consistent menu handling. This commit also simplifies the data->active handling when KEY_SPACE is pressed, and sizeof() parameter. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
8961e93e |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose append entry function Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use append_entry() and append_quit_entry() to construct the menu, so move them out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
a84040ab |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor file selection handling eficonfig_select_file_handler() is commonly used to select the file. eficonfig_display_select_file_option() adds an additional menu to clear the selected file. eficonfig_display_select_file_option() is not always necessary for the file selection process, so it must be outside of eficonfig_select_file_handler(). This commit also renames the following functions to avoid confusion. eficonfig_select_file_handler() -> eficonfig_process_select_file() eficonfig_select_file() -> eficonfig_show_file_selection() eficonfig_display_select_file_option() -> eficonfig_process_show_file_option() Finally, test_eficonfig.py need to be updated to get aligned with the above modification. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
1167e88a |
|
14-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix missing variable initialization The 'ret' variable must be initialized before use in eficonfig_delete_invalid_boot_option(). Fixes: c416f1c0bc ("bootmenu: add removable media entries") Addresses-Coverity: 376207 ("Uninitialized variables") Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
3d595ac5 |
|
09-Nov-2022 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: remove superfluous if in eficonfig_edit_boot_option Goto for an immediately succeeding label is superfluous. Fixes: 87d791423ac6 ("eficonfig: menu-driven addition of UEFI boot option") Addresses-Coverity: 376202 ("Identical code for different branches") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c3b5af63 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add UEFI Secure Boot Key enrollment interface This commit adds the menu-driven UEFI Secure Boot Key enrollment interface. User can enroll PK, KEK, db and dbx by selecting file. Only the signed EFI Signature List(s) with an authenticated header, typically '.auth' file, is accepted. To clear the PK, KEK, db and dbx, user needs to enroll the null key signed by PK or KEK. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
21faf4ef |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use protocol interface for file selection EFI_SIMPLE_FILE_SYSTEM_PROTOCOL is not always provided by U-Boot. Use protocol interface functions instead of U-Boot internal functions. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d6566113 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose eficonfig_create_device_path() Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use eficonfig_create_device_path() to construct the full device path from device path of the volume and file path, so move it out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d571f9b2 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation All the eficonfig menus other than "Change Boot Order" use 'eficonfig_entry' structure for each menu entry. This commit refactors change boot order implementation to use 'eficonfig_entry' structure same as other menus to have consistent menu handling. This commit also simplifies the data->active handling when KEY_SPACE is pressed, and sizeof() parameter. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
8961e93e |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose append entry function Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use append_entry() and append_quit_entry() to construct the menu, so move them out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
a84040ab |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor file selection handling eficonfig_select_file_handler() is commonly used to select the file. eficonfig_display_select_file_option() adds an additional menu to clear the selected file. eficonfig_display_select_file_option() is not always necessary for the file selection process, so it must be outside of eficonfig_select_file_handler(). This commit also renames the following functions to avoid confusion. eficonfig_select_file_handler() -> eficonfig_process_select_file() eficonfig_select_file() -> eficonfig_show_file_selection() eficonfig_display_select_file_option() -> eficonfig_process_show_file_option() Finally, test_eficonfig.py need to be updated to get aligned with the above modification. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
1167e88a |
|
14-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix missing variable initialization The 'ret' variable must be initialized before use in eficonfig_delete_invalid_boot_option(). Fixes: c416f1c0bc ("bootmenu: add removable media entries") Addresses-Coverity: 376207 ("Uninitialized variables") Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
3d595ac5 |
|
09-Nov-2022 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: remove superfluous if in eficonfig_edit_boot_option Goto for an immediately succeeding label is superfluous. Fixes: 87d791423ac6 ("eficonfig: menu-driven addition of UEFI boot option") Addresses-Coverity: 376202 ("Identical code for different branches") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c3b5af63 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add UEFI Secure Boot Key enrollment interface This commit adds the menu-driven UEFI Secure Boot Key enrollment interface. User can enroll PK, KEK, db and dbx by selecting file. Only the signed EFI Signature List(s) with an authenticated header, typically '.auth' file, is accepted. To clear the PK, KEK, db and dbx, user needs to enroll the null key signed by PK or KEK. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
21faf4ef |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use protocol interface for file selection EFI_SIMPLE_FILE_SYSTEM_PROTOCOL is not always provided by U-Boot. Use protocol interface functions instead of U-Boot internal functions. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d6566113 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose eficonfig_create_device_path() Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use eficonfig_create_device_path() to construct the full device path from device path of the volume and file path, so move it out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d571f9b2 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation All the eficonfig menus other than "Change Boot Order" use 'eficonfig_entry' structure for each menu entry. This commit refactors change boot order implementation to use 'eficonfig_entry' structure same as other menus to have consistent menu handling. This commit also simplifies the data->active handling when KEY_SPACE is pressed, and sizeof() parameter. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
8961e93e |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose append entry function Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use append_entry() and append_quit_entry() to construct the menu, so move them out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
a84040ab |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor file selection handling eficonfig_select_file_handler() is commonly used to select the file. eficonfig_display_select_file_option() adds an additional menu to clear the selected file. eficonfig_display_select_file_option() is not always necessary for the file selection process, so it must be outside of eficonfig_select_file_handler(). This commit also renames the following functions to avoid confusion. eficonfig_select_file_handler() -> eficonfig_process_select_file() eficonfig_select_file() -> eficonfig_show_file_selection() eficonfig_display_select_file_option() -> eficonfig_process_show_file_option() Finally, test_eficonfig.py need to be updated to get aligned with the above modification. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
1167e88a |
|
14-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix missing variable initialization The 'ret' variable must be initialized before use in eficonfig_delete_invalid_boot_option(). Fixes: c416f1c0bc ("bootmenu: add removable media entries") Addresses-Coverity: 376207 ("Uninitialized variables") Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
3d595ac5 |
|
09-Nov-2022 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: remove superfluous if in eficonfig_edit_boot_option Goto for an immediately succeeding label is superfluous. Fixes: 87d791423ac6 ("eficonfig: menu-driven addition of UEFI boot option") Addresses-Coverity: 376202 ("Identical code for different branches") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c3b5af63 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add UEFI Secure Boot Key enrollment interface This commit adds the menu-driven UEFI Secure Boot Key enrollment interface. User can enroll PK, KEK, db and dbx by selecting file. Only the signed EFI Signature List(s) with an authenticated header, typically '.auth' file, is accepted. To clear the PK, KEK, db and dbx, user needs to enroll the null key signed by PK or KEK. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
21faf4ef |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use protocol interface for file selection EFI_SIMPLE_FILE_SYSTEM_PROTOCOL is not always provided by U-Boot. Use protocol interface functions instead of U-Boot internal functions. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d6566113 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose eficonfig_create_device_path() Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use eficonfig_create_device_path() to construct the full device path from device path of the volume and file path, so move it out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d571f9b2 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation All the eficonfig menus other than "Change Boot Order" use 'eficonfig_entry' structure for each menu entry. This commit refactors change boot order implementation to use 'eficonfig_entry' structure same as other menus to have consistent menu handling. This commit also simplifies the data->active handling when KEY_SPACE is pressed, and sizeof() parameter. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
8961e93e |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose append entry function Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use append_entry() and append_quit_entry() to construct the menu, so move them out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
a84040ab |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor file selection handling eficonfig_select_file_handler() is commonly used to select the file. eficonfig_display_select_file_option() adds an additional menu to clear the selected file. eficonfig_display_select_file_option() is not always necessary for the file selection process, so it must be outside of eficonfig_select_file_handler(). This commit also renames the following functions to avoid confusion. eficonfig_select_file_handler() -> eficonfig_process_select_file() eficonfig_select_file() -> eficonfig_show_file_selection() eficonfig_display_select_file_option() -> eficonfig_process_show_file_option() Finally, test_eficonfig.py need to be updated to get aligned with the above modification. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
1167e88a |
|
14-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix missing variable initialization The 'ret' variable must be initialized before use in eficonfig_delete_invalid_boot_option(). Fixes: c416f1c0bc ("bootmenu: add removable media entries") Addresses-Coverity: 376207 ("Uninitialized variables") Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
3d595ac5 |
|
09-Nov-2022 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: remove superfluous if in eficonfig_edit_boot_option Goto for an immediately succeeding label is superfluous. Fixes: 87d791423ac6 ("eficonfig: menu-driven addition of UEFI boot option") Addresses-Coverity: 376202 ("Identical code for different branches") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c3b5af63 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add UEFI Secure Boot Key enrollment interface This commit adds the menu-driven UEFI Secure Boot Key enrollment interface. User can enroll PK, KEK, db and dbx by selecting file. Only the signed EFI Signature List(s) with an authenticated header, typically '.auth' file, is accepted. To clear the PK, KEK, db and dbx, user needs to enroll the null key signed by PK or KEK. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
21faf4ef |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use protocol interface for file selection EFI_SIMPLE_FILE_SYSTEM_PROTOCOL is not always provided by U-Boot. Use protocol interface functions instead of U-Boot internal functions. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d6566113 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose eficonfig_create_device_path() Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use eficonfig_create_device_path() to construct the full device path from device path of the volume and file path, so move it out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d571f9b2 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation All the eficonfig menus other than "Change Boot Order" use 'eficonfig_entry' structure for each menu entry. This commit refactors change boot order implementation to use 'eficonfig_entry' structure same as other menus to have consistent menu handling. This commit also simplifies the data->active handling when KEY_SPACE is pressed, and sizeof() parameter. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
8961e93e |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose append entry function Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use append_entry() and append_quit_entry() to construct the menu, so move them out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
a84040ab |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor file selection handling eficonfig_select_file_handler() is commonly used to select the file. eficonfig_display_select_file_option() adds an additional menu to clear the selected file. eficonfig_display_select_file_option() is not always necessary for the file selection process, so it must be outside of eficonfig_select_file_handler(). This commit also renames the following functions to avoid confusion. eficonfig_select_file_handler() -> eficonfig_process_select_file() eficonfig_select_file() -> eficonfig_show_file_selection() eficonfig_display_select_file_option() -> eficonfig_process_show_file_option() Finally, test_eficonfig.py need to be updated to get aligned with the above modification. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
1167e88a |
|
14-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix missing variable initialization The 'ret' variable must be initialized before use in eficonfig_delete_invalid_boot_option(). Fixes: c416f1c0bc ("bootmenu: add removable media entries") Addresses-Coverity: 376207 ("Uninitialized variables") Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
3d595ac5 |
|
09-Nov-2022 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: remove superfluous if in eficonfig_edit_boot_option Goto for an immediately succeeding label is superfluous. Fixes: 87d791423ac6 ("eficonfig: menu-driven addition of UEFI boot option") Addresses-Coverity: 376202 ("Identical code for different branches") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c3b5af63 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add UEFI Secure Boot Key enrollment interface This commit adds the menu-driven UEFI Secure Boot Key enrollment interface. User can enroll PK, KEK, db and dbx by selecting file. Only the signed EFI Signature List(s) with an authenticated header, typically '.auth' file, is accepted. To clear the PK, KEK, db and dbx, user needs to enroll the null key signed by PK or KEK. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
21faf4ef |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use protocol interface for file selection EFI_SIMPLE_FILE_SYSTEM_PROTOCOL is not always provided by U-Boot. Use protocol interface functions instead of U-Boot internal functions. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d6566113 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose eficonfig_create_device_path() Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use eficonfig_create_device_path() to construct the full device path from device path of the volume and file path, so move it out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d571f9b2 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation All the eficonfig menus other than "Change Boot Order" use 'eficonfig_entry' structure for each menu entry. This commit refactors change boot order implementation to use 'eficonfig_entry' structure same as other menus to have consistent menu handling. This commit also simplifies the data->active handling when KEY_SPACE is pressed, and sizeof() parameter. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
8961e93e |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose append entry function Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use append_entry() and append_quit_entry() to construct the menu, so move them out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
a84040ab |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor file selection handling eficonfig_select_file_handler() is commonly used to select the file. eficonfig_display_select_file_option() adds an additional menu to clear the selected file. eficonfig_display_select_file_option() is not always necessary for the file selection process, so it must be outside of eficonfig_select_file_handler(). This commit also renames the following functions to avoid confusion. eficonfig_select_file_handler() -> eficonfig_process_select_file() eficonfig_select_file() -> eficonfig_show_file_selection() eficonfig_display_select_file_option() -> eficonfig_process_show_file_option() Finally, test_eficonfig.py need to be updated to get aligned with the above modification. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
1167e88a |
|
14-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix missing variable initialization The 'ret' variable must be initialized before use in eficonfig_delete_invalid_boot_option(). Fixes: c416f1c0bc ("bootmenu: add removable media entries") Addresses-Coverity: 376207 ("Uninitialized variables") Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
3d595ac5 |
|
09-Nov-2022 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: remove superfluous if in eficonfig_edit_boot_option Goto for an immediately succeeding label is superfluous. Fixes: 87d791423ac6 ("eficonfig: menu-driven addition of UEFI boot option") Addresses-Coverity: 376202 ("Identical code for different branches") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c3b5af63 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add UEFI Secure Boot Key enrollment interface This commit adds the menu-driven UEFI Secure Boot Key enrollment interface. User can enroll PK, KEK, db and dbx by selecting file. Only the signed EFI Signature List(s) with an authenticated header, typically '.auth' file, is accepted. To clear the PK, KEK, db and dbx, user needs to enroll the null key signed by PK or KEK. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
21faf4ef |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use protocol interface for file selection EFI_SIMPLE_FILE_SYSTEM_PROTOCOL is not always provided by U-Boot. Use protocol interface functions instead of U-Boot internal functions. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d6566113 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose eficonfig_create_device_path() Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use eficonfig_create_device_path() to construct the full device path from device path of the volume and file path, so move it out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d571f9b2 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation All the eficonfig menus other than "Change Boot Order" use 'eficonfig_entry' structure for each menu entry. This commit refactors change boot order implementation to use 'eficonfig_entry' structure same as other menus to have consistent menu handling. This commit also simplifies the data->active handling when KEY_SPACE is pressed, and sizeof() parameter. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
8961e93e |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose append entry function Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use append_entry() and append_quit_entry() to construct the menu, so move them out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
a84040ab |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor file selection handling eficonfig_select_file_handler() is commonly used to select the file. eficonfig_display_select_file_option() adds an additional menu to clear the selected file. eficonfig_display_select_file_option() is not always necessary for the file selection process, so it must be outside of eficonfig_select_file_handler(). This commit also renames the following functions to avoid confusion. eficonfig_select_file_handler() -> eficonfig_process_select_file() eficonfig_select_file() -> eficonfig_show_file_selection() eficonfig_display_select_file_option() -> eficonfig_process_show_file_option() Finally, test_eficonfig.py need to be updated to get aligned with the above modification. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
1167e88a |
|
14-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix missing variable initialization The 'ret' variable must be initialized before use in eficonfig_delete_invalid_boot_option(). Fixes: c416f1c0bc ("bootmenu: add removable media entries") Addresses-Coverity: 376207 ("Uninitialized variables") Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
3d595ac5 |
|
09-Nov-2022 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: remove superfluous if in eficonfig_edit_boot_option Goto for an immediately succeeding label is superfluous. Fixes: 87d791423ac6 ("eficonfig: menu-driven addition of UEFI boot option") Addresses-Coverity: 376202 ("Identical code for different branches") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c3b5af63 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add UEFI Secure Boot Key enrollment interface This commit adds the menu-driven UEFI Secure Boot Key enrollment interface. User can enroll PK, KEK, db and dbx by selecting file. Only the signed EFI Signature List(s) with an authenticated header, typically '.auth' file, is accepted. To clear the PK, KEK, db and dbx, user needs to enroll the null key signed by PK or KEK. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
21faf4ef |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use protocol interface for file selection EFI_SIMPLE_FILE_SYSTEM_PROTOCOL is not always provided by U-Boot. Use protocol interface functions instead of U-Boot internal functions. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d6566113 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose eficonfig_create_device_path() Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use eficonfig_create_device_path() to construct the full device path from device path of the volume and file path, so move it out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d571f9b2 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation All the eficonfig menus other than "Change Boot Order" use 'eficonfig_entry' structure for each menu entry. This commit refactors change boot order implementation to use 'eficonfig_entry' structure same as other menus to have consistent menu handling. This commit also simplifies the data->active handling when KEY_SPACE is pressed, and sizeof() parameter. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
8961e93e |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose append entry function Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use append_entry() and append_quit_entry() to construct the menu, so move them out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
a84040ab |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor file selection handling eficonfig_select_file_handler() is commonly used to select the file. eficonfig_display_select_file_option() adds an additional menu to clear the selected file. eficonfig_display_select_file_option() is not always necessary for the file selection process, so it must be outside of eficonfig_select_file_handler(). This commit also renames the following functions to avoid confusion. eficonfig_select_file_handler() -> eficonfig_process_select_file() eficonfig_select_file() -> eficonfig_show_file_selection() eficonfig_display_select_file_option() -> eficonfig_process_show_file_option() Finally, test_eficonfig.py need to be updated to get aligned with the above modification. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
1167e88a |
|
14-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix missing variable initialization The 'ret' variable must be initialized before use in eficonfig_delete_invalid_boot_option(). Fixes: c416f1c0bc ("bootmenu: add removable media entries") Addresses-Coverity: 376207 ("Uninitialized variables") Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
3d595ac5 |
|
09-Nov-2022 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: remove superfluous if in eficonfig_edit_boot_option Goto for an immediately succeeding label is superfluous. Fixes: 87d791423ac6 ("eficonfig: menu-driven addition of UEFI boot option") Addresses-Coverity: 376202 ("Identical code for different branches") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c3b5af63 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add UEFI Secure Boot Key enrollment interface This commit adds the menu-driven UEFI Secure Boot Key enrollment interface. User can enroll PK, KEK, db and dbx by selecting file. Only the signed EFI Signature List(s) with an authenticated header, typically '.auth' file, is accepted. To clear the PK, KEK, db and dbx, user needs to enroll the null key signed by PK or KEK. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
21faf4ef |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use protocol interface for file selection EFI_SIMPLE_FILE_SYSTEM_PROTOCOL is not always provided by U-Boot. Use protocol interface functions instead of U-Boot internal functions. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d6566113 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose eficonfig_create_device_path() Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use eficonfig_create_device_path() to construct the full device path from device path of the volume and file path, so move it out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d571f9b2 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation All the eficonfig menus other than "Change Boot Order" use 'eficonfig_entry' structure for each menu entry. This commit refactors change boot order implementation to use 'eficonfig_entry' structure same as other menus to have consistent menu handling. This commit also simplifies the data->active handling when KEY_SPACE is pressed, and sizeof() parameter. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
8961e93e |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose append entry function Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use append_entry() and append_quit_entry() to construct the menu, so move them out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
a84040ab |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor file selection handling eficonfig_select_file_handler() is commonly used to select the file. eficonfig_display_select_file_option() adds an additional menu to clear the selected file. eficonfig_display_select_file_option() is not always necessary for the file selection process, so it must be outside of eficonfig_select_file_handler(). This commit also renames the following functions to avoid confusion. eficonfig_select_file_handler() -> eficonfig_process_select_file() eficonfig_select_file() -> eficonfig_show_file_selection() eficonfig_display_select_file_option() -> eficonfig_process_show_file_option() Finally, test_eficonfig.py need to be updated to get aligned with the above modification. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
1167e88a |
|
14-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix missing variable initialization The 'ret' variable must be initialized before use in eficonfig_delete_invalid_boot_option(). Fixes: c416f1c0bc ("bootmenu: add removable media entries") Addresses-Coverity: 376207 ("Uninitialized variables") Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
3d595ac5 |
|
09-Nov-2022 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: remove superfluous if in eficonfig_edit_boot_option Goto for an immediately succeeding label is superfluous. Fixes: 87d791423ac6 ("eficonfig: menu-driven addition of UEFI boot option") Addresses-Coverity: 376202 ("Identical code for different branches") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c3b5af63 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add UEFI Secure Boot Key enrollment interface This commit adds the menu-driven UEFI Secure Boot Key enrollment interface. User can enroll PK, KEK, db and dbx by selecting file. Only the signed EFI Signature List(s) with an authenticated header, typically '.auth' file, is accepted. To clear the PK, KEK, db and dbx, user needs to enroll the null key signed by PK or KEK. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
21faf4ef |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use protocol interface for file selection EFI_SIMPLE_FILE_SYSTEM_PROTOCOL is not always provided by U-Boot. Use protocol interface functions instead of U-Boot internal functions. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d6566113 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose eficonfig_create_device_path() Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use eficonfig_create_device_path() to construct the full device path from device path of the volume and file path, so move it out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d571f9b2 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation All the eficonfig menus other than "Change Boot Order" use 'eficonfig_entry' structure for each menu entry. This commit refactors change boot order implementation to use 'eficonfig_entry' structure same as other menus to have consistent menu handling. This commit also simplifies the data->active handling when KEY_SPACE is pressed, and sizeof() parameter. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
8961e93e |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose append entry function Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use append_entry() and append_quit_entry() to construct the menu, so move them out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
a84040ab |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor file selection handling eficonfig_select_file_handler() is commonly used to select the file. eficonfig_display_select_file_option() adds an additional menu to clear the selected file. eficonfig_display_select_file_option() is not always necessary for the file selection process, so it must be outside of eficonfig_select_file_handler(). This commit also renames the following functions to avoid confusion. eficonfig_select_file_handler() -> eficonfig_process_select_file() eficonfig_select_file() -> eficonfig_show_file_selection() eficonfig_display_select_file_option() -> eficonfig_process_show_file_option() Finally, test_eficonfig.py need to be updated to get aligned with the above modification. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
1167e88a |
|
14-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix missing variable initialization The 'ret' variable must be initialized before use in eficonfig_delete_invalid_boot_option(). Fixes: c416f1c0bc ("bootmenu: add removable media entries") Addresses-Coverity: 376207 ("Uninitialized variables") Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
3d595ac5 |
|
09-Nov-2022 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: remove superfluous if in eficonfig_edit_boot_option Goto for an immediately succeeding label is superfluous. Fixes: 87d791423ac6 ("eficonfig: menu-driven addition of UEFI boot option") Addresses-Coverity: 376202 ("Identical code for different branches") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c3b5af63 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add UEFI Secure Boot Key enrollment interface This commit adds the menu-driven UEFI Secure Boot Key enrollment interface. User can enroll PK, KEK, db and dbx by selecting file. Only the signed EFI Signature List(s) with an authenticated header, typically '.auth' file, is accepted. To clear the PK, KEK, db and dbx, user needs to enroll the null key signed by PK or KEK. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
21faf4ef |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use protocol interface for file selection EFI_SIMPLE_FILE_SYSTEM_PROTOCOL is not always provided by U-Boot. Use protocol interface functions instead of U-Boot internal functions. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d6566113 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose eficonfig_create_device_path() Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use eficonfig_create_device_path() to construct the full device path from device path of the volume and file path, so move it out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d571f9b2 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation All the eficonfig menus other than "Change Boot Order" use 'eficonfig_entry' structure for each menu entry. This commit refactors change boot order implementation to use 'eficonfig_entry' structure same as other menus to have consistent menu handling. This commit also simplifies the data->active handling when KEY_SPACE is pressed, and sizeof() parameter. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
8961e93e |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose append entry function Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use append_entry() and append_quit_entry() to construct the menu, so move them out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
a84040ab |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor file selection handling eficonfig_select_file_handler() is commonly used to select the file. eficonfig_display_select_file_option() adds an additional menu to clear the selected file. eficonfig_display_select_file_option() is not always necessary for the file selection process, so it must be outside of eficonfig_select_file_handler(). This commit also renames the following functions to avoid confusion. eficonfig_select_file_handler() -> eficonfig_process_select_file() eficonfig_select_file() -> eficonfig_show_file_selection() eficonfig_display_select_file_option() -> eficonfig_process_show_file_option() Finally, test_eficonfig.py need to be updated to get aligned with the above modification. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
1167e88a |
|
14-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix missing variable initialization The 'ret' variable must be initialized before use in eficonfig_delete_invalid_boot_option(). Fixes: c416f1c0bc ("bootmenu: add removable media entries") Addresses-Coverity: 376207 ("Uninitialized variables") Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
3d595ac5 |
|
09-Nov-2022 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: remove superfluous if in eficonfig_edit_boot_option Goto for an immediately succeeding label is superfluous. Fixes: 87d791423ac6 ("eficonfig: menu-driven addition of UEFI boot option") Addresses-Coverity: 376202 ("Identical code for different branches") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c3b5af63 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add UEFI Secure Boot Key enrollment interface This commit adds the menu-driven UEFI Secure Boot Key enrollment interface. User can enroll PK, KEK, db and dbx by selecting file. Only the signed EFI Signature List(s) with an authenticated header, typically '.auth' file, is accepted. To clear the PK, KEK, db and dbx, user needs to enroll the null key signed by PK or KEK. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
21faf4ef |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: use protocol interface for file selection EFI_SIMPLE_FILE_SYSTEM_PROTOCOL is not always provided by U-Boot. Use protocol interface functions instead of U-Boot internal functions. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d6566113 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose eficonfig_create_device_path() Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use eficonfig_create_device_path() to construct the full device path from device path of the volume and file path, so move it out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
d571f9b2 |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor change boot order implementation All the eficonfig menus other than "Change Boot Order" use 'eficonfig_entry' structure for each menu entry. This commit refactors change boot order implementation to use 'eficonfig_entry' structure same as other menus to have consistent menu handling. This commit also simplifies the data->active handling when KEY_SPACE is pressed, and sizeof() parameter. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
8961e93e |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: expose append entry function Following commits are adding support for UEFI variable management via the eficonfig menu. Those functions needs to use append_entry() and append_quit_entry() to construct the menu, so move them out of their static declarations. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
a84040ab |
|
19-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: refactor file selection handling eficonfig_select_file_handler() is commonly used to select the file. eficonfig_display_select_file_option() adds an additional menu to clear the selected file. eficonfig_display_select_file_option() is not always necessary for the file selection process, so it must be outside of eficonfig_select_file_handler(). This commit also renames the following functions to avoid confusion. eficonfig_select_file_handler() -> eficonfig_process_select_file() eficonfig_select_file() -> eficonfig_show_file_selection() eficonfig_display_select_file_option() -> eficonfig_process_show_file_option() Finally, test_eficonfig.py need to be updated to get aligned with the above modification. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
1167e88a |
|
14-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix missing variable initialization The 'ret' variable must be initialized before use in eficonfig_delete_invalid_boot_option(). Fixes: c416f1c0bc ("bootmenu: add removable media entries") Addresses-Coverity: 376207 ("Uninitialized variables") Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
3d595ac5 |
|
09-Nov-2022 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: remove superfluous if in eficonfig_edit_boot_option Goto for an immediately succeeding label is superfluous. Fixes: 87d791423ac6 ("eficonfig: menu-driven addition of UEFI boot option") Addresses-Coverity: 376202 ("Identical code for different branches") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
1167e88a |
|
14-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix missing variable initialization The 'ret' variable must be initialized before use in eficonfig_delete_invalid_boot_option(). Fixes: c416f1c0bc ("bootmenu: add removable media entries") Addresses-Coverity: 376207 ("Uninitialized variables") Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
3d595ac5 |
|
09-Nov-2022 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: remove superfluous if in eficonfig_edit_boot_option Goto for an immediately succeeding label is superfluous. Fixes: 87d791423ac6 ("eficonfig: menu-driven addition of UEFI boot option") Addresses-Coverity: 376202 ("Identical code for different branches") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
1167e88a |
|
14-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix missing variable initialization The 'ret' variable must be initialized before use in eficonfig_delete_invalid_boot_option(). Fixes: c416f1c0bc ("bootmenu: add removable media entries") Addresses-Coverity: 376207 ("Uninitialized variables") Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
3d595ac5 |
|
09-Nov-2022 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: remove superfluous if in eficonfig_edit_boot_option Goto for an immediately succeeding label is superfluous. Fixes: 87d791423ac6 ("eficonfig: menu-driven addition of UEFI boot option") Addresses-Coverity: 376202 ("Identical code for different branches") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
1167e88a |
|
14-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix missing variable initialization The 'ret' variable must be initialized before use in eficonfig_delete_invalid_boot_option(). Fixes: c416f1c0bc ("bootmenu: add removable media entries") Addresses-Coverity: 376207 ("Uninitialized variables") Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
3d595ac5 |
|
09-Nov-2022 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: remove superfluous if in eficonfig_edit_boot_option Goto for an immediately succeeding label is superfluous. Fixes: 87d791423ac6 ("eficonfig: menu-driven addition of UEFI boot option") Addresses-Coverity: 376202 ("Identical code for different branches") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
1167e88a |
|
14-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix missing variable initialization The 'ret' variable must be initialized before use in eficonfig_delete_invalid_boot_option(). Fixes: c416f1c0bc ("bootmenu: add removable media entries") Addresses-Coverity: 376207 ("Uninitialized variables") Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
3d595ac5 |
|
09-Nov-2022 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: remove superfluous if in eficonfig_edit_boot_option Goto for an immediately succeeding label is superfluous. Fixes: 87d791423ac6 ("eficonfig: menu-driven addition of UEFI boot option") Addresses-Coverity: 376202 ("Identical code for different branches") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
1167e88a |
|
14-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix missing variable initialization The 'ret' variable must be initialized before use in eficonfig_delete_invalid_boot_option(). Fixes: c416f1c0bc ("bootmenu: add removable media entries") Addresses-Coverity: 376207 ("Uninitialized variables") Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
3d595ac5 |
|
09-Nov-2022 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: remove superfluous if in eficonfig_edit_boot_option Goto for an immediately succeeding label is superfluous. Fixes: 87d791423ac6 ("eficonfig: menu-driven addition of UEFI boot option") Addresses-Coverity: 376202 ("Identical code for different branches") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
1167e88a |
|
14-Nov-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: fix missing variable initialization The 'ret' variable must be initialized before use in eficonfig_delete_invalid_boot_option(). Fixes: c416f1c0bc ("bootmenu: add removable media entries") Addresses-Coverity: 376207 ("Uninitialized variables") Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
3d595ac5 |
|
09-Nov-2022 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
cmd: remove superfluous if in eficonfig_edit_boot_option Goto for an immediately succeeding label is superfluous. Fixes: 87d791423ac6 ("eficonfig: menu-driven addition of UEFI boot option") Addresses-Coverity: 376202 ("Identical code for different branches") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e5948ee3 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Change Boot Order" menu entry This commit adds the menu entry to update UEFI BootOrder variable. User moves the entry with UP/DOWN key, changes the order with PLUS/MINUS key, press SPACE to activate or deactivate the entry, then finalizes the order by ENTER key. If the entry is activated, the boot index is added into the BootOrder variable in the order of the list. The U-Boot menu framework is well designed for static menu, this commit implements the own menu display and key handling for dynamically change the order of menu entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
b5135a1e |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: scan media device in eficonfig startup In eficonfig startup, scan media devices and update the UEFI boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
c416f1c0 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
bootmenu: add removable media entries UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
bb8498aa |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Delete Boot Option" menu entry This commit adds the menu entry to delete the UEFI boot option. User moves the entry with UP/DOWN key, changes, then presses ENTER key to delete the selected boot option. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
e34158bc |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: add "Edit Boot Option" menu entry This commit adds the menu entry to edit the existing BOOT#### variable contents. User selects the item from the boot option list, then user can edit the description, file path and optional_data. Note that automatically generated boot option entry by bootmenu to support the removable media device is filtered out and user can not edit the automatically generated entry. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|
#
87d79142 |
|
12-Sep-2022 |
Masahisa Kojima <masahisa.kojima@linaro.org> |
eficonfig: menu-driven addition of UEFI boot option This commit add the "eficonfig" command. The "eficonfig" command implements the menu-driven UEFI boot option maintenance feature. This commit implements the addition of new boot option. User can select the block device volume having efi_simple_file_system_protocol and select the file corresponding to the Boot#### variable. User can also enter the description and optional_data of the BOOT#### variable in utf8. This commit adds "include/efi_config.h", it contains the common definition to be used from other menus such as UEFI Secure Boot key management. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
|