diff mbox series

[RFC,v7,09/23] cli: Add menu for hush parser

Message ID 20230330194716.23623-10-francis.laniel@amarulasolutions.com
State RFC
Delegated to: Tom Rini
Headers show
Series Modernize U-Boot shell | expand

Commit Message

Francis Laniel March 30, 2023, 7:46 p.m. UTC
For the moment, the menu contains only entry: HUSH_OLD_PARSER which is the
default.
The goal is to prepare the field to add a new hush parser which guarantees
actual behavior is still correct.

Signed-off-by: Francis Laniel <francis.laniel@amarulasolutions.com>
---
 cmd/Kconfig     | 21 +++++++++++++++++++++
 common/Makefile |  3 ++-
 2 files changed, 23 insertions(+), 1 deletion(-)

Comments

Simon Glass April 1, 2023, 6:32 a.m. UTC | #1
On Fri, 31 Mar 2023 at 08:48, Francis Laniel
<francis.laniel@amarulasolutions.com> wrote:
>
> For the moment, the menu contains only entry: HUSH_OLD_PARSER which is the
> default.

It seems to contain both with this patch?

> The goal is to prepare the field to add a new hush parser which guarantees
> actual behavior is still correct.
>
> Signed-off-by: Francis Laniel <francis.laniel@amarulasolutions.com>
> ---
>  cmd/Kconfig     | 21 +++++++++++++++++++++
>  common/Makefile |  3 ++-
>  2 files changed, 23 insertions(+), 1 deletion(-)

Reviewed-by: Simon Glass <sjg@chromium.org>
diff mbox series

Patch

diff --git a/cmd/Kconfig b/cmd/Kconfig
index 2caa4af71c..1b9d04680d 100644
--- a/cmd/Kconfig
+++ b/cmd/Kconfig
@@ -23,6 +23,27 @@  config HUSH_PARSER
 	  If disabled, you get the old, much simpler behaviour with a somewhat
 	  smaller memory footprint.
 
+menu "Hush flavor to use"
+	depends on HUSH_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.
+
+		  It is actually the default U-Boot shell when decided to use hush as shell.
+
+	config HUSH_2021_PARSER
+		bool "Use hush 2021 parser"
+		help
+		  This option enables the new flavor of hush based on hush Busybox from
+		  2021.
+
+		  For the moment, it is highly experimental and should be used at own risks.
+endmenu
+
 config CMDLINE_EDITING
 	bool "Enable command line editing"
 	depends on CMDLINE
diff --git a/common/Makefile b/common/Makefile
index a50302d8b5..ddb89306ee 100644
--- a/common/Makefile
+++ b/common/Makefile
@@ -8,7 +8,8 @@  ifndef CONFIG_SPL_BUILD
 obj-y += init/
 obj-y += main.o
 obj-y += exports.o
-obj-$(CONFIG_HUSH_PARSER) += cli_hush.o
+obj-$(CONFIG_HUSH_OLD_PARSER) += cli_hush.o
+obj-$(CONFIG_HUSH_2021_PARSER) += cli_hush_2021.o
 obj-$(CONFIG_AUTOBOOT) += autoboot.o
 
 # # boards