Tom Rini | 83d290c | 2018-05-06 17:58:06 -0400 | [diff] [blame] | 1 | // SPDX-License-Identifier: GPL-2.0+ |
Simon Glass | 3035497 | 2014-04-10 20:01:29 -0600 | [diff] [blame] | 2 | /* |
| 3 | * (C) Copyright 2000 |
| 4 | * Wolfgang Denk, DENX Software Engineering, wd@denx.de. |
| 5 | * |
| 6 | * Add to readline cmdline-editing by |
| 7 | * (C) Copyright 2005 |
| 8 | * JinHua Luo, GuangDong Linux Center, <luo.jinhua@gd-linux.com> |
Simon Glass | 3035497 | 2014-04-10 20:01:29 -0600 | [diff] [blame] | 9 | */ |
| 10 | |
Evgeny Bachinin | 26f923c | 2023-03-20 11:23:11 +0300 | [diff] [blame] | 11 | #define pr_fmt(fmt) "cli: %s: " fmt, __func__ |
| 12 | |
Simon Glass | 3035497 | 2014-04-10 20:01:29 -0600 | [diff] [blame] | 13 | #include <common.h> |
Heinrich Schuchardt | d2e4b2f | 2024-03-29 17:09:22 +0100 | [diff] [blame] | 14 | #include <ansi.h> |
Simon Glass | 52f2423 | 2020-05-10 11:40:00 -0600 | [diff] [blame] | 15 | #include <bootstage.h> |
Simon Glass | 3035497 | 2014-04-10 20:01:29 -0600 | [diff] [blame] | 16 | #include <cli.h> |
| 17 | #include <cli_hush.h> |
Simon Glass | 288b29e | 2019-11-14 12:57:43 -0700 | [diff] [blame] | 18 | #include <command.h> |
Simon Glass | 24b852a | 2015-11-08 23:47:45 -0700 | [diff] [blame] | 19 | #include <console.h> |
Simon Glass | 7b51b57 | 2019-08-01 09:46:52 -0600 | [diff] [blame] | 20 | #include <env.h> |
Simon Glass | affb215 | 2014-04-10 20:01:35 -0600 | [diff] [blame] | 21 | #include <fdtdec.h> |
Simon Glass | db41d65 | 2019-12-28 10:45:07 -0700 | [diff] [blame] | 22 | #include <hang.h> |
Simon Glass | 3035497 | 2014-04-10 20:01:29 -0600 | [diff] [blame] | 23 | #include <malloc.h> |
Simon Glass | 401d1c4 | 2020-10-30 21:38:53 -0600 | [diff] [blame] | 24 | #include <asm/global_data.h> |
Simon Glass | 7de8bd0 | 2021-08-07 07:24:01 -0600 | [diff] [blame] | 25 | #include <dm/ofnode.h> |
Evgeny Bachinin | 26f923c | 2023-03-20 11:23:11 +0300 | [diff] [blame] | 26 | #include <linux/errno.h> |
Simon Glass | affb215 | 2014-04-10 20:01:35 -0600 | [diff] [blame] | 27 | |
Simon Glass | f8bb696 | 2016-03-19 02:18:38 -0600 | [diff] [blame] | 28 | #ifdef CONFIG_CMDLINE |
Francis Laniel | 3ea3c57 | 2023-12-22 22:02:35 +0100 | [diff] [blame] | 29 | |
| 30 | static inline bool use_hush_old(void) |
| 31 | { |
| 32 | return IS_ENABLED(CONFIG_HUSH_SELECTABLE) ? |
| 33 | gd->flags & GD_FLG_HUSH_OLD_PARSER : |
| 34 | IS_ENABLED(CONFIG_HUSH_OLD_PARSER); |
| 35 | } |
| 36 | |
Simon Glass | 3035497 | 2014-04-10 20:01:29 -0600 | [diff] [blame] | 37 | /* |
| 38 | * Run a command using the selected parser. |
| 39 | * |
| 40 | * @param cmd Command to run |
| 41 | * @param flag Execution flags (CMD_FLAG_...) |
Heinrich Schuchardt | 185f812 | 2022-01-19 18:05:50 +0100 | [diff] [blame] | 42 | * Return: 0 on success, or != 0 on error. |
Simon Glass | 3035497 | 2014-04-10 20:01:29 -0600 | [diff] [blame] | 43 | */ |
| 44 | int run_command(const char *cmd, int flag) |
| 45 | { |
Simon Glass | b84d23d | 2023-02-05 15:40:06 -0700 | [diff] [blame] | 46 | #if !IS_ENABLED(CONFIG_HUSH_PARSER) |
Simon Glass | 3035497 | 2014-04-10 20:01:29 -0600 | [diff] [blame] | 47 | /* |
| 48 | * cli_run_command can return 0 or 1 for success, so clean up |
| 49 | * its result. |
| 50 | */ |
| 51 | if (cli_simple_run_command(cmd, flag) == -1) |
| 52 | return 1; |
| 53 | |
| 54 | return 0; |
Francis Laniel | 3ea3c57 | 2023-12-22 22:02:35 +0100 | [diff] [blame] | 55 | #else |
| 56 | if (use_hush_old()) { |
| 57 | int hush_flags = FLAG_PARSE_SEMICOLON | FLAG_EXIT_FROM_LOOP; |
Simon Glass | 87b6398 | 2014-10-07 13:59:43 -0600 | [diff] [blame] | 58 | |
Francis Laniel | 3ea3c57 | 2023-12-22 22:02:35 +0100 | [diff] [blame] | 59 | if (flag & CMD_FLAG_ENV) |
| 60 | hush_flags |= FLAG_CONT_ON_NEWLINE; |
| 61 | return parse_string_outer(cmd, hush_flags); |
| 62 | } |
| 63 | /* |
| 64 | * Possible values for flags are the following: |
| 65 | * FLAG_EXIT_FROM_LOOP: This flags ensures we exit from loop in |
| 66 | * parse_and_run_stream() after first iteration while normal |
| 67 | * behavior, * i.e. when called from cli_loop(), is to loop |
| 68 | * infinitely. |
| 69 | * FLAG_PARSE_SEMICOLON: modern Hush parses ';' and does not stop |
| 70 | * first time it sees one. So, I think we do not need this flag. |
| 71 | * FLAG_REPARSING: For the moment, I do not understand the goal |
| 72 | * of this flag. |
| 73 | * FLAG_CONT_ON_NEWLINE: This flag seems to be used to continue |
| 74 | * parsing even when reading '\n' when coming from |
| 75 | * run_command(). In this case, modern Hush reads until it finds |
| 76 | * '\0'. So, I think we do not need this flag. |
| 77 | */ |
| 78 | return parse_string_outer_modern(cmd, FLAG_EXIT_FROM_LOOP); |
Simon Glass | 3035497 | 2014-04-10 20:01:29 -0600 | [diff] [blame] | 79 | #endif |
| 80 | } |
| 81 | |
Thomas Betker | 1d43bfd | 2014-06-05 20:07:57 +0200 | [diff] [blame] | 82 | /* |
| 83 | * Run a command using the selected parser, and check if it is repeatable. |
| 84 | * |
| 85 | * @param cmd Command to run |
| 86 | * @param flag Execution flags (CMD_FLAG_...) |
Heinrich Schuchardt | 185f812 | 2022-01-19 18:05:50 +0100 | [diff] [blame] | 87 | * Return: 0 (not repeatable) or 1 (repeatable) on success, -1 on error. |
Thomas Betker | 1d43bfd | 2014-06-05 20:07:57 +0200 | [diff] [blame] | 88 | */ |
| 89 | int run_command_repeatable(const char *cmd, int flag) |
| 90 | { |
Masahiro Yamada | f1f9d4f | 2016-06-21 02:11:19 +0900 | [diff] [blame] | 91 | #ifndef CONFIG_HUSH_PARSER |
Thomas Betker | 1d43bfd | 2014-06-05 20:07:57 +0200 | [diff] [blame] | 92 | return cli_simple_run_command(cmd, flag); |
| 93 | #else |
Francis Laniel | 3ea3c57 | 2023-12-22 22:02:35 +0100 | [diff] [blame] | 94 | int ret; |
| 95 | |
| 96 | if (use_hush_old()) { |
| 97 | ret = parse_string_outer(cmd, |
| 98 | FLAG_PARSE_SEMICOLON |
| 99 | | FLAG_EXIT_FROM_LOOP); |
| 100 | } else { |
| 101 | ret = parse_string_outer_modern(cmd, |
| 102 | FLAG_PARSE_SEMICOLON |
| 103 | | FLAG_EXIT_FROM_LOOP); |
| 104 | } |
| 105 | |
Thomas Betker | 1d43bfd | 2014-06-05 20:07:57 +0200 | [diff] [blame] | 106 | /* |
| 107 | * parse_string_outer() returns 1 for failure, so clean up |
| 108 | * its result. |
| 109 | */ |
Francis Laniel | 3ea3c57 | 2023-12-22 22:02:35 +0100 | [diff] [blame] | 110 | if (ret) |
Thomas Betker | 1d43bfd | 2014-06-05 20:07:57 +0200 | [diff] [blame] | 111 | return -1; |
| 112 | |
| 113 | return 0; |
| 114 | #endif |
| 115 | } |
Sean Anderson | 19464f4 | 2020-01-10 12:32:19 -0500 | [diff] [blame] | 116 | #else |
| 117 | __weak int board_run_command(const char *cmdline) |
| 118 | { |
| 119 | printf("## Commands are disabled. Please enable CONFIG_CMDLINE.\n"); |
| 120 | |
| 121 | return 1; |
| 122 | } |
Simon Glass | f8bb696 | 2016-03-19 02:18:38 -0600 | [diff] [blame] | 123 | #endif /* CONFIG_CMDLINE */ |
Thomas Betker | 1d43bfd | 2014-06-05 20:07:57 +0200 | [diff] [blame] | 124 | |
Simon Glass | 3035497 | 2014-04-10 20:01:29 -0600 | [diff] [blame] | 125 | int run_command_list(const char *cmd, int len, int flag) |
| 126 | { |
| 127 | int need_buff = 1; |
| 128 | char *buff = (char *)cmd; /* cast away const */ |
| 129 | int rcode = 0; |
| 130 | |
| 131 | if (len == -1) { |
| 132 | len = strlen(cmd); |
Masahiro Yamada | f1f9d4f | 2016-06-21 02:11:19 +0900 | [diff] [blame] | 133 | #ifdef CONFIG_HUSH_PARSER |
Simon Glass | 3035497 | 2014-04-10 20:01:29 -0600 | [diff] [blame] | 134 | /* hush will never change our string */ |
| 135 | need_buff = 0; |
| 136 | #else |
| 137 | /* the built-in parser will change our string if it sees \n */ |
| 138 | need_buff = strchr(cmd, '\n') != NULL; |
| 139 | #endif |
| 140 | } |
| 141 | if (need_buff) { |
| 142 | buff = malloc(len + 1); |
| 143 | if (!buff) |
| 144 | return 1; |
| 145 | memcpy(buff, cmd, len); |
| 146 | buff[len] = '\0'; |
| 147 | } |
Masahiro Yamada | f1f9d4f | 2016-06-21 02:11:19 +0900 | [diff] [blame] | 148 | #ifdef CONFIG_HUSH_PARSER |
Francis Laniel | 3ea3c57 | 2023-12-22 22:02:35 +0100 | [diff] [blame] | 149 | if (use_hush_old()) { |
| 150 | rcode = parse_string_outer(buff, FLAG_PARSE_SEMICOLON); |
| 151 | } else { |
| 152 | rcode = parse_string_outer_modern(buff, FLAG_PARSE_SEMICOLON); |
| 153 | } |
Simon Glass | 3035497 | 2014-04-10 20:01:29 -0600 | [diff] [blame] | 154 | #else |
| 155 | /* |
| 156 | * This function will overwrite any \n it sees with a \0, which |
| 157 | * is why it can't work with a const char *. Here we are making |
| 158 | * using of internal knowledge of this function, to avoid always |
| 159 | * doing a malloc() which is actually required only in a case that |
| 160 | * is pretty rare. |
| 161 | */ |
Simon Glass | f8bb696 | 2016-03-19 02:18:38 -0600 | [diff] [blame] | 162 | #ifdef CONFIG_CMDLINE |
Simon Glass | 3035497 | 2014-04-10 20:01:29 -0600 | [diff] [blame] | 163 | rcode = cli_simple_run_command_list(buff, flag); |
Simon Glass | f8bb696 | 2016-03-19 02:18:38 -0600 | [diff] [blame] | 164 | #else |
| 165 | rcode = board_run_command(buff); |
| 166 | #endif |
Peng Fan | 09a7886 | 2015-12-22 17:14:13 +0800 | [diff] [blame] | 167 | #endif |
Simon Glass | 3035497 | 2014-04-10 20:01:29 -0600 | [diff] [blame] | 168 | if (need_buff) |
| 169 | free(buff); |
Simon Glass | 3035497 | 2014-04-10 20:01:29 -0600 | [diff] [blame] | 170 | |
| 171 | return rcode; |
| 172 | } |
| 173 | |
Simon Glass | 7472448 | 2022-07-13 06:06:59 -0600 | [diff] [blame] | 174 | int run_commandf(const char *fmt, ...) |
| 175 | { |
| 176 | va_list args; |
Evgeny Bachinin | 26f923c | 2023-03-20 11:23:11 +0300 | [diff] [blame] | 177 | int nbytes; |
Simon Glass | 7472448 | 2022-07-13 06:06:59 -0600 | [diff] [blame] | 178 | |
| 179 | va_start(args, fmt); |
Evgeny Bachinin | 26f923c | 2023-03-20 11:23:11 +0300 | [diff] [blame] | 180 | /* |
| 181 | * Limit the console_buffer space being used to CONFIG_SYS_CBSIZE, |
| 182 | * because its last byte is used to fit the replacement of \0 by \n\0 |
| 183 | * in underlying hush parser |
| 184 | */ |
| 185 | nbytes = vsnprintf(console_buffer, CONFIG_SYS_CBSIZE, fmt, args); |
Simon Glass | 7472448 | 2022-07-13 06:06:59 -0600 | [diff] [blame] | 186 | va_end(args); |
| 187 | |
Evgeny Bachinin | 26f923c | 2023-03-20 11:23:11 +0300 | [diff] [blame] | 188 | if (nbytes < 0) { |
| 189 | pr_debug("I/O internal error occurred.\n"); |
| 190 | return -EIO; |
| 191 | } else if (nbytes >= CONFIG_SYS_CBSIZE) { |
| 192 | pr_debug("'fmt' size:%d exceeds the limit(%d)\n", |
| 193 | nbytes, CONFIG_SYS_CBSIZE); |
| 194 | return -ENOSPC; |
| 195 | } |
| 196 | return run_command(console_buffer, 0); |
Simon Glass | 7472448 | 2022-07-13 06:06:59 -0600 | [diff] [blame] | 197 | } |
| 198 | |
Simon Glass | 3035497 | 2014-04-10 20:01:29 -0600 | [diff] [blame] | 199 | /****************************************************************************/ |
| 200 | |
| 201 | #if defined(CONFIG_CMD_RUN) |
Simon Glass | 0914011 | 2020-05-10 11:40:03 -0600 | [diff] [blame] | 202 | int do_run(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[]) |
Simon Glass | 3035497 | 2014-04-10 20:01:29 -0600 | [diff] [blame] | 203 | { |
Marek Vasut | 721307e | 2022-12-20 07:25:59 +0100 | [diff] [blame] | 204 | int i, ret; |
Simon Glass | 3035497 | 2014-04-10 20:01:29 -0600 | [diff] [blame] | 205 | |
| 206 | if (argc < 2) |
| 207 | return CMD_RET_USAGE; |
| 208 | |
| 209 | for (i = 1; i < argc; ++i) { |
| 210 | char *arg; |
| 211 | |
Simon Glass | 00caae6 | 2017-08-03 12:22:12 -0600 | [diff] [blame] | 212 | arg = env_get(argv[i]); |
Simon Glass | 3035497 | 2014-04-10 20:01:29 -0600 | [diff] [blame] | 213 | if (arg == NULL) { |
| 214 | printf("## Error: \"%s\" not defined\n", argv[i]); |
| 215 | return 1; |
| 216 | } |
| 217 | |
Marek Vasut | 721307e | 2022-12-20 07:25:59 +0100 | [diff] [blame] | 218 | ret = run_command(arg, flag | CMD_FLAG_ENV); |
| 219 | if (ret) |
| 220 | return ret; |
Simon Glass | 3035497 | 2014-04-10 20:01:29 -0600 | [diff] [blame] | 221 | } |
| 222 | return 0; |
| 223 | } |
| 224 | #endif |
Simon Glass | c1bb2cd | 2014-04-10 20:01:34 -0600 | [diff] [blame] | 225 | |
Masahiro Yamada | 0f92582 | 2015-08-12 07:31:55 +0900 | [diff] [blame] | 226 | #if CONFIG_IS_ENABLED(OF_CONTROL) |
Simon Glass | affb215 | 2014-04-10 20:01:35 -0600 | [diff] [blame] | 227 | bool cli_process_fdt(const char **cmdp) |
| 228 | { |
| 229 | /* Allow the fdt to override the boot command */ |
Simon Glass | 7de8bd0 | 2021-08-07 07:24:01 -0600 | [diff] [blame] | 230 | const char *env = ofnode_conf_read_str("bootcmd"); |
Simon Glass | affb215 | 2014-04-10 20:01:35 -0600 | [diff] [blame] | 231 | if (env) |
| 232 | *cmdp = env; |
| 233 | /* |
| 234 | * If the bootsecure option was chosen, use secure_boot_cmd(). |
| 235 | * Always use 'env' in this case, since bootsecure requres that the |
| 236 | * bootcmd was specified in the FDT too. |
| 237 | */ |
Simon Glass | 7de8bd0 | 2021-08-07 07:24:01 -0600 | [diff] [blame] | 238 | return ofnode_conf_read_int("bootsecure", 0); |
Simon Glass | affb215 | 2014-04-10 20:01:35 -0600 | [diff] [blame] | 239 | } |
| 240 | |
| 241 | /* |
| 242 | * Runs the given boot command securely. Specifically: |
| 243 | * - Doesn't run the command with the shell (run_command or parse_string_outer), |
| 244 | * since that's a lot of code surface that an attacker might exploit. |
| 245 | * Because of this, we don't do any argument parsing--the secure boot command |
| 246 | * has to be a full-fledged u-boot command. |
| 247 | * - Doesn't check for keypresses before booting, since that could be a |
| 248 | * security hole; also disables Ctrl-C. |
| 249 | * - Doesn't allow the command to return. |
| 250 | * |
| 251 | * Upon any failures, this function will drop into an infinite loop after |
| 252 | * printing the error message to console. |
| 253 | */ |
| 254 | void cli_secure_boot_cmd(const char *cmd) |
| 255 | { |
Simon Glass | f8bb696 | 2016-03-19 02:18:38 -0600 | [diff] [blame] | 256 | #ifdef CONFIG_CMDLINE |
Simon Glass | 0914011 | 2020-05-10 11:40:03 -0600 | [diff] [blame] | 257 | struct cmd_tbl *cmdtp; |
Simon Glass | f8bb696 | 2016-03-19 02:18:38 -0600 | [diff] [blame] | 258 | #endif |
Simon Glass | affb215 | 2014-04-10 20:01:35 -0600 | [diff] [blame] | 259 | int rc; |
| 260 | |
| 261 | if (!cmd) { |
| 262 | printf("## Error: Secure boot command not specified\n"); |
| 263 | goto err; |
| 264 | } |
| 265 | |
| 266 | /* Disable Ctrl-C just in case some command is used that checks it. */ |
| 267 | disable_ctrlc(1); |
| 268 | |
| 269 | /* Find the command directly. */ |
Simon Glass | f8bb696 | 2016-03-19 02:18:38 -0600 | [diff] [blame] | 270 | #ifdef CONFIG_CMDLINE |
Simon Glass | affb215 | 2014-04-10 20:01:35 -0600 | [diff] [blame] | 271 | cmdtp = find_cmd(cmd); |
| 272 | if (!cmdtp) { |
| 273 | printf("## Error: \"%s\" not defined\n", cmd); |
| 274 | goto err; |
| 275 | } |
| 276 | |
| 277 | /* Run the command, forcing no flags and faking argc and argv. */ |
| 278 | rc = (cmdtp->cmd)(cmdtp, 0, 1, (char **)&cmd); |
| 279 | |
Simon Glass | f8bb696 | 2016-03-19 02:18:38 -0600 | [diff] [blame] | 280 | #else |
| 281 | rc = board_run_command(cmd); |
| 282 | #endif |
| 283 | |
Simon Glass | affb215 | 2014-04-10 20:01:35 -0600 | [diff] [blame] | 284 | /* Shouldn't ever return from boot command. */ |
| 285 | printf("## Error: \"%s\" returned (code %d)\n", cmd, rc); |
| 286 | |
| 287 | err: |
| 288 | /* |
| 289 | * Not a whole lot to do here. Rebooting won't help much, since we'll |
| 290 | * just end up right back here. Just loop. |
| 291 | */ |
| 292 | hang(); |
| 293 | } |
Masahiro Yamada | 0f92582 | 2015-08-12 07:31:55 +0900 | [diff] [blame] | 294 | #endif /* CONFIG_IS_ENABLED(OF_CONTROL) */ |
Simon Glass | affb215 | 2014-04-10 20:01:35 -0600 | [diff] [blame] | 295 | |
Simon Glass | c1bb2cd | 2014-04-10 20:01:34 -0600 | [diff] [blame] | 296 | void cli_loop(void) |
| 297 | { |
Heiko Schocher | b07cc48 | 2019-04-12 12:37:03 +0200 | [diff] [blame] | 298 | bootstage_mark(BOOTSTAGE_ID_ENTER_CLI_LOOP); |
Francis Laniel | 9a06837 | 2023-12-22 22:02:32 +0100 | [diff] [blame] | 299 | #if CONFIG_IS_ENABLED(HUSH_PARSER) |
| 300 | if (gd->flags & GD_FLG_HUSH_MODERN_PARSER) |
| 301 | parse_and_run_file(); |
| 302 | else if (gd->flags & GD_FLG_HUSH_OLD_PARSER) |
| 303 | parse_file_outer(); |
| 304 | |
| 305 | printf("Problem\n"); |
Simon Glass | c1bb2cd | 2014-04-10 20:01:34 -0600 | [diff] [blame] | 306 | /* This point is never reached */ |
| 307 | for (;;); |
Stefan Roese | 30eae26 | 2016-04-04 16:32:15 +0200 | [diff] [blame] | 308 | #elif defined(CONFIG_CMDLINE) |
Simon Glass | c1bb2cd | 2014-04-10 20:01:34 -0600 | [diff] [blame] | 309 | cli_simple_loop(); |
Simon Glass | f8bb696 | 2016-03-19 02:18:38 -0600 | [diff] [blame] | 310 | #else |
| 311 | printf("## U-Boot command line is disabled. Please enable CONFIG_CMDLINE\n"); |
Masahiro Yamada | f1f9d4f | 2016-06-21 02:11:19 +0900 | [diff] [blame] | 312 | #endif /*CONFIG_HUSH_PARSER*/ |
Simon Glass | c1bb2cd | 2014-04-10 20:01:34 -0600 | [diff] [blame] | 313 | } |
| 314 | |
| 315 | void cli_init(void) |
| 316 | { |
Masahiro Yamada | f1f9d4f | 2016-06-21 02:11:19 +0900 | [diff] [blame] | 317 | #ifdef CONFIG_HUSH_PARSER |
Francis Laniel | 9a06837 | 2023-12-22 22:02:32 +0100 | [diff] [blame] | 318 | /* This if block is used to initialize hush parser gd flag. */ |
Francis Laniel | 6bb39f5 | 2023-12-22 22:02:31 +0100 | [diff] [blame] | 319 | if (!(gd->flags & GD_FLG_HUSH_OLD_PARSER) |
Francis Laniel | 9a06837 | 2023-12-22 22:02:32 +0100 | [diff] [blame] | 320 | && !(gd->flags & GD_FLG_HUSH_MODERN_PARSER)) { |
| 321 | if (CONFIG_IS_ENABLED(HUSH_OLD_PARSER)) |
| 322 | gd->flags |= GD_FLG_HUSH_OLD_PARSER; |
| 323 | else if (CONFIG_IS_ENABLED(HUSH_MODERN_PARSER)) |
| 324 | gd->flags |= GD_FLG_HUSH_MODERN_PARSER; |
| 325 | } |
| 326 | |
| 327 | if (gd->flags & GD_FLG_HUSH_OLD_PARSER) { |
| 328 | u_boot_hush_start(); |
| 329 | } else if (gd->flags & GD_FLG_HUSH_MODERN_PARSER) { |
| 330 | u_boot_hush_start_modern(); |
| 331 | } else { |
| 332 | printf("No valid hush parser to use, cli will not initialized!\n"); |
| 333 | return; |
| 334 | } |
Simon Glass | c1bb2cd | 2014-04-10 20:01:34 -0600 | [diff] [blame] | 335 | #endif |
| 336 | |
| 337 | #if defined(CONFIG_HUSH_INIT_VAR) |
| 338 | hush_init_var(); |
| 339 | #endif |
Heinrich Schuchardt | d2e4b2f | 2024-03-29 17:09:22 +0100 | [diff] [blame] | 340 | |
| 341 | if (CONFIG_IS_ENABLED(VIDEO_ANSI)) |
| 342 | printf(ANSI_CURSOR_SHOW "\n"); |
Simon Glass | c1bb2cd | 2014-04-10 20:01:34 -0600 | [diff] [blame] | 343 | } |