-
Update the expo documentation to include mention of this new object type. Signed-off-by:
Simon Glass <sjg@chromium.org>
Update the expo documentation to include mention of this new object type. Signed-off-by:
Simon Glass <sjg@chromium.org>
Expo menu
U-Boot provides a menu implementation for use with selecting bootflows and changing U-Boot settings. This is in early stages of development.
Motivation
U-Boot already has a text-based menu system accessed via the :doc:`../usage/cmd/bootmenu`. This works using environment variables, or via some EFI-specific hacks.
The command makes use of a lower-level menu implementation, which is quite flexible and can be used to make menu hierarchies.
However this system is not flexible enough for use with standard boot. It does not support a graphical user interface and cannot currently support anything more than a very simple list of items. While it does support multiple menus in hierarchies, these are implemented by the caller. See for example eficonfig.c.
Another challenge with the current menu implementation is that it controls the event loop, such that bootmenu_loop() does not return until a key is pressed. This makes it difficult to implement dynamic displays or to do other things while the menu is running, such as searching for more bootflows.
For these reasons an attempt has been made to develop a more flexible system which can handle menus as well as other elements. This is called 'expo', short for exposition, in an attempt to avoid common words like display, screen, menu and the like. The primary goal is to support Verified Boot for Embedded (VBE), although it is available to any boot method, using the 'bootflow menu' command.
Efforts have been made to use common code with the existing menu, including key processing in particular.
Previous work looked at integrating Nuklear into U-Boot. This works fine and could provide a way to provide a more flexible UI, perhaps with expo dealing with the interface to Nuklear. But this is quite a big step and it may be years before this becomes desirable, if at all. For now, U-Boot only needs a fairly simple set of menus and options, so rendering them directly is fairly straightforward.
Concepts
The creator of the expo is here called a controller and it controls most aspects of the expo. This is the code that you must write to use expo.
An expo is a set of scenes which can be presented to the user one at a time, to show information and obtain input from the user.
A scene is a collection of objects which are displayed together on the screen. Only one scene is visible at a time and scenes do not share objects.
A scene object is something that appears in the scene, such as some text, an image or a menu. Objects can be positioned and hidden.
A menu object contains a title, a set of menu items and a pointer to the current item. Menu items consist of a keypress (indicating what to press to select the item), label and description. All three are shown in a single line within the menu. Items can also have a preview image, which is shown when the item is highlighted.
A textline object contains a label and an editable string.
All components have a name. This is mostly for debugging, so it is easy to see what object is referred to, although the name is also used for saving values. Of course the ID numbers can help as well, but they are less easy to distinguish.