The bootctl tests are currently disabled due to some image
incompatibilities: the multi UI uses one image and the simple UI uses a
different one.
Update the logic to switch between these logos when the layout changes.
For now, use the U-Boot logo in both cases.
Signed-off-by: Simon Glass <simon.glass@canonical.com>
The SCENEOF_PASSWORD flag is set on the textline object, but the
rendering code checks the flag on the text object being rendered. Set
the flag on the edit text object so the passphrase renders as asterisks
instead of showing the actual characters.
Mark the textline object as hidden while we are here, so it disappears
when switching to the simple bootmenu.
Co-developed-by: Claude <claude@anthropic.com>
Signed-off-by: Simon Glass <simon.glass@canonical.com>
When the user types in an unlock password then presses 'enter', select
the item containing the password. This avoids needing to click on an
item as well.
Signed-off-by: Simon Glass <simon.glass@canonical.com>
The edit text object for the passphrase textline is created with an
empty string literal "", rather than pointing to the textline's buffer.
This means that when the user types, tline->buf is updated but the text
object still displays the original empty string.
Fix this by creating the edit text object with abuf_data(&tline->buf) so
it points to the textline's buffer. This matches how expo_build.c
creates textlines for cedit.
Co-developed-by: Claude <claude@anthropic.com>
Signed-off-by: Simon Glass <simon.glass@canonical.com>
Use descriptive names like "item0.label", "item0.desc", "item0.pass"
instead of generic "label", "desc", "passphrase". This makes debugging
easier when multiple bootflow items exist.
Co-developed-by: Claude <claude@anthropic.com>
Signed-off-by: Simon Glass <simon.glass@canonical.com>
Provide fields to show that a disk is locked and allow the user to
enter a passphrase to unlock it.
Co-developed-by: Claude <noreply@anthropic.com>
Signed-off-by: Simon Glass <simon.glass@canonical.com>
Due to a missing return in bootflow_menu_poll() a click on any object is
handled as if it were a click on the settings object. Fix this by
returning the correct error code for unrecognised clicks.
Signed-off-by: Simon Glass <sjg@chromium.org>
Fixes: e94de63e6c ("expo: Add a way to select settings")
Initially there may be no items. But when switching to the basic menu
there may well be items already present. Set up their properties so that
they follow the basic-menu theme.
Series-to: concept
Cover-letter:
boot: Separate out the boot-menu style
This series refactors the boot menu so that it is possible to create the
items and then (later) change the style/position to the simple style.
This allows swapping back and forth between a different style and the
simple style.
It also adjusts how the mouse is set up, so that the initial mouse
position is only set up once the video device is known. This allows the
position to be centred on the display, a better starting point than the
top left.
END
Signed-off-by: Simon Glass <sjg@chromium.org>
Set up the theme colour and apply it in bootflow_menu_set_props() so
that the simple menu always looks the same when selected.
Signed-off-by: Simon Glass <sjg@chromium.org>
Manual mode is not enabled by default, but we should explicitly clear
it with the basic menu, since a different style may have set the flag.
Set manual mode to false in bootflow_menu_set_props()
Signed-off-by: Simon Glass <sjg@chromium.org>
Use the bootflow_menu_set_item_props() to set the text in these items,
since it can be presented differently depending on the layout.
Signed-off-by: Simon Glass <sjg@chromium.org>
These can be used if desired, so add them to the menu. Since they are
not part of the simple menu, hide them in that case, via a new function
which sets up the properties of items.
Signed-off-by: Simon Glass <sjg@chromium.org>
The basic menu uses a pointer to show the current menu item. Show this
and hide some other objects which are not wanted.
Mark the box as unfilled, since this is how it is used with the basic
menu.
Explicitly disable the mouse pointer.
Signed-off-by: Simon Glass <sjg@chromium.org>
These strings are part of the basic menu and may be different for other
menus. Rather than setting them up on creation, add them as part of
setting the properties of the objects. Provide a way to set the title
as well.
Signed-off-by: Simon Glass <sjg@chromium.org>
The existing menu is functional but basic. It would be useful to be able
to create the objects but apply a different layout or style for them.
The bootflow_menu_new() function is quite long in any case.
Split out the parts which adjust the position, alignment, etc. of the
objects into a separate function. We can (later) call this from
elsewhere to apply the basic styling.
Signed-off-by: Simon Glass <sjg@chromium.org>
It is sometimes useful to be able to click on an image (sometimes called
an icon). Allow this within expo and return new click action.
Signed-off-by: Simon Glass <sjg@chromium.org>
Several items use the SCENEOB_DISPLAY_MAX setting which does not work
with alignment. Some others have a negative height, which is now
checked, so results in the item being invisible.
Fix these problems.
Signed-off-by: Simon Glass <sjg@chromium.org>
When creating a new bootflow menu or cedit, enable the mouse, so the
user can interact with the expo more easily.
Signed-off-by: Simon Glass <sjg@chromium.org>
At present boxes are not supported in the expo_build format. Also, it is
now possible to draw filled boxes, a recently added feature to the video
API.
Expand the box feature slightly to resolve these two items.
Co-developed-by: Claude <noreply@anthropic.com>
Signed-off-by: Simon Glass <sjg@chromium.org>
Make use of bootflow_guess_label() to get the label for a menu, since it
provides more information for the EFI app.
Signed-off-by: Simon Glass <sjg@chromium.org>
At present all coordinates are absolute and must fit within the display.
This makes it hard to create an expo which can work on any size of
display, a key goal of expo.
Add the concept of a nominal size, to which all coordinates conform. Once
the real display-size is known, expo can in principle (i.e. with later
work) scale the coordinates and objects according.
Signed-off-by: Simon Glass <sjg@chromium.org>
When the user presses 'up' when on the top menu item, it is a waste of
time to refresh since nothing has changed.
Add a new return code from this function to indicate that the UI must be
refreshed.
Signed-off-by: Simon Glass <sjg@chromium.org>
Rename the existing expo_apply_theme() to expo_setup_theme() and adjust
the former so that it applies a theme which has already been read into
the struct. This will make it easier for tests to check theme
adjustments, since they won't have to put them in a node.
Add the white-on-black property into the theme struct while we are.
Signed-off-by: Simon Glass <sjg@chromium.org>
Provide a convenient function which arranges the current scene in an
expo. Make use of this in bootflow_menu
Signed-off-by: Simon Glass <sjg@chromium.org>
When testing menu items it is easier to check that the correct preview
is shown if the preview images are different. Make a copy of the image
and modify the palette for the second menu item, so this is obvious.
Signed-off-by: Simon Glass <sjg@chromium.org>
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 <sjg@chromium.org>
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 <sjg@chromium.org>
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 <sjg@chromium.org>
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 <sjg@chromium.org>
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 <sjg@chromium.org>
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 <sjg@chromium.org>
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 <sjg@chromium.org>
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 <sjg@chromium.org>
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 <sjg@chromium.org>
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 <sjg@chromium.org>
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 <sjg@chromium.org>
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 <sjg@chromium.org>
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 <sjg@chromium.org>
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 <sjg@chromium.org>
Signed-off-by: Quentin Schulz <quentin.schulz@cherry.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
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 <jonas@kwiboo.se>
Signed-off-by: Tom Rini <trini@konsulko.com>
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 c8ffd1356d, reversing
changes made to 2ee6f3a5f7.
Reported-by: Jonas Karlman <jonas@kwiboo.se>
Signed-off-by: Tom Rini <trini@konsulko.com>
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 <heinrich.schuchardt@canonical.com>
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 <sjg@chromium.org>
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 <sjg@chromium.org>