Re: [PATCH v13 00/24] Modernize U-Boot shell

2024-01-17 Thread Francis Laniel
Hi! Le mercredi 17 janvier 2024, 17:05:28 +07 Patrice CHOTARD a écrit : > On 1/16/24 18:25, Francis Laniel wrote: > > Hi! > > > > Le mardi 16 janvier 2024, 00:34:24 +07 Patrice CHOTARD a écrit : > >> On 1/11/24 18:04, Francesco Dolcini wrote: > >>> Hell

Re: [PATCH v13 00/24] Modernize U-Boot shell

2024-01-16 Thread Francis Laniel
Hi! Le mardi 16 janvier 2024, 00:34:24 +07 Patrice CHOTARD a écrit : > On 1/11/24 18:04, Francesco Dolcini wrote: > > Hello Tom, Francis > > > > On Fri, Dec 29, 2023 at 07:55:37PM +0100, Francis Laniel wrote: > >> Le jeudi 28 décembre 2023, 21:58:59 CET Tom Rini

Re: [PATCH v13 00/24] Modernize U-Boot shell

2024-01-16 Thread Francis Laniel
Hi! Le vendredi 12 janvier 2024, 00:04:18 +07 Francesco Dolcini a écrit : > Hello Tom, Francis > > On Fri, Dec 29, 2023 at 07:55:37PM +0100, Francis Laniel wrote: > > Le jeudi 28 décembre 2023, 21:58:59 CET Tom Rini a écrit : > > > On Fri, 22 Dec 2023 22:02:20 +01

Re: [PATCH v13 00/24] Modernize U-Boot shell

2023-12-29 Thread Francis Laniel
Le jeudi 28 décembre 2023, 21:58:59 CET Tom Rini a écrit : > On Fri, 22 Dec 2023 22:02:20 +0100, Francis Laniel wrote: > > During 2021 summer, Sean Anderson wrote a contribution to add a new shell, > > based on LIL, to U-Boot [1, 2]. > > While one of the goals of this contri

Re: [PATCH v13 15/24] cli: add modern hush as parser for run_command*()

2023-12-29 Thread Francis Laniel
Hi! Le mardi 26 décembre 2023, 10:46:48 CET Simon Glass a écrit : > Hi, > > On Fri, Dec 22, 2023 at 9:23 PM Tom Rini wrote: > > On Fri, Dec 22, 2023 at 10:10:42PM +0100, Francis Laniel wrote: > > > Hi! > > > > > > Le vendredi 22 décembre

Re: [PATCH v13 15/24] cli: add modern hush as parser for run_command*()

2023-12-22 Thread Francis Laniel
Hi! Le vendredi 22 décembre 2023, 22:02:35 CET Francis Laniel a écrit : > Enables using, in code, modern hush as parser for run_command function > family. It also enables the command run to be used by CLI user of modern > hush. > > Reviewed-by: Simon Glass > Signed-off-

[PATCH v13 24/24] configs: Use old hush for several boards

2023-12-22 Thread Francis Laniel
to stick with old hush. Cc: Holger Brunck Link: https://marc.info/?l=u-boot=165541917618725=2 Signed-off-by: Francis Laniel --- configs/kmcent2_defconfig | 1 + configs/kmcoge5ne_defconfig| 1 + configs/kmeter1_defconfig | 1 + configs/kmopti2_defconfig

[PATCH v13 23/24] cmd: Set modern hush as default shell

2023-12-22 Thread Francis Laniel
Signed-off-by: Francis Laniel --- cmd/Kconfig | 6 +- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/cmd/Kconfig b/cmd/Kconfig index e25578cde3..26ad03 100644 --- a/cmd/Kconfig +++ b/cmd/Kconfig @@ -27,21 +27,17 @@ depends on HUSH_PARSER config HUSH_OLD_PARSER

[PATCH v13 22/24] cli: modern_hush: Add upstream commits up to 2nd October 2023.

2023-12-22 Thread Francis Laniel
ly shrinks") 7c3e96d4b3d4 ("shell: use more compact SHELL_ASH / HUSH config defines. no code changes") 62f1eed1e191 ("hush: in a comment, document what -i might be doing") aaf3d5ba74c5 ("shell: tweak --help") db5546ca1018 ("libbb: code s

[PATCH v13 21/24] test: hush: Fix loop tests for modern hush

2023-12-22 Thread Francis Laniel
Modifies return code got from while loop as modern hush always returns 0 from while loop. Reviewed-by: Simon Glass Signed-off-by: Francis Laniel --- test/hush/loop.c | 34 ++ 1 file changed, 30 insertions(+), 4 deletions(-) diff --git a/test/hush/loop.c b/test

[PATCH v13 20/24] cli: hush_modern: Enable loops

2023-12-22 Thread Francis Laniel
Enables the use of for, while and until loops for command line as well as with run_command(). Signed-off-by: Francis Laniel Reviewed-by: Simon Glass --- common/cli_hush_modern.c | 1 + common/cli_hush_upstream.c | 15 ++- 2 files changed, 15 insertions(+), 1 deletion(-) diff

[PATCH v13 19/24] cli: hush_modern: Enable if keyword

2023-12-22 Thread Francis Laniel
Adds support for "if then else" construct both for command line interface and through run_command(). Signed-off-by: Francis Laniel Reviewed-by: Simon Glass --- common/cli_hush_modern.c | 11 +++ common/cli_hush_upstream.c | 12 2 files changed, 15 insert

[PATCH v13 18/24] cli: hush_modern: Enable using < and > as string compare operators

2023-12-22 Thread Francis Laniel
tick to upstream Busybox behavior. Signed-off-by: Francis Laniel Reviewed-by: Simon Glass --- common/cli_hush_upstream.c | 23 ++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/common/cli_hush_upstream.c b/common/cli_hush_upstream.c index 11870c51e8..a56ea6

[PATCH v13 17/24] test: hush: Fix variable expansion tests for modern hush

2023-12-22 Thread Francis Laniel
Modifies the expected result for modern hush. Indeed, there were bugs in actual U-Boot hush which were fixed in upstream Busybox. As modern hush is based on upstream Busybox, these bugs no longer exist. Reviewed-by: Simon Glass Signed-off-by: Francis Laniel --- test/hush/dollar.c | 79

[PATCH v13 16/24] test: hush: Fix instructions list tests for modern hush

2023-12-22 Thread Francis Laniel
Modifies the expected result for modern hush. Indeed, there were bugs in actual U-Boot hush which were fixed in upstream Busybox. As modern hush is based on upstream Busybox, these bugs no longer exist. Reviewed-by: Simon Glass Signed-off-by: Francis Laniel --- test/hush/list.c | 69

[PATCH v13 15/24] cli: add modern hush as parser for run_command*()

2023-12-22 Thread Francis Laniel
Enables using, in code, modern hush as parser for run_command function family. It also enables the command run to be used by CLI user of modern hush. Reviewed-by: Simon Glass Signed-off-by: Francis Laniel --- common/cli.c | 67 -- common

[PATCH v13 13/24] cli: hush_modern: Enable variables expansion for modern hush

2023-12-22 Thread Francis Laniel
Enables variables expansion for modern hush, both for local and environment variables. So the following commands: foo=bar echo $foo setenv bar foo echo $bar leads to "bar" and "foo" being printed on console output. Signed-off-by: Francis Laniel Reviewed-by: Simo

[PATCH v13 14/24] cli: hush_modern: Add functions to be called from run_command()

2023-12-22 Thread Francis Laniel
run_command() is called internally by the command run and it can also be called directly from U-Boot code, e.g. to do unit tests. This commit adds this path to go to modern hush. Signed-off-by: Francis Laniel Reviewed-by: Simon Glass --- common/cli_hush_upstream.c | 66

[PATCH v13 12/24] cli: Enables using modern hush parser as command line parser

2023-12-22 Thread Francis Laniel
If one defines HUSH_MODERN_PARSER, it is then possible to use modern parser with: => cli get old => cli set modern => cli get modern Reviewed-by: Simon Glass Signed-off-by: Francis Laniel --- cmd/Kconfig | 12 cmd/Makefile | 2 +-

[PATCH v13 11/24] cmd: Add new cli command

2023-12-22 Thread Francis Laniel
This command can be used to print the current parser with 'cli get'. It can also be used to set the current parser with 'cli set'. For the moment, only one value is valid for set: old. Signed-off-by: Francis Laniel --- cmd/Makefile | 2 + cmd/cli.c | 114

[PATCH v13 10/24] global_data.h: add GD_FLG_HUSH_OLD_PARSER flag

2023-12-22 Thread Francis Laniel
This flag is used to indicate we are using the hush parser. Reviewed-by: Simon Glass Signed-off-by: Francis Laniel --- common/cli.c | 2 ++ include/asm-generic/global_data.h | 4 2 files changed, 6 insertions(+) diff --git a/common/cli.c b/common/cli.c index

[PATCH v13 08/24] cli: Port upstream Busybox hush to U-Boot

2023-12-22 Thread Francis Laniel
-off-by: Francis Laniel Signed-off-by: Harald Seiler --- common/cli_hush_modern.c | 274 common/cli_hush_upstream.c | 502 - 2 files changed, 774 insertions(+), 2 deletions(-) create mode 100644 common/cli_hush_modern.c diff --git

[PATCH v13 09/24] cli: Add menu for hush parser

2023-12-22 Thread Francis Laniel
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. Reviewed-by: Simon Glass Signed-off-by: Francis Laniel --- cmd/Kconfig | 13 + common

[PATCH v13 06/24] test: hush: Test hush loops

2023-12-22 Thread Francis Laniel
The added tests verifies correct behavior of for, while and until loops. Signed-off-by: Francis Laniel Reviewed-by: Simon Glass --- test/hush/Makefile | 1 + test/hush/loop.c | 65 ++ 2 files changed, 66 insertions(+) create mode 100644 test/hush

[PATCH v13 05/24] test: hush: Test hush commands list

2023-12-22 Thread Francis Laniel
Verifies behavior of commands separated by ';', '&&' and '||'. Signed-off-by: Francis Laniel Reviewed-by: Simon Glass --- test/hush/Makefile | 1 + test/hush/list.c | 79 ++ 2 files changed, 80 insertions(+) create mode 100644 test/hus

[PATCH v13 04/24] test: hush: Test hush variable expansion

2023-12-22 Thread Francis Laniel
Verifies shell variables are replaced by their values. Reviewed-by: Simon Glass Signed-off-by: Francis Laniel --- test/hush/Makefile | 1 + test/hush/dollar.c | 167 +++ test/py/tests/test_ut.py | 8 +- 3 files changed, 175 insertions(+), 1

[PATCH v13 03/24] test/py: hush_if_test: Remove the test file

2023-12-22 Thread Francis Laniel
5804ebfeb1ce ("test: hush: Test hush if/else") translated this test to a C test, so this python file is no more needed. Signed-off-by: Francis Laniel Reviewed-by: Simon Glass --- test/py/tests/test_hush_if_test.py | 197 - 1 file changed, 197 deletions(

[PATCH v13 02/24] test: hush: Test hush if/else

2023-12-22 Thread Francis Laniel
As asked in commit 9c6bf1715f6a ("test/py: hush_if_test: Add tests to cover octal/hex values"), this commit translates test_hush_if_test.py to a C test. Signed-off-by: Francis Laniel Reviewed-by: Simon Glass --- test/hush/Makefile | 1 + test/hush/if.c

[PATCH v13 01/24] test: Add framework to test hush behavior

2023-12-22 Thread Francis Laniel
Introduce a new subcommand to ut: ut hush. For the moment, this command does nothing, future commits will add tests which will be run on command call. Note that CONFIG_HUSH_PARSER must be defined to compile this new subcommand. Signed-off-by: Francis Laniel Reviewed-by: Simon Glass

[PATCH v13 00/24] Modernize U-Boot shell

2023-12-22 Thread Francis Laniel
d. * Add new CONFIG_HUSH_SELECTABLE to only build cli command if the two shell flavors are selected. v11: * Renamed everything containing 2021 to modern. * Fixed cmd Kconfig indentation. * Set modern parser as default for majority of boards except some. v12: * Rebased on top of 36d3db6

Re: [PATCH v12 00/24] Modernize U-Boot shell

2023-12-12 Thread Francis Laniel
Hi! Le dimanche 10 décembre 2023, 00:16:31 CET Tom Rini a écrit : > On Fri, Dec 08, 2023 at 11:30:01PM +0100, Francis Laniel wrote: > > Hi. > > > > > > During 2021 summer, Sean Anderson wrote a contribution to add a new shell, > > based on LIL, to U-Boot [

[PATCH v12 24/24] configs: Use old hush for several boards

2023-12-08 Thread Francis Laniel
to stick with old hush. Cc: Holger Brunck Link: https://marc.info/?l=u-boot=165541917618725=2 Signed-off-by: Francis Laniel --- configs/kmcent2_defconfig | 1 + configs/kmcoge5ne_defconfig| 1 + configs/kmeter1_defconfig | 1 + configs/kmopti2_defconfig

[PATCH v12 22/24] cli: modern_hush: Add upstream commits up to 2nd October 2023.

2023-12-08 Thread Francis Laniel
ly shrinks") 7c3e96d4b3d4 ("shell: use more compact SHELL_ASH / HUSH config defines. no code changes") 62f1eed1e191 ("hush: in a comment, document what -i might be doing") aaf3d5ba74c5 ("shell: tweak --help") db5546ca1018 ("libbb: code s

[PATCH v12 23/24] cmd: Set modern hush as default shell

2023-12-08 Thread Francis Laniel
Signed-off-by: Francis Laniel --- cmd/Kconfig | 6 +- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/cmd/Kconfig b/cmd/Kconfig index 8b49a97aca..c9d4375ebb 100644 --- a/cmd/Kconfig +++ b/cmd/Kconfig @@ -28,21 +28,17 @@ depends on HUSH_PARSER config HUSH_OLD_PARSER

[PATCH v12 21/24] test: hush: Fix loop tests for modern hush

2023-12-08 Thread Francis Laniel
Modifies return code got from while loop as modern hush always returns 0 from while loop. Reviewed-by: Simon Glass Signed-off-by: Francis Laniel --- test/hush/loop.c | 34 ++ 1 file changed, 30 insertions(+), 4 deletions(-) diff --git a/test/hush/loop.c b/test

[PATCH v12 15/24] cli: add modern hush as parser for run_command*()

2023-12-08 Thread Francis Laniel
Enables using, in code, modern hush as parser for run_command function family. It also enables the command run to be used by CLI user of modern hush. Reviewed-by: Simon Glass Signed-off-by: Francis Laniel --- common/cli.c | 67 -- common

[PATCH v12 20/24] cli: hush_modern: Enable loops

2023-12-08 Thread Francis Laniel
Enables the use of for, while and until loops for command line as well as with run_command(). Signed-off-by: Francis Laniel Reviewed-by: Simon Glass --- common/cli_hush_modern.c | 1 + common/cli_hush_upstream.c | 15 ++- 2 files changed, 15 insertions(+), 1 deletion(-) diff

[PATCH v12 17/24] test: hush: Fix variable expansion tests for modern hush

2023-12-08 Thread Francis Laniel
Modifies the expected result for modern hush. Indeed, there were bugs in actual U-Boot hush which were fixed in upstream Busybox. As modern hush is based on upstream Busybox, these bugs no longer exist. Reviewed-by: Simon Glass Signed-off-by: Francis Laniel --- test/hush/dollar.c | 79

[PATCH v12 19/24] cli: hush_modern: Enable if keyword

2023-12-08 Thread Francis Laniel
Adds support for "if then else" construct both for command line interface and through run_command(). Signed-off-by: Francis Laniel Reviewed-by: Simon Glass --- common/cli_hush_modern.c | 11 +++ common/cli_hush_upstream.c | 12 2 files changed, 15 insert

[PATCH v12 18/24] cli: hush_modern: Enable using < and > as string compare operators

2023-12-08 Thread Francis Laniel
tick to upstream Busybox behavior. Signed-off-by: Francis Laniel Reviewed-by: Simon Glass --- common/cli_hush_upstream.c | 23 ++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/common/cli_hush_upstream.c b/common/cli_hush_upstream.c index 11870c51e8..a56ea6

[PATCH v12 14/24] cli: hush_modern: Add functions to be called from run_command()

2023-12-08 Thread Francis Laniel
run_command() is called internally by the command run and it can also be called directly from U-Boot code, e.g. to do unit tests. This commit adds this path to go to modern hush. Signed-off-by: Francis Laniel Reviewed-by: Simon Glass --- common/cli_hush_upstream.c | 66

[PATCH v12 16/24] test: hush: Fix instructions list tests for modern hush

2023-12-08 Thread Francis Laniel
Modifies the expected result for modern hush. Indeed, there were bugs in actual U-Boot hush which were fixed in upstream Busybox. As modern hush is based on upstream Busybox, these bugs no longer exist. Reviewed-by: Simon Glass Signed-off-by: Francis Laniel --- test/hush/list.c | 69

[PATCH v12 13/24] cli: hush_modern: Enable variables expansion for modern hush

2023-12-08 Thread Francis Laniel
Enables variables expansion for modern hush, both for local and environment variables. So the following commands: foo=bar echo $foo setenv bar foo echo $bar leads to "bar" and "foo" being printed on console output. Signed-off-by: Francis Laniel Reviewed-by: Simo

[PATCH v12 12/24] cli: Enables using modern hush parser as command line parser

2023-12-08 Thread Francis Laniel
If one defines HUSH_MODERN_PARSER, it is then possible to use modern parser with: => cli get old => cli set modern => cli get modern Reviewed-by: Simon Glass Signed-off-by: Francis Laniel --- cmd/Kconfig | 12 cmd/Makefile | 2 +-

[PATCH v12 11/24] cmd: Add new cli command

2023-12-08 Thread Francis Laniel
This command can be used to print the current parser with 'cli get'. It can also be used to set the current parser with 'cli set'. For the moment, only one value is valid for set: old. Signed-off-by: Francis Laniel --- cmd/Makefile | 2 + cmd/cli.c | 114

[PATCH v12 10/24] global_data.h: add GD_FLG_HUSH_OLD_PARSER flag

2023-12-08 Thread Francis Laniel
This flag is used to indicate we are using the hush parser. Reviewed-by: Simon Glass Signed-off-by: Francis Laniel --- common/cli.c | 2 ++ include/asm-generic/global_data.h | 4 2 files changed, 6 insertions(+) diff --git a/common/cli.c b/common/cli.c index

[PATCH v12 09/24] cli: Add menu for hush parser

2023-12-08 Thread Francis Laniel
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. Reviewed-by: Simon Glass Signed-off-by: Francis Laniel --- cmd/Kconfig | 13 + common

[PATCH v12 08/24] cli: Port upstream Busybox hush to U-Boot

2023-12-08 Thread Francis Laniel
-off-by: Francis Laniel Signed-off-by: Harald Seiler --- common/cli_hush_modern.c | 274 common/cli_hush_upstream.c | 502 - 2 files changed, 774 insertions(+), 2 deletions(-) create mode 100644 common/cli_hush_modern.c diff --git

[PATCH v12 06/24] test: hush: Test hush loops

2023-12-08 Thread Francis Laniel
The added tests verifies correct behavior of for, while and until loops. Signed-off-by: Francis Laniel Reviewed-by: Simon Glass --- test/hush/Makefile | 1 + test/hush/loop.c | 65 ++ 2 files changed, 66 insertions(+) create mode 100644 test/hush

[PATCH v12 05/24] test: hush: Test hush commands list

2023-12-08 Thread Francis Laniel
Verifies behavior of commands separated by ';', '&&' and '||'. Signed-off-by: Francis Laniel Reviewed-by: Simon Glass --- test/hush/Makefile | 1 + test/hush/list.c | 79 ++ 2 files changed, 80 insertions(+) create mode 100644 test/hus

[PATCH v12 04/24] test: hush: Test hush variable expansion

2023-12-08 Thread Francis Laniel
Verifies shell variables are replaced by their values. Reviewed-by: Simon Glass Signed-off-by: Francis Laniel --- test/hush/Makefile | 1 + test/hush/dollar.c | 167 +++ test/py/tests/test_ut.py | 8 +- 3 files changed, 175 insertions(+), 1

[PATCH v12 03/24] test/py: hush_if_test: Remove the test file

2023-12-08 Thread Francis Laniel
5804ebfeb1ce ("test: hush: Test hush if/else") translated this test to a C test, so this python file is no more needed. Signed-off-by: Francis Laniel Reviewed-by: Simon Glass --- test/py/tests/test_hush_if_test.py | 197 - 1 file changed, 197 deletions(

[PATCH v12 02/24] test: hush: Test hush if/else

2023-12-08 Thread Francis Laniel
As asked in commit 9c6bf1715f6a ("test/py: hush_if_test: Add tests to cover octal/hex values"), this commit translates test_hush_if_test.py to a C test. Signed-off-by: Francis Laniel Reviewed-by: Simon Glass --- test/hush/Makefile | 1 + test/hush/if.c

[PATCH v12 01/24] test: Add framework to test hush behavior

2023-12-08 Thread Francis Laniel
Introduce a new subcommand to ut: ut hush. For the moment, this command does nothing, future commits will add tests which will be run on command call. Note that CONFIG_HUSH_PARSER must be defined to compile this new subcommand. Signed-off-by: Francis Laniel Reviewed-by: Simon Glass

[PATCH v12 00/24] Modernize U-Boot shell

2023-12-08 Thread Francis Laniel
d. * Add new CONFIG_HUSH_SELECTABLE to only build cli command if the two shell flavors are selected. v11: * Renamed everything containing 2021 to modern. * Fixed cmd Kconfig indentation. * Set modern parser as default for majority of boards except some. Francis Laniel (24): test: Add

[PATCH v11 12/24] cli: Enables using hush 2021 parser as command line parser

2023-11-07 Thread Francis Laniel
If one defines HUSH_2021_PARSER, it is then possible to use 2021 parser with: => cli get old => cli set 2021 => cli get 2021 Reviewed-by: Simon Glass Signed-off-by: Francis Laniel --- cmd/Kconfig | 12 cmd/Makefile | 2 +-

Re: [RFC PATCH v10 00/24] Modernize U-Boot shell

2023-11-07 Thread Francis Laniel
Hi! Le lundi 9 octobre 2023, 20:56:30 EET Simon Glass a écrit : > Hi Francis, > > On Wed, 4 Oct 2023 at 10:42, Francis Laniel < > > francis.lan...@amarulasolutions.com> wrote: > > Hi. > > > > > > During 2021 summer, Sean Anderson wrote

Re: [RFC PATCH v10 11/24] cmd: Add new cli command

2023-11-07 Thread Francis Laniel
Hi! Le jeudi 5 octobre 2023, 02:26:52 EET Heinrich Schuchardt a écrit : > On 10/4/23 18:42, Francis Laniel wrote: > > This command can be used to print the current parser with 'cli print'. > > Please, provide a commit message that matches the code. > > > It can also be

[PATCH v11 24/24] DO NOT MERGE: ci: Build the world in any case.

2023-11-07 Thread Francis Laniel
The CI can fails previously for reasons which are not tied to hush 2021. Let's build the world in any case to check everything is OK there too. Signed-off-by: Francis Laniel --- .azure-pipelines.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.azure-pipelines.yml b/.azure-pipelines.yml

[PATCH v11 23/24] DO NOT MERGE: only to make CI happy

2023-11-07 Thread Francis Laniel
future for commit object. Acked-by: Tony Dinh Signed-off-by: Francis Laniel [1] https://marc.info/?l=u-boot=165541917618725=2 --- cmd/Kconfig | 3 ++- common/cli_hush_upstream.c | 1 - configs/sheevaplug_defconfig | 1 + tools/patman/series.py | 4 4 files changed

[PATCH v11 22/24] cli: hush_2021: Add upstream commits up to 2nd October 2023.

2023-11-07 Thread Francis Laniel
ly shrinks") 7c3e96d4b3d4 ("shell: use more compact SHELL_ASH / HUSH config defines. no code changes") 62f1eed1e191 ("hush: in a comment, document what -i might be doing") aaf3d5ba74c5 ("shell: tweak --help") db5546ca1018 ("libbb: code s

[PATCH v11 21/24] test: hush: Fix loop tests for hush 2021

2023-11-07 Thread Francis Laniel
Modifies return code got from while loop as hush 2021 always returns 0 from while loop. Reviewed-by: Simon Glass Signed-off-by: Francis Laniel --- test/hush/loop.c | 34 ++ 1 file changed, 30 insertions(+), 4 deletions(-) diff --git a/test/hush/loop.c b/test

[PATCH v11 20/24] cli: hush_2021: Enable loops

2023-11-07 Thread Francis Laniel
Enables the use of for, while and until loops for command line as well as with run_command(). Signed-off-by: Francis Laniel Reviewed-by: Simon Glass --- common/cli_hush_2021.c | 1 + common/cli_hush_upstream.c | 15 ++- 2 files changed, 15 insertions(+), 1 deletion(-) diff

[PATCH v11 19/24] cli: hush_2021: Enable if keyword

2023-11-07 Thread Francis Laniel
Adds support for "if then else" construct both for command line interface and through run_command(). Signed-off-by: Francis Laniel Reviewed-by: Simon Glass --- common/cli_hush_2021.c | 11 +++ common/cli_hush_upstream.c | 12 2 files changed, 15 insert

[PATCH v11 18/24] cli: hush_2021: Enable using < and > as string compare operators

2023-11-07 Thread Francis Laniel
tick to upstream Busybox behavior. Signed-off-by: Francis Laniel Reviewed-by: Simon Glass --- common/cli_hush_upstream.c | 23 ++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/common/cli_hush_upstream.c b/common/cli_hush_upstream.c index dbf77ad503..68a9a4

[PATCH v11 17/24] test: hush: Fix variable expansion tests for hush 2021

2023-11-07 Thread Francis Laniel
Modifies the expected result for hush 2021. Indeed, there were bugs in actual U-Boot hush which were fixed in upstream Busybox. As hush 2021 is based on upstream Busybox, these bugs no longer exist. Reviewed-by: Simon Glass Signed-off-by: Francis Laniel --- test/hush/dollar.c | 79

[PATCH v11 16/24] test: hush: Fix instructions list tests for hush 2021

2023-11-07 Thread Francis Laniel
Modifies the expected result for hush 2021. Indeed, there were bugs in actual U-Boot hush which were fixed in upstream Busybox. As hush 2021 is based on upstream Busybox, these bugs no longer exist. Reviewed-by: Simon Glass Signed-off-by: Francis Laniel --- test/hush/list.c | 69

[PATCH v11 15/24] cli: add hush 2021 as parser for run_command*()

2023-11-07 Thread Francis Laniel
Enables using, in code, hush 2021 as parser for run_command function family. It also enables the command run to be used by CLI user of hush 2021. Reviewed-by: Simon Glass Signed-off-by: Francis Laniel --- common/cli.c | 67 -- common

[PATCH v11 14/24] cli: hush_2021: Add functions to be called from run_command()

2023-11-07 Thread Francis Laniel
run_command() is called internally by the command run and it can also be called directly from U-Boot code, e.g. to do unit tests. This commit adds this path to go to hush 2021. Signed-off-by: Francis Laniel Reviewed-by: Simon Glass --- common/cli_hush_upstream.c | 66

[PATCH v11 13/24] cli: hush_2021: Enable variables expansion for hush 2021

2023-11-07 Thread Francis Laniel
Enables variables expansion for hush 2021, both for local and environment variables. So the following commands: foo=bar echo $foo setenv bar foo echo $bar leads to "bar" and "foo" being printed on console output. Signed-off-by: Francis Laniel Reviewed-by: Simon Glass --- co

[PATCH v11 11/24] cmd: Add new cli command

2023-11-07 Thread Francis Laniel
This command can be used to print the current parser with 'cli get'. It can also be used to set the current parser with 'cli set'. For the moment, only one value is valid for set: old. Signed-off-by: Francis Laniel --- cmd/Makefile | 2 + cmd/cli.c | 114

[PATCH v11 10/24] global_data.h: add GD_FLG_HUSH_OLD_PARSER flag

2023-11-07 Thread Francis Laniel
This flag is used to indicate we are using the hush parser. Reviewed-by: Simon Glass Signed-off-by: Francis Laniel --- common/cli.c | 2 ++ include/asm-generic/global_data.h | 4 2 files changed, 6 insertions(+) diff --git a/common/cli.c b/common/cli.c index

[PATCH v11 08/24] cli: Port Busybox 2021 hush to U-Boot

2023-11-07 Thread Francis Laniel
-by: Francis Laniel Signed-off-by: Harald Seiler --- common/cli_hush_2021.c | 274 common/cli_hush_upstream.c | 501 - 2 files changed, 774 insertions(+), 1 deletion(-) create mode 100644 common/cli_hush_2021.c diff --git a/common

[PATCH v11 09/24] cli: Add menu for hush parser

2023-11-07 Thread Francis Laniel
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. Reviewed-by: Simon Glass Signed-off-by: Francis Laniel --- cmd/Kconfig | 13 + common

[PATCH v11 05/24] test: hush: Test hush commands list

2023-11-07 Thread Francis Laniel
Verifies behavior of commands separated by ';', '&&' and '||'. Signed-off-by: Francis Laniel Reviewed-by: Simon Glass --- test/hush/Makefile | 1 + test/hush/list.c | 79 ++ 2 files changed, 80 insertions(+) create mode 100644 test/hus

[PATCH v11 06/24] test: hush: Test hush loops

2023-11-07 Thread Francis Laniel
The added tests verifies correct behavior of for, while and until loops. Signed-off-by: Francis Laniel Reviewed-by: Simon Glass --- test/hush/Makefile | 1 + test/hush/loop.c | 65 ++ 2 files changed, 66 insertions(+) create mode 100644 test/hush

[PATCH v11 04/24] test: hush: Test hush variable expansion

2023-11-07 Thread Francis Laniel
Verifies shell variables are replaced by their values. Reviewed-by: Simon Glass Signed-off-by: Francis Laniel --- test/hush/Makefile | 1 + test/hush/dollar.c | 167 +++ test/py/tests/test_ut.py | 8 +- 3 files changed, 175 insertions(+), 1

[PATCH v11 03/24] test/py: hush_if_test: Remove the test file

2023-11-07 Thread Francis Laniel
5804ebfeb1ce ("test: hush: Test hush if/else") translated this test to a C test, so this python file is no more needed. Signed-off-by: Francis Laniel Reviewed-by: Simon Glass --- test/py/tests/test_hush_if_test.py | 197 - 1 file changed, 197 deletions(

[PATCH v11 01/24] test: Add framework to test hush behavior

2023-11-07 Thread Francis Laniel
Introduce a new subcommand to ut: ut hush. For the moment, this command does nothing, future commits will add tests which will be run on command call. Note that CONFIG_HUSH_PARSER must be defined to compile this new subcommand. Signed-off-by: Francis Laniel Reviewed-by: Simon Glass

[PATCH v11 02/24] test: hush: Test hush if/else

2023-11-07 Thread Francis Laniel
As asked in commit 9c6bf1715f6a ("test/py: hush_if_test: Add tests to cover octal/hex values"), this commit translates test_hush_if_test.py to a C test. Signed-off-by: Francis Laniel Reviewed-by: Simon Glass --- test/hush/Makefile | 1 + test/hush/if.c

[PATCH v11 00/24] Modernize U-Boot shell

2023-11-07 Thread Francis Laniel
error in commit adding cli command. * Add new CONFIG_HUSH_SELECTABLE to only build cli command if the two shell flavors are selected. Francis Laniel (24): test: Add framework to test hush behavior test: hush: Test hush if/else test/py: hush_if_test: Remove the test file test: hush: Test hus

[RFC PATCH v10 24/24] DO NOT MERGE: ci: Build the world in any case.

2023-10-04 Thread Francis Laniel
The CI can fails previously for reasons which are not tied to hush 2021. Let's build the world in any case to check everything is OK there too. Signed-off-by: Francis Laniel --- .azure-pipelines.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.azure-pipelines.yml b/.azure-pipelines.yml

[RFC PATCH v10 23/24] DO NOT MERGE: only to make CI happy

2023-10-04 Thread Francis Laniel
future for commit object. Acked-by: Tony Dinh Signed-off-by: Francis Laniel [1] https://marc.info/?l=u-boot=165541917618725=2 --- cmd/Kconfig | 3 ++- common/cli_hush_upstream.c | 1 - configs/sheevaplug_defconfig | 1 + tools/patman/series.py | 4 4 files changed

[RFC PATCH v10 22/24] cli: hush_2021: Add upstream commits up to 2nd October 2023.

2023-10-04 Thread Francis Laniel
ly shrinks") 7c3e96d4b3d4 ("shell: use more compact SHELL_ASH / HUSH config defines. no code changes") 62f1eed1e191 ("hush: in a comment, document what -i might be doing") aaf3d5ba74c5 ("shell: tweak --help") db5546ca1018 ("libbb: code s

[RFC PATCH v10 21/24] test: hush: Fix loop tests for hush 2021

2023-10-04 Thread Francis Laniel
Modifies return code got from while loop as hush 2021 always returns 0 from while loop. Reviewed-by: Simon Glass Signed-off-by: Francis Laniel --- test/hush/loop.c | 34 ++ 1 file changed, 30 insertions(+), 4 deletions(-) diff --git a/test/hush/loop.c b/test

[RFC PATCH v10 18/24] cli: hush_2021: Enable using < and > as string compare operators

2023-10-04 Thread Francis Laniel
tick to upstream Busybox behavior. Signed-off-by: Francis Laniel Reviewed-by: Simon Glass --- common/cli_hush_upstream.c | 23 ++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/common/cli_hush_upstream.c b/common/cli_hush_upstream.c index dbf77ad503..68a9a4

[RFC PATCH v10 17/24] test: hush: Fix variable expansion tests for hush 2021

2023-10-04 Thread Francis Laniel
Modifies the expected result for hush 2021. Indeed, there were bugs in actual U-Boot hush which were fixed in upstream Busybox. As hush 2021 is based on upstream Busybox, these bugs no longer exist. Reviewed-by: Simon Glass Signed-off-by: Francis Laniel --- test/hush/dollar.c | 79

[RFC PATCH v10 19/24] cli: hush_2021: Enable if keyword

2023-10-04 Thread Francis Laniel
Adds support for "if then else" construct both for command line interface and through run_command(). Signed-off-by: Francis Laniel Reviewed-by: Simon Glass --- common/cli_hush_2021.c | 11 +++ common/cli_hush_upstream.c | 12 2 files changed, 15 insert

[RFC PATCH v10 20/24] cli: hush_2021: Enable loops

2023-10-04 Thread Francis Laniel
Enables the use of for, while and until loops for command line as well as with run_command(). Signed-off-by: Francis Laniel Reviewed-by: Simon Glass --- common/cli_hush_2021.c | 1 + common/cli_hush_upstream.c | 15 ++- 2 files changed, 15 insertions(+), 1 deletion(-) diff

[RFC PATCH v10 16/24] test: hush: Fix instructions list tests for hush 2021

2023-10-04 Thread Francis Laniel
Modifies the expected result for hush 2021. Indeed, there were bugs in actual U-Boot hush which were fixed in upstream Busybox. As hush 2021 is based on upstream Busybox, these bugs no longer exist. Reviewed-by: Simon Glass Signed-off-by: Francis Laniel --- test/hush/list.c | 69

[RFC PATCH v10 15/24] cli: add hush 2021 as parser for run_command*()

2023-10-04 Thread Francis Laniel
Enables using, in code, hush 2021 as parser for run_command function family. It also enables the command run to be used by CLI user of hush 2021. Reviewed-by: Simon Glass Signed-off-by: Francis Laniel --- common/cli.c | 63 -- common

[RFC PATCH v10 14/24] cli: hush_2021: Add functions to be called from run_command()

2023-10-04 Thread Francis Laniel
run_command() is called internally by the command run and it can also be called directly from U-Boot code, e.g. to do unit tests. This commit adds this path to go to hush 2021. Signed-off-by: Francis Laniel Reviewed-by: Simon Glass --- common/cli_hush_upstream.c | 66

[RFC PATCH v10 13/24] cli: hush_2021: Enable variables expansion for hush 2021

2023-10-04 Thread Francis Laniel
Enables variables expansion for hush 2021, both for local and environment variables. So the following commands: foo=bar echo $foo setenv bar foo echo $bar leads to "bar" and "foo" being printed on console output. Signed-off-by: Francis Laniel Reviewed-by: Simon Glass --- co

[RFC PATCH v10 08/24] cli: Port Busybox 2021 hush to U-Boot

2023-10-04 Thread Francis Laniel
-by: Francis Laniel Signed-off-by: Harald Seiler --- common/cli_hush_2021.c | 274 common/cli_hush_upstream.c | 501 - 2 files changed, 774 insertions(+), 1 deletion(-) create mode 100644 common/cli_hush_2021.c diff --git a/common

[RFC PATCH v10 12/24] cli: Enables using hush 2021 parser as command line parser

2023-10-04 Thread Francis Laniel
If one defines HUSH_2021_PARSER, it is then possible to use 2021 parser with: => cli get old => cli set 2021 => cli get 2021 Reviewed-by: Simon Glass Signed-off-by: Francis Laniel --- cmd/Kconfig | 8 + cmd/cli.c | 7 - common

[RFC PATCH v10 09/24] cli: Add menu for hush parser

2023-10-04 Thread Francis Laniel
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. Reviewed-by: Simon Glass Signed-off-by: Francis Laniel --- cmd/Kconfig | 13 + common

[RFC PATCH v10 10/24] global_data.h: add GD_FLG_HUSH_OLD_PARSER flag

2023-10-04 Thread Francis Laniel
This flag is used to indicate we are using the hush parser. Reviewed-by: Simon Glass Signed-off-by: Francis Laniel --- common/cli.c | 2 ++ include/asm-generic/global_data.h | 4 2 files changed, 6 insertions(+) diff --git a/common/cli.c b/common/cli.c index

[RFC PATCH v10 11/24] cmd: Add new cli command

2023-10-04 Thread Francis Laniel
This command can be used to print the current parser with 'cli print'. It can also be used to set the current parser with 'cli set'. For the moment, only one value is valid for set: old. Signed-off-by: Francis Laniel --- cmd/Makefile | 2 + cmd/cli.c | 120

[RFC PATCH v10 06/24] test: hush: Test hush loops

2023-10-04 Thread Francis Laniel
The added tests verifies correct behavior of for, while and until loops. Signed-off-by: Francis Laniel Reviewed-by: Simon Glass --- test/hush/Makefile | 1 + test/hush/loop.c | 65 ++ 2 files changed, 66 insertions(+) create mode 100644 test/hush

[RFC PATCH v10 05/24] test: hush: Test hush commands list

2023-10-04 Thread Francis Laniel
Verifies behavior of commands separated by ';', '&&' and '||'. Signed-off-by: Francis Laniel Reviewed-by: Simon Glass --- test/hush/Makefile | 1 + test/hush/list.c | 79 ++ 2 files changed, 80 insertions(+) create mode 100644 test/hus

  1   2   3   4   >