aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Rini <trini@konsulko.com>2022-04-20 15:28:10 -0400
committerTom Rini <trini@konsulko.com>2022-04-20 15:33:21 -0400
commit0eae144ef84e7190b3c2da5fbd745468f7d1f7e6 (patch)
tree19bf0a1ca01e15f8086343c4e2bb5a9453554f14
parentd7aab1951e06a2de729e2ccb867b76f485cc2fdb (diff)
downloadu-boot-RFC/v3-modernize-u-boot-shell.zip
u-boot-RFC/v3-modernize-u-boot-shell.tar.gz
u-boot-RFC/v3-modernize-u-boot-shell.tar.bz2
HACK: Make new HUSH defaultRFC/v3-modernize-u-boot-shell
Signed-off-by: Tom Rini <trini@konsulko.com>
-rw-r--r--cmd/Kconfig7
-rw-r--r--common/cli_hush_2021.c6
-rw-r--r--common/cli_hush_upstream.c5
3 files changed, 7 insertions, 11 deletions
diff --git a/cmd/Kconfig b/cmd/Kconfig
index 3454229..d0fb264 100644
--- a/cmd/Kconfig
+++ b/cmd/Kconfig
@@ -23,12 +23,13 @@ config HUSH_PARSER
If disabled, you get the old, much simpler behaviour with a somewhat
smaller memory footprint.
-menu "Hush flavor to use"
+choice
+ prompt "Hush flavor to use"
depends on HUSH_PARSER
+ default HUSH_2021_PARSER
config HUSH_OLD_PARSER
bool "Use hush old parser"
- default y
help
This option enables the old flavor of hush based on hush Busybox from
2005.
@@ -42,7 +43,7 @@ menu "Hush flavor to use"
2021.
For the moment, it is highly experimental and should be used at own risks.
-endmenu
+endchoice
config CMDLINE_EDITING
bool "Enable command line editing"
diff --git a/common/cli_hush_2021.c b/common/cli_hush_2021.c
index 68b2fa4..0b1ef6d 100644
--- a/common/cli_hush_2021.c
+++ b/common/cli_hush_2021.c
@@ -40,12 +40,6 @@
#define USE_FOR_NOMMU(...) __VA_ARGS__
#define USE_FOR_MMU(...)
-/* TODO: Drop this before upstreaming */
-#ifdef CONFIG_SYS_PROMPT
-#undef CONFIG_SYS_PROMPT
-#define CONFIG_SYS_PROMPT "2021> "
-#endif /* CONFIG_SYS_PROMPT */
-
/*
* Size-saving "small" ints (arch-dependent)
*/
diff --git a/common/cli_hush_upstream.c b/common/cli_hush_upstream.c
index e468758..2a659dc 100644
--- a/common/cli_hush_upstream.c
+++ b/common/cli_hush_upstream.c
@@ -1448,6 +1448,7 @@ static void xxfree(void *ptr)
* HUSH_DEBUG >= 2 prints line number in this file where it was detected.
*/
#if HUSH_DEBUG < 2
+#include <linux/compiler.h>
# define msg_and_die_if_script(lineno, ...) msg_and_die_if_script(__VA_ARGS__)
# define syntax_error(lineno, msg) syntax_error(msg)
# define syntax_error_at(lineno, msg) syntax_error_at(msg)
@@ -1465,7 +1466,7 @@ static void die_if_script(void)
}
}
-static void msg_and_die_if_script(unsigned lineno, const char *fmt, ...)
+static void __maybe_unused msg_and_die_if_script(unsigned lineno, const char *fmt, ...)
{
va_list p;
@@ -1539,7 +1540,7 @@ static void syntax_error_unexpected_ch(unsigned lineno UNUSED_PARAM, int ch)
/* Replace each \x with x in place, return ptr past NUL. */
static char *unbackslash(char *src)
{
- char *dst = src = strchrnul(src, '\\');
+ char *dst = src = (char *)strchrnul(src, '\\');
while (1) {
if (*src == '\\') {
src++;