[RFC PATCH v1 08/21] cli: Port Busybox 2021 hush to U-Boot.

2021-12-31 Thread Francis Laniel
. Signed-off-by: Francis Laniel Signed-off-by: Harald Seiler --- common/cli_hush_2021.c | 292 common/cli_hush_2021_upstream.c | 470 +++- 2 files changed, 761 insertions(+), 1 deletion(-) create mode 100644 common/cli_hush_2021.c diff

[RFC PATCH v1 10/21] cli: Add HUSH_2021_PARSER to hush parser choice .

2021-12-31 Thread Francis Laniel
To use hush 2021 as U-Boot shell, one should tick "Use hush 2021 parser" under "Hush flavor to use" choice. Since this is a choice, you cannot use at the same time old and new flavor of hush. Signed-off-by: Francis Laniel --- cmd/Kconfig | 8 common/Makefile |

[RFC PATCH v1 09/21] cli: Add choice for hush parser.

2021-12-31 Thread Francis Laniel
For the moment, the choice contains only entry: HUSH_OLD_PARSER which is the default. The goal of this commit is to prepare the field to add a new hush parser and it does not change anything to actual behavior. Signed-off-by: Francis Laniel --- cmd/Kconfig | 14 ++ common

[RFC PATCH v1 05/21] test: hush: Test hush commands list.

2021-12-31 Thread Francis Laniel
This commit ensures behavior of commands separated by ';', '&&' and '||'. Signed-off-by: Francis Laniel --- test/hush/Makefile | 1 + test/hush/list.c | 79 ++ 2 files changed, 80 insertions(+) create mode 100644 test/hush/list.c di

[RFC PATCH v1 04/21] test: hush: Test hush variable expansion.

2021-12-31 Thread Francis Laniel
This commit ensures shell variables are replaced by their values. Signed-off-by: Francis Laniel --- test/hush/Makefile | 1 + test/hush/dollar.c | 191 + 2 files changed, 192 insertions(+) create mode 100644 test/hush/dollar.c diff --git a/test

[RFC PATCH v1 02/21] test: hush: Test hush if/else.

2021-12-31 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 --- test/hush/Makefile | 1 + test/hush/if.c | 308

[RFC PATCH v1 01/21] test: Add framework to test hush behavior.

2021-12-31 Thread Francis Laniel
This commit introduces 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 --- include/test/hush.h

[RFC PATCH v1 00/21] Modernize U-Boot shell

2021-12-31 Thread Francis Laniel
The really good idea of #include'ing Busybox code into a wrapper file to define some particular functions while minimizing modifications to upstream code comes from Harald Seiler. * Other commits focus on enabling features we need (e.g. if). Francis Laniel (21): test: Add framework to test hush be

Re: How should we deal with actual hush odd behavior?

2021-08-31 Thread Francis Laniel
Hi. Le lundi 23 août 2021, 13:20:10 CEST Wolfgang Denk a écrit : > Dear Francis, > > In message <2787647.e9J7NaK4W3@pwmachine> you wrote: > > Porting 2021 Busybox hush to U-Boot seems, for me, to be a good idea as we > > would benefit from Busybox bug fixes as well as being compatible with > >

How should we deal with actual hush odd behavior?

2021-08-20 Thread Francis Laniel
Hi. I hope you are fine and the same for your family and friends. In July, a proposal to add a new shell for U-Boot was posted on the mailing list [1]. The community discussed a lot about this changes, some people did not agree with it because the new shell is not compatible with the actual

[RFC PATCH 6/6] test: hush: Test hush loops.

2021-08-20 Thread Francis Laniel
The added tests ensure correct behavior of for, while and until loops. Signed-off-by: Francis Laniel --- test/hush/Makefile | 1 + test/hush/loop.c | 64 ++ 2 files changed, 65 insertions(+) create mode 100644 test/hush/loop.c diff --git a/test

[RFC PATCH 5/6] test: hush: Test hush commands list.

2021-08-20 Thread Francis Laniel
This commit ensures behavior of commands separated by ';', '&&' and '||'. Signed-off-by: Francis Laniel --- test/hush/Makefile | 1 + test/hush/list.c | 79 ++ 2 files changed, 80 insertions(+) create mode 100644 test/hush/list.c di

[RFC PATCH 4/6] test: hush: Test hush variable expansion.

2021-08-20 Thread Francis Laniel
This commit ensures shell variables are replaced by their values. Signed-off-by: Francis Laniel --- test/hush/Makefile | 1 + test/hush/dollar.c | 188 + 2 files changed, 189 insertions(+) create mode 100644 test/hush/dollar.c diff --git a/test

[RFC PATCH 3/6] test/py: hush_if_test: Remove the test file.

2021-08-20 Thread Francis Laniel
Commit 9087ab2cc4 ("test/py: hush_if_test: Remove the test file.") translated this test to a C test, so this python file is no more needed. Signed-off-by: Francis Laniel --- test/py/tests/test_hush_if_test.py | 192 - 1 file changed, 192 deletions(-) d

[RFC PATCH 2/6] test: hush: Test hush if/else.

2021-08-20 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 --- test/hush/Makefile | 1 + test/hush/if.c | 308

[RFC PATCH 1/6] test: Add framework to test hush behavior.

2021-08-20 Thread Francis Laniel
This commit introduces 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 --- include/test/hush.h

[RFC PATCH 0/6] Add C tests for hush

2021-08-20 Thread Francis Laniel
, indeed the following: false && false || true returns 0 in actual (2021) hush's Busybox, while it returns 1 in U-Boot. * loops: This test is quite simple as we do not have math support in U-Boot, this can be tricky to heavily test while and until loops. To conclude, here is this se

Re: [RFC PATCH v2 1/1] cmd: nvedit: Forbid key to be empty.

2021-06-30 Thread Francis Laniel
Hi. Le mercredi 30 juin 2021, 09:38:16 CEST Wolfgang Denk a écrit : > Dear Francis Laniel, > > In message <20210629161859.298630-2-francis.lan...@amarulasolutions.com> you wrote: > > Before this patch, it was possible to do the following using setenv: > > setenv '' f

[RFC PATCH v2 1/1] cmd: nvedit: Forbid key to be empty.

2021-06-29 Thread Francis Laniel
Before this patch, it was possible to do the following using setenv: setenv '' foo Then, on next reboot, U-Boot will not be able to parse environment due to it having: =foo Now, if the above command is given, an error message is thrown and environment is not modified. Signed-off-by: Francis

[RFC PATCH v2 0/1] cmd: nvedit: Forbid environment key to be empty.

2021-06-29 Thread Francis Laniel
will lead to the following being printed: ## Error: variable name cannot be empty And the environment will not be changed. Here is the diffstat for this patch: Francis Laniel (1): cmd: nvedit: Forbid key to be empty. cmd/nvedit.c | 5 + 1 file changed, 5 insertions(+) Change since: v1

Re: [RFC PATCH 1/1] cmd: nvedit: Forbid key to be empty.

2021-06-29 Thread Francis Laniel
t; > Then, on next reboot, U-Boot will not be able to parse environment due > to it > > having: > > =foo > > > > Now, if the above command is given, an error message is thrown and > environment > > is not modified. > > > > Signed-off-by: Francis Laniel &

[RFC PATCH 1/1] cmd: nvedit: Forbid key to be empty.

2021-06-28 Thread Francis Laniel
Before this patch, it was possible to do the following using setenv: setenv '' foo Then, on next reboot, U-Boot will not be able to parse environment due to it having: =foo Now, if the above command is given, an error message is thrown and environment is not modified. Signed-off-by: Francis

[RFC PATCH 0/1] cmd: nvedit: Forbid environment key to be empty.

2021-06-28 Thread Francis Laniel
will lead to the following being printed: ## Error: variable name cannot be empty And the environment will not be changed. Here is the diffstat for this patch: Francis Laniel (1): cmd: nvedit: Forbid key to be empty. cmd/nvedit.c | 5 + 1 file changed, 5 insertions(+) If you see any way

[RFC PATCH 1/1] cmd: nvedit: Forbid key to be empty.

2021-06-28 Thread Francis Laniel
Before this patch, it was possible to do the following using setenv: setenv '' foo Then, on next reboot, U-Boot will not be able to parse environment due to it having: =foo Now, if the above command is given, an error message is thrown and environment is not modified. Signed-off-by: Francis

<    1   2   3   4