summaryrefslogtreecommitdiff
path: root/boot/bootflow_menu.c
AgeCommit message (Collapse)Author
2025-05-30expo: Drop the special theme code for bootflow_menuSimon Glass
The expo now has all that is needed to apply a suitable theme, so drop this unnecessary code. Any further tweaks can be added to the generic expo code. Signed-off-by: Simon Glass <[email protected]>
2025-05-30expo: Set up menu fully in bootflow_menu_start()Simon Glass
Apply the theme, calculate dimensions, highlight the menu and arrange the scene correctly, so that everything is ready to go when the expo is rendered. Signed-off-by: Simon Glass <[email protected]>
2025-05-30expo: Split setting up the menu from adding itemsSimon Glass
Some callers may wish to add items later as they are discovered. Split the setup code into its own function, to permit this. Signed-off-by: Simon Glass <[email protected]>
2025-05-30expo: Update bootflow_menu_poll() to return a sequence IDSimon Glass
Rather than returning a bootflow, return the index of the bootflow. This will allow callers to do their own translation to bootflows or some other data structure. Also return a special code when the user tries to move the pointer, so that the caller can cancel the boot-menu timeout, if this is in use. Signed-off-by: Simon Glass <[email protected]>
2025-05-30expo: Improve the visual appearance of the menuSimon Glass
The menu is currently quite basic. Make use of some recently added features in expo, to: - Show proper prompts - Highlight the current item - Centre text - Use multi-line text instead of two independent lines - Put a box around the items Signed-off-by: Simon Glass <[email protected]>
2025-05-30expo: Drop the gap between groups of menu itemsSimon Glass
The gap is intended to separate options which are on different bootdevs, but most of the time there is only one. So drop this gap. Keep the code around in case it becomes useful to have it in the style, or based on some other mechanism. Signed-off-by: Simon Glass <[email protected]>
2025-05-30expo: Use a simpler name for USB mediaSimon Glass
For USB devices we use the string 'usb_mass_storage' which is a bit verbose. Use 'USB' instead. Signed-off-by: Simon Glass <[email protected]>
2025-05-30expo: Support rendering multiple lines of textSimon Glass
Use the measurement info to write each line of text separately, thus respecting word-wrapping and newlines. Fix up the comment for scene_obj_render() while we are here. Since a lineedit does not support alignment, add a special case to just display the text if there is no measurement. This happens assuming the lineedit is initially empty. Signed-off-by: Simon Glass <[email protected]>
2025-05-30expo: Allow adding a single bootflow to a menuSimon Glass
Refactor bootflow_menu_add_all() to call a new bootflow_menu_add() to add each of its bootflows. Move the last_bootdev value into struct menu_priv to make this work. Signed-off-by: Simon Glass <[email protected]>
2025-05-30expo: Split bootflow_menu_new() into two piecesSimon Glass
Split the iteration piece of this function into bootflow_menu_add_all() so that it is possible for the caller to be in control of adding items to the menu. Move the expo_destroy() call into the caller. Signed-off-by: Simon Glass <[email protected]>
2025-05-30expo: Split bootflow_menu_run() into two piecesSimon Glass
Split the starting piece of this function into bootflow_menu_start() and the polling part into bootflow_menu_poll() so that it is possible for the caller to be in control of the event loop. Move the expo_destroy() call into the caller. Signed-off-by: Simon Glass <[email protected]>
2025-05-30expo: Adjust how menu items are highlightedSimon Glass
At present when the user moves to a new menu item, the menu code handles this immediately. This means it is not possible to use an expo action to effect the same change. Update this so that EXPOACT_POINT_ITEM is handled in cedit_do_action(). Expand the test to cover this. Signed-off-by: Simon Glass <[email protected]>
2025-05-30expo: Add a function to poll for inputSimon Glass
Both bootflow_menu and cedit use similar logic to poll an expo. Move this into the expo library so the code can be shared. Update bootflow_menu_run() to return -EPIPE when the user quits without choosing anything, since -EAGAIN is ambiguous and elsewhere means that there is no input yet. Signed-off-by: Simon Glass <[email protected]>
2025-05-30expo: Add CLI context to the expoSimon Glass
An expo generally needs to keep track of the keyboard state while it is running, so move the context into struct expo Signed-off-by: Simon Glass <[email protected]>
2024-06-20boot: bootflow_menu: fix crash for EFI BOOTMGR global bootmethQuentin Schulz
The global bootmeths don't set the dev in bootflow struct which means the dev_get_parent(bflow->dev) triggers a NULL-pointer dereference and crash U-Boot. So before trying to handle a bootflow, check that the associated bootmeth isn't global, otherwise skip it. Suggested-by: Simon Glass <[email protected]> Signed-off-by: Quentin Schulz <[email protected]> Reviewed-by: Simon Glass <[email protected]>
2024-05-20Restore patch series "arm: dts: am62-beagleplay: Fix Beagleplay Ethernet"Tom Rini
As part of bringing the master branch back in to next, we need to allow for all of these changes to exist here. Reported-by: Jonas Karlman <[email protected]> Signed-off-by: Tom Rini <[email protected]>
2024-05-19Revert "Merge patch series "arm: dts: am62-beagleplay: Fix Beagleplay Ethernet""Tom Rini
When bringing in the series 'arm: dts: am62-beagleplay: Fix Beagleplay Ethernet"' I failed to notice that b4 noticed it was based on next and so took that as the base commit and merged that part of next to master. This reverts commit c8ffd1356d42223cbb8c86280a083cc3c93e6426, reversing changes made to 2ee6f3a5f7550de3599faef9704e166e5dcace35. Reported-by: Jonas Karlman <[email protected]> Signed-off-by: Tom Rini <[email protected]>
2024-05-06boot: Remove <common.h> and add needed includesTom Rini
Remove <common.h> from all "boot/" files and when needed add missing include files directly. Signed-off-by: Tom Rini <[email protected]>
2024-01-18boot: superfluous assignment in bootflow_menu_new()Heinrich Schuchardt
ret is assigned a value 0 which is never used but is immediately overwritten in the next statement. Addresses-Coverity-ID: 453304 ("Unused value") Signed-off-by: Heinrich Schuchardt <[email protected]>
2023-07-14expo: Rename exp_set_text_mode()Simon Glass
Rename this function to match its peers, using the full "expo' prefix. Signed-off-by: Simon Glass <[email protected]>
2023-07-14expo: Avoid automatically arranging the sceneSimon Glass
This should ideally be done once after all scene changes have been made. Require an explicit call when everything is ready. Always arrange after a key it sent, just for convenience. Signed-off-by: Simon Glass <[email protected]>
2023-01-16bootstd: Support setting a theme for the menuSimon Glass
Allow a theme to be set. For now this is very simple, just a default font size to use for all elements. Signed-off-by: Simon Glass <[email protected]>
2023-01-16bootstd: Support creating a boot menuSimon Glass
Create an expo to handle the boot menu. For now this is quite simple, with just a header, some menu items and a pointer to show the current one. Signed-off-by: Simon Glass <[email protected]>