19 Commits

Author SHA1 Message Date
Simon Glass
a23e4407d5 luks: Correct condition for calling handle_encrypted()
Use CONFIG_BLK_LUKS instead of CONFIG_LUKS, which does not exist. This
allows the test to pass.

Signed-off-by: Simon Glass <simon.glass@canonical.com>
2025-12-08 05:22:18 -07:00
Simon Glass
cf8ce64138 bootctl: Allow unlocking LUKS2 partitions
Switch away from a pre-derived key so that LUKS2 partitions can be
unlocked. Update the ulock message to be more generic.

Signed-off-by: Simon Glass <simon.glass@canonical.com>
2025-12-07 17:18:57 -07:00
Simon Glass
29e684deda bootctl: Add the logic for disk unlock using a TKey
The unlock process is quite different with a TKey, since we need to load
the signing app with the user's passphrase as the USS. If the TKey is
not already in firmware mode we must prompt the user to remove and
re-insert it.

The easiest way to implement this is via a state machine. Add the
required logic:

- detect key presence and absence
- prompt for removal and insertion
- send the app, while keeping the UI responsive
- unlock the disk once the TKey provides a key
- report success or failure to the user

Ensure that the logic is only used if CONFIG_TKEY and CONFIG_LUKS are
both enabled.

Co-developed-by: Claude <claude@anthropic.com>
Signed-off-by: Simon Glass <simon.glass@canonical.com>
2025-12-07 17:18:57 -07:00
Simon Glass
40be1fd57d bootctl: Clean up some unwanted debugging in the logic
Tidy up the code style for checking the result of read_images() and drop
some commented-out debug lines.

Also fix a shadowed variable while we are here.

Signed-off-by: Simon Glass <simon.glass@canonical.com>
2025-12-07 17:18:57 -07:00
Simon Glass
9bdd221a14 bootctl: Provide an extra poll between select and booting
Selecting an OS may cause the UI to change, so give it a chance to show
those changes before booting.

Signed-off-by: Simon Glass <simon.glass@canonical.com>
2025-12-07 17:18:57 -07:00
Simon Glass
4eaef8aa12 bootctl: Enhance the UI to support a TKey
When unlocking an encrypted disk with a TKey we need a few more UI
operations:

- allow the password-entry textline to be shown/hidden
- allow showing instructions to the user, as well as unlock result
- obtain the password entered by the user

Add these to the API and implement them in the multi UI.

Signed-off-by: Simon Glass <simon.glass@canonical.com>
2025-12-07 17:18:57 -07:00
Simon Glass
14544da18d bootctl: Provide passphrase and message objects in the expo
Set up a textline object to allow the user to enter a passphrase and a
text object to display messages for the user.

Signed-off-by: Simon Glass <simon.glass@canonical.com>
2025-12-07 17:18:57 -07:00
Simon Glass
4fb40b79a6 bootctl: Show a lock symbol for locked disks
When an OS is using disk encryption, show a lock symbol next to it.

Signed-off-by: Simon Glass <simon.glass@canonical.com>
2025-12-07 17:18:57 -07:00
Simon Glass
ceab1d8010 bootctl: Allow switching between logos
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>
2025-12-07 17:18:57 -07:00
Simon Glass
e47ca5518a bootctl: Bring in another image
Add an image for the Canonical logo, so we can see how the screen layout
looks.

Signed-off-by: Simon Glass <simon.glass@canonical.com>
2025-12-07 17:18:57 -07:00
Simon Glass
2bd1cbe740 bootctl: Drop unnecessary calls to calculate dimensions
Since scene_calc_dims() is done by scene_arrange(), we don't need to do
an explicit call to scene_calc_dims() first. Drop it from both UIs.

Signed-off-by: Simon Glass <simon.glass@canonical.com>
2025-12-07 17:18:57 -07:00
Simon Glass
26ff781b10 bootctl: Provide a multi-themed UI
Add a new 'multi' UI which can display in a simple format (like GRUB) as
well as a more modern format with a mouse.

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-10-18 09:38:26 +01:00
Simon Glass
781e013812 bootctl: Add an option to switch the layout
Provide an operation to switch to a different layout, for use with the
upcoming 'multi' UI.

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-10-18 09:38:25 +01:00
Simon Glass
9958f7779d bootctl: Re-apply the theme when showing the UI
If a different UI is used then the theme may have changed, so re-apply
the theme when showing the UI.

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-10-18 09:38:25 +01:00
Simon Glass
45f0c19d32 bootctl: Respect the autoboot option
When autoboot is disabled, hide the prompt.

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-10-18 09:38:25 +01:00
Simon Glass
46a205b1ca bootctl: Provide an option to slow the display refresh
When a mouse pointer is not used, there is typically no need to refresh
the display unless something changes. Add an option to allow slow
refresh.

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-10-18 09:38:25 +01:00
Simon Glass
53ca497bef bootctl: Avoid hanging on failure
For now just drop to the cmdline so that the state can be examined. This
will aid debugging.

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-10-18 09:38:25 +01:00
Simon Glass
001eeb2c8d bootctl: Create a common struct for the BOOTCTL_UI uclass
All UI implementations will likely share a number of common elements, so
move these into a per-device uclass struct.

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-10-18 09:38:25 +01:00
Simon Glass
d9152ea75e bootctl: Initial experimentation
This provides a basic prototype for boot control.

Some documentation is in boot/bootctl/README.rst
2025-09-28 14:32:36 -06:00