提交 f3b267b3 编写于 作者: M Marek Vasut 提交者: Tom Rini

hush: Add rudimentary support for PS1 and PS2

Add trivial support for changing the U-Boot command prompt string
by setting PS1 and PS2 environment variables. Only static variables
are supported.
Signed-off-by: NMarek Vasut <marex@denx.de>
Reviewed-by: NHeiko Schocher <hs@denx.de>
Reviewed-by: NSimon Glass <sjg@chromium.org>
上级 13d3046f
......@@ -2905,6 +2905,14 @@ CBFS (Coreboot Filesystem) support
Enable editing and History functions for interactive
command line input operations
- Command Line PS1/PS2 support:
CONFIG_CMDLINE_PS_SUPPORT
Enable support for changing the command prompt string
at run-time. Only static string is supported so far.
The string is obtained from environment variables PS1
and PS2.
- Default Environment:
CONFIG_EXTRA_ENV_SETTINGS
......
......@@ -978,12 +978,22 @@ static inline void setup_prompt_string(int promptmode, char **prompt_str)
static int uboot_cli_readline(struct in_str *i)
{
char *prompt;
char __maybe_unused *ps_prompt = NULL;
if (i->promptmode == 1)
prompt = CONFIG_SYS_PROMPT;
else
prompt = CONFIG_SYS_PROMPT_HUSH_PS2;
#ifdef CONFIG_CMDLINE_PS_SUPPORT
if (i->promptmode == 1)
ps_prompt = getenv("PS1");
else
ps_prompt = getenv("PS2");
if (ps_prompt)
prompt = ps_prompt;
#endif
return cli_readline(prompt);
}
#endif
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册