[PATCH v4] cmd: cat: add new command

Simon Glass sjg at chromium.org
Sat Aug 20 23:33:28 CEST 2022


Hi Roger,

On Fri, 19 Aug 2022 at 08:08, Roger Knecht <rknecht at pm.me> wrote:
>
> Add cat command to print file content to standard out
>
> Signed-off-by: Roger Knecht <rknecht at pm.me>
> ---
> v4:
>  - Return only values from enum command_ret_t in do_cat()
>  - Use calloc() instead of malloc() for zero initialized memory
>  - Make use of CONFIG_SYS_LONGHELP
>  - Improved error messages
>
> v3:
>  - Disable 'cat' by default (CONFIG_CMD_CAT=n)
>  - Enable 'cat' in sandbox and sandbox64 defconfig
>  - Use map_to_sysmem() to fix "phys_to_virt: Cannot map sandbox address"
>  - Use puts() instead of a loop
>  - Added python test
>  - Addd usage documentation
>
> v2:
>  - Moved cat from boot to shell commands
>  - Added MAINTAINERS entry
>  - Added comments
>  - Improved variable naming
>
>  MAINTAINERS                        |  5 ++
>  cmd/Kconfig                        |  6 ++
>  cmd/Makefile                       |  1 +
>  cmd/cat.c                          | 88 ++++++++++++++++++++++++++++++
>  configs/sandbox64_defconfig        |  1 +
>  configs/sandbox_defconfig          |  1 +
>  doc/usage/cmd/cat.rst              | 49 +++++++++++++++++
>  test/py/tests/test_cat/conftest.py | 33 +++++++++++
>  test/py/tests/test_cat/test_cat.py | 22 ++++++++
>  9 files changed, 206 insertions(+)
>  create mode 100644 cmd/cat.c
>  create mode 100644 doc/usage/cmd/cat.rst
>  create mode 100644 test/py/tests/test_cat/conftest.py
>  create mode 100644 test/py/tests/test_cat/test_cat.py

Reviewed-by: Simon Glass <sjg at chromium.org>

> diff --git a/test/py/tests/test_cat/test_cat.py b/test/py/tests/test_cat/test_cat.py
> new file mode 100644
> index 0000000000..41ddefa40c
> --- /dev/null
> +++ b/test/py/tests/test_cat/test_cat.py
> @@ -0,0 +1,22 @@
[..]

> +    u_boot_console.run_command(cmd = 'exit', wait_for_echo=False)

What is that for?

Regards,
SImon


More information about the U-Boot mailing list