All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v3 00/25] bootstd: Add a boot menu
@ 2023-01-06 14:52 Simon Glass
  2023-01-06 14:52 ` [PATCH v3 01/25] sandbox: Enable mmc command and legacy images Simon Glass
                   ` (25 more replies)
  0 siblings, 26 replies; 40+ messages in thread
From: Simon Glass @ 2023-01-06 14:52 UTC (permalink / raw)
  To: U-Boot Mailing List
  Cc: Anatolij Gustschin, Tom Rini, Heinrich Schuchardt, Simon Glass,
	Joe Hershberger, Marek Vasut

So far standard boot lacks a boot menu, although it is possible to create
a rudimentary one using the existing 'bootmenu' command.

Even then, this text-based menu offer only basic functionality and does
not take full advantage of the displays which are common on many devices.

This series provides a 'bootflow menu' command which allows the user to
select from the available bootflows. An attempt is made to show the name
of the available operating systems, by reading more information into the
bootflow. A logo can be read also, where supported, so that this can be
presented to the user when an option is highlighted.

Full use is made of TrueType fonts, if enabled. For cases where only a
serial console is available, it falls back to a simple text-based menu.

All of this is implementing using a new 'expo' construct, a collection of
scenes (like menu screens) which can be navigated by the user to view
information and select options. This is fairly general and should be able
to cope with a wider array of use cases, with less hacking of the menu
code, such as is currently needed for CMD_BOOTEFI_BOOTMGR.

Of course it would be possible to enhance the existing menu rather than
creating a new setup. Instead it seems better to make the existing menu
use expo, if code space permits. It avoids the event-loop problem and
should be more extensible, given its loosely coupled components and use of
IDs instead of pointers. Further motivation is provided in the
documentation.

For now the CLI keypress-decoding code is split out to be used by the new
menu. The key codes defined by menu.h are reused also.

This is of course just a starting point. Some ideas for future work are
included in the documentation.

Changes in v3:
- Rebase to master

Changes in v2:
- Drop the _add suffix on expo creation function
- Fix 'touse' typo
- Fix pylint warning in mkdir_cond()
- Put strings in a separate structure referenced by ID
- Rebase to master
- Rename vidconsole_get_font() to vidconsole_get_font_size()
- Update for new API

Simon Glass (25):
  sandbox: Enable mmc command and legacy images
  cli: Move readline character-processing to a state machine
  bootmenu: Add a few comments
  menu: Rename KEY_... to BKEY_...
  menu: Update bootmenu_autoboot_loop() to return the code
  menu: Update bootmenu_loop() to return the code
  menu: Use a switch statement
  menu: Make use of CLI character processing
  image: Add a function to find a script in an image
  image: Move common image code to image_board and command
  video: Enable VIDEO_ANSI by default only with EFI
  video: truetype: Rename the metrics function
  video: Fix unchnaged typo
  video: Add font functions to the vidconsole API
  bootstd: Read the Operating System name for distro/scripts
  bootstd: Allow reading a logo for the OS
  menu: Factor out menu-keypress decoding
  expo: Add basic implementation
  expo: Add support for scenes
  expo: Add support for scene menus
  expo: Add basic tests
  bootstd: Support creating a boot menu
  bootstd: Add a test for the bootstd menu
  bootstd: Support setting a theme for the menu
  expo: Add documentation

 .../cmd_stm32prog/cmd_stm32prog.c             |   2 +-
 arch/sandbox/dts/test.dts                     |  11 +
 boot/Kconfig                                  |  12 +
 boot/Makefile                                 |   3 +
 boot/bootflow.c                               |   1 +
 boot/bootflow_internal.h                      |  47 ++
 boot/bootflow_menu.c                          | 284 +++++++++
 boot/bootmeth-uclass.c                        |  69 ++-
 boot/bootmeth_distro.c                        |  36 ++
 boot/bootmeth_script.c                        |  40 +-
 boot/bootstd-uclass.c                         |   2 +
 boot/expo.c                                   | 170 ++++++
 boot/image-board.c                            | 133 +++++
 boot/scene.c                                  | 414 ++++++++++++++
 boot/scene_internal.h                         | 123 ++++
 boot/scene_menu.c                             | 390 +++++++++++++
 cmd/bootflow.c                                |  44 +-
 cmd/bootmenu.c                                |  19 +-
 cmd/eficonfig.c                               |  38 +-
 cmd/font.c                                    |  11 +-
 cmd/source.c                                  | 140 +----
 common/Makefile                               |   6 +-
 common/cli_getch.c                            | 208 +++++++
 common/cli_readline.c                         | 150 +----
 common/command.c                              |  19 +
 common/menu.c                                 | 157 +++--
 configs/sandbox_defconfig                     |   2 +
 configs/sandbox_flattree_defconfig            |   2 +
 configs/snow_defconfig                        |   4 +
 configs/tools-only_defconfig                  |   2 +
 doc/develop/expo.rst                          | 188 ++++++
 doc/develop/index.rst                         |   1 +
 drivers/usb/gadget/f_sdp.c                    |   2 +-
 drivers/video/Kconfig                         |   7 +-
 drivers/video/console_truetype.c              |  37 +-
 drivers/video/vidconsole-uclass.c             |  33 ++
 include/bootflow.h                            |  40 ++
 include/bootmeth.h                            |  16 +
 include/bootstd.h                             |   4 +
 include/cli.h                                 |  74 +++
 include/command.h                             |  12 +
 include/expo.h                                | 521 +++++++++++++++++
 include/image.h                               |  17 +-
 include/menu.h                                |  77 ++-
 include/video.h                               |   2 +-
 include/video_console.h                       |  75 ++-
 test/boot/Makefile                            |   2 +
 test/boot/bootflow.c                          | 130 +++++
 test/boot/expo.c                              | 539 ++++++++++++++++++
 test/cmd/font.c                               |   6 +-
 test/py/tests/bootstd/armbian.bmp.xz          | Bin 0 -> 1384 bytes
 test/py/tests/bootstd/mmc4.img.xz             | Bin 0 -> 7072 bytes
 test/py/tests/test_android/test_avb.py        |   2 +
 test/py/tests/test_ut.py                      | 218 ++++++-
 54 files changed, 4075 insertions(+), 467 deletions(-)
 create mode 100644 boot/bootflow_internal.h
 create mode 100644 boot/bootflow_menu.c
 create mode 100644 boot/expo.c
 create mode 100644 boot/scene.c
 create mode 100644 boot/scene_internal.h
 create mode 100644 boot/scene_menu.c
 create mode 100644 common/cli_getch.c
 create mode 100644 doc/develop/expo.rst
 create mode 100644 include/expo.h
 create mode 100644 test/boot/expo.c
 create mode 100644 test/py/tests/bootstd/armbian.bmp.xz
 create mode 100644 test/py/tests/bootstd/mmc4.img.xz

-- 
2.39.0.314.g84b9a713c41-goog


^ permalink raw reply	[flat|nested] 40+ messages in thread

end of thread, other threads:[~2023-04-24 19:44 UTC | newest]

Thread overview: 40+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-01-06 14:52 [PATCH v3 00/25] bootstd: Add a boot menu Simon Glass
2023-01-06 14:52 ` [PATCH v3 01/25] sandbox: Enable mmc command and legacy images Simon Glass
2023-01-06 14:52 ` [PATCH v3 02/25] cli: Move readline character-processing to a state machine Simon Glass
2023-01-06 15:50   ` Heinrich Schuchardt
2023-01-07  0:13     ` Simon Glass
2023-01-07 22:31       ` Heinrich Schuchardt
2023-01-24 15:19   ` [BUG] " Heinrich Schuchardt
2023-01-28 22:01     ` Simon Glass
2023-01-06 14:52 ` [PATCH v3 03/25] bootmenu: Add a few comments Simon Glass
2023-01-06 15:53   ` Heinrich Schuchardt
2023-01-07  0:13     ` Simon Glass
2023-01-07 22:34       ` Heinrich Schuchardt
2023-01-07 22:54         ` Simon Glass
2023-01-06 14:52 ` [PATCH v3 04/25] menu: Rename KEY_... to BKEY_ Simon Glass
2023-01-06 14:52 ` [PATCH v3 05/25] menu: Update bootmenu_autoboot_loop() to return the code Simon Glass
2023-01-06 14:52 ` [PATCH v3 06/25] menu: Update bootmenu_loop() " Simon Glass
2023-01-06 14:52 ` [PATCH v3 07/25] menu: Use a switch statement Simon Glass
2023-01-06 14:52 ` [PATCH v3 08/25] menu: Make use of CLI character processing Simon Glass
2023-04-11 20:19   ` Daniel Golle
2023-04-19  1:49     ` Simon Glass
2023-04-24  1:49       ` Tom Rini
2023-04-24 19:42         ` Simon Glass
2023-01-06 14:52 ` [PATCH v3 09/25] image: Add a function to find a script in an image Simon Glass
2023-01-06 14:52 ` [PATCH v3 10/25] image: Move common image code to image_board and command Simon Glass
2023-01-06 14:52 ` [PATCH v3 11/25] video: Enable VIDEO_ANSI by default only with EFI Simon Glass
2023-01-06 14:52 ` [PATCH v3 12/25] video: truetype: Rename the metrics function Simon Glass
2023-01-06 14:52 ` [PATCH v3 13/25] video: Fix unchnaged typo Simon Glass
2023-01-06 14:52 ` [PATCH v3 14/25] video: Add font functions to the vidconsole API Simon Glass
2023-01-06 14:52 ` [PATCH v3 15/25] bootstd: Read the Operating System name for distro/scripts Simon Glass
2023-01-06 14:52 ` [PATCH v3 16/25] bootstd: Allow reading a logo for the OS Simon Glass
2023-01-06 14:52 ` [PATCH v3 17/25] menu: Factor out menu-keypress decoding Simon Glass
2023-01-06 14:52 ` [PATCH v3 18/25] expo: Add basic implementation Simon Glass
2023-01-06 14:52 ` [PATCH v3 19/25] expo: Add support for scenes Simon Glass
2023-01-06 14:52 ` [PATCH v3 20/25] expo: Add support for scene menus Simon Glass
2023-01-06 14:52 ` [PATCH v3 21/25] expo: Add basic tests Simon Glass
2023-01-06 14:52 ` [PATCH v3 22/25] bootstd: Support creating a boot menu Simon Glass
2023-01-06 14:52 ` [PATCH v3 23/25] bootstd: Add a test for the bootstd menu Simon Glass
2023-01-06 14:52 ` [PATCH v3 24/25] bootstd: Support setting a theme for the menu Simon Glass
2023-01-06 14:52 ` [PATCH v3 25/25] expo: Add documentation Simon Glass
2023-01-17 13:57 ` [PATCH v3 00/25] bootstd: Add a boot menu Tom Rini

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.