diff options
| author | Tom Rini <[email protected]> | 2025-05-30 13:53:50 -0600 |
|---|---|---|
| committer | Tom Rini <[email protected]> | 2025-05-30 13:53:50 -0600 |
| commit | 6e03ca240945ebf78d72e6839e9972c8e3893e54 (patch) | |
| tree | 5d0037392203a8149b22a089a333f1330762f538 /cmd | |
| parent | 5eb1b7843811e3e87b0e677212a9145f07552a60 (diff) | |
| parent | 44fc287387c06946d3c8f1a62e641ab35ba65eea (diff) | |
Merge tag 'dm-pull-30may25' of git://git.denx.de/u-boot-dm into next
Bring in recent expo enhancements:
- multi-line text
- highlighting of menu items
- rationalisation of menu and expo code
- support for object alignment
- editable strings
- various bug fixes and tweaks
This also includes some required abuf improvements.
Diffstat (limited to 'cmd')
| -rw-r--r-- | cmd/bootflow.c | 43 | ||||
| -rw-r--r-- | cmd/cedit.c | 2 |
2 files changed, 32 insertions, 13 deletions
diff --git a/cmd/bootflow.c b/cmd/bootflow.c index d4f7d336150..551dffbb8b8 100644 --- a/cmd/bootflow.c +++ b/cmd/bootflow.c @@ -14,6 +14,8 @@ #include <console.h> #include <dm.h> #include <env.h> +#include <expo.h> +#include <log.h> #include <mapmem.h> /** @@ -105,24 +107,39 @@ __maybe_unused static int bootflow_handle_menu(struct bootstd_priv *std, bool text_mode, struct bootflow **bflowp) { + struct expo *exp; struct bootflow *bflow; - int ret; + int ret, seq; - ret = bootflow_menu_run(std, text_mode, &bflow); - if (ret) { - if (ret == -EAGAIN) { - printf("Nothing chosen\n"); - std->cur_bootflow = NULL; - } else { - printf("Menu failed (err=%d)\n", ret); + ret = bootflow_menu_start(std, text_mode, &exp); + if (ret) + return log_msg_ret("bhs", ret); + + ret = -ERESTART; + do { + if (ret == -ERESTART) { + ret = expo_render(exp); + if (ret) + return log_msg_ret("bhr", ret); } + ret = bootflow_menu_poll(exp, &seq); + } while (ret == -EAGAIN || ret == -ERESTART); - return ret; + if (ret == -EPIPE) { + printf("Nothing chosen\n"); + std->cur_bootflow = NULL; + } else if (ret) { + printf("Menu failed (err=%d)\n", ret); + } else { + bflow = alist_getw(&std->bootflows, seq, struct bootflow); + printf("Selected: %s\n", bflow->os_name ? bflow->os_name : + bflow->name); + std->cur_bootflow = bflow; + *bflowp = bflow; } - - printf("Selected: %s\n", bflow->os_name ? bflow->os_name : bflow->name); - std->cur_bootflow = bflow; - *bflowp = bflow; + expo_destroy(exp); + if (ret) + return ret; return 0; } diff --git a/cmd/cedit.c b/cmd/cedit.c index f696356419e..20f48ae0007 100644 --- a/cmd/cedit.c +++ b/cmd/cedit.c @@ -287,6 +287,8 @@ static int do_cedit_run(struct cmd_tbl *cmdtp, int flag, int argc, log_err("Failed (err=%dE)\n", ret); return CMD_RET_FAILURE; } + expo_destroy(cur_exp); + cur_exp = NULL; return 0; } |
